Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Navigation #143

Draft
wants to merge 66 commits into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
66 commits
Select commit Hold shift + click to select a range
dd858f6
initial partial WIP commit for path following walking controller
SimoneMic Nov 8, 2022
0d5713d
first partial commit for accepting an input path for the walking cont…
SimoneMic Nov 9, 2022
72f7e52
fixed compile bug and corrected data flow
SimoneMic Nov 10, 2022
99730cd
fixed bug in m_path handling out of index
SimoneMic Nov 10, 2022
d6e830f
added feet position logging port
SimoneMic Nov 10, 2022
d8b2655
fixed footprint port data type for visual debug
SimoneMic Nov 11, 2022
bad9c40
changed feet list origin data -> implemented a method on TrajectoryPl…
SimoneMic Nov 11, 2022
e50e858
fixed footprints data sending
SimoneMic Nov 14, 2022
afdcb0f
The input path is expressed in the odom (world) frame. It gets pruned…
SimoneMic Nov 15, 2022
067cc39
fixed typo in indexes
SimoneMic Nov 15, 2022
3ab59e4
tmp commit
SimoneMic Nov 16, 2022
309b9f1
tmp commit: virtual_unicycle_base publishing fixed in base of the con…
SimoneMic Nov 16, 2022
27bf202
Streaming correct odometry information from internal rootLink state. …
SimoneMic Nov 17, 2022
0ccc36c
added port streaming desired CoM positions
SimoneMic Nov 22, 2022
7759b18
initial commit for CoM trajectory evaluation: in this commit we are c…
SimoneMic Nov 22, 2022
0994e81
tmp commit. display when the robot enters in double support. actual C…
SimoneMic Nov 22, 2022
d82606c
set up writing on port the trigger for replanning the navigation once…
SimoneMic Nov 24, 2022
b322c25
added initial odom velocity estimation on port
SimoneMic Nov 24, 2022
bcc9899
changed navigation trigger fire condition. Checking the closest CoM o…
SimoneMic Nov 29, 2022
6fb1d04
added timed trigger option afer starting swinging the step
SimoneMic Nov 30, 2022
7def85f
tuned wait delay for nav trigger
SimoneMic Dec 2, 2022
cbdfd47
added stickBot robot config. WIP set up TrajectoryPlanner to work wit…
SimoneMic Jan 26, 2023
f301b02
updated config files for stickBot. Implemented changes to the Unicycl…
SimoneMic Jan 31, 2023
e660068
fixed program flow with proper handling of every config - TODO add ma…
SimoneMic Feb 1, 2023
604e14e
tuned parameters for side walking -> increased minWidth to 0.12
SimoneMic Feb 2, 2023
69d1774
tmp commit with small changes on program flow. Added debug print on f…
SimoneMic Feb 6, 2023
6148778
removed unused code (transformation and pruning of nav path in person…
SimoneMic Feb 7, 2023
ff7f9f9
transforming input path into odom frame before extracting footsteps
SimoneMic Feb 9, 2023
718c670
added config files for ergoCubGazeboV1
SimoneMic Mar 7, 2023
5b9970e
fixed ergoCubGazeboV1 config files
SimoneMic Mar 7, 2023
39c7e1e
tuned parameters for interpolation footsteps planner (working in sim)…
SimoneMic Mar 7, 2023
ddf2d90
set minAngleVariation to 0 for plannerParams. Updated PID values
SimoneMic Mar 13, 2023
63e6cd2
added new config parameter plannerMode. Cleaned code from comments an…
SimoneMic Mar 21, 2023
9abd2c4
added config params for navigationReplanningDelay and navigationTrigg…
SimoneMic Mar 24, 2023
df3489c
removed unnecessary debug output and fixed some comments
SimoneMic Mar 24, 2023
9e9c332
now the WalkingModule::computeVirtualUnicycleThread uses the same loo…
SimoneMic Mar 24, 2023
11ed5d7
added segfault safeguard when accessing m_FKSolver on computeVirtualU…
SimoneMic Mar 24, 2023
d7d11e3
removed addWaypointsOdom
SimoneMic Mar 27, 2023
d685f58
ordered code and comments
SimoneMic Mar 27, 2023
7e3c3d3
properly closing parallel threads to avoid segfault
SimoneMic Mar 30, 2023
d49f9c4
updated files with changes from walking-controller version 0.7
SimoneMic Apr 4, 2023
cfc6cf5
removed dependency from enum class NavigationSetup
SimoneMic Apr 11, 2023
71e9ae4
set m_runThreads as atomic
SimoneMic Apr 12, 2023
56da231
moved navigation params in separate file
SimoneMic Apr 12, 2023
b11663d
fixed typo for ini file config
SimoneMic Apr 12, 2023
f82279e
porting navigation features to separate file NavigationHelper
SimoneMic Apr 13, 2023
345e3d9
implemented moving on other file the navigation trigger logic
SimoneMic Apr 13, 2023
f4ba7ce
first tmp changes to move also odom thread out of module
SimoneMic Apr 13, 2023
a94a1f8
externalized threads about odom and nav trigger to NavHelper object
SimoneMic Apr 17, 2023
e690881
added else station in case of null feet pointers
SimoneMic Apr 17, 2023
c0a224e
added footprints publishing in navHelper
SimoneMic Apr 17, 2023
e3c0041
implemented changes on publishing footsteps
SimoneMic Apr 17, 2023
c7c720c
added CoM publishing
SimoneMic Apr 18, 2023
518374a
added yarp port prefix and implemented changes in module
SimoneMic Apr 18, 2023
9d4087e
fixed bug in reading config. added config file for stream nav info
SimoneMic Apr 18, 2023
e9a894d
changed footsteps vectort type from Vector3 to struct Pose (x,y,theta)
SimoneMic Apr 18, 2023
2e29af0
Improved getFootprints conversion
SimoneMic Apr 18, 2023
3e1e40f
moved stanceFoot as first element in getUnicycleState (it's an input)
SimoneMic Apr 18, 2023
15b3e2a
anticipated the m_publishInfo check on init
SimoneMic Apr 18, 2023
f0b8952
removed unused code and vars. Finalized switching to navHelper
SimoneMic Apr 19, 2023
bb72e97
implemented navigation controller footstep planner in walking-controller
SimoneMic May 17, 2023
b16eb71
restored saturations and pid values to default
SimoneMic May 18, 2023
97243bf
code formatting and comments
SimoneMic May 19, 2023
751c2de
removed warning in navigation trigger
SimoneMic May 24, 2023
a9d1167
using shared memory for yarp port
SimoneMic Jun 5, 2023
1eeebe0
tuned param for simulation
SimoneMic Jun 16, 2023
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 23 additions & 0 deletions .vscode/c_cpp_properties.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
{
"configurations": [
{
"name": "Linux",
"includePath": [
"${workspaceFolder}/**",
"/home/user1/robotology-superbuild/build/src/walking-controllers/src/WalkingModule/",
"/home/user1/robotology-superbuild/build/install/include/**",
"/home/user1/robotology-superbuild/build/install/include/BipedalLocomotion/ParametersHandler/**",
"/home/user1/robotology-superbuild/build/install/include/BipedalLocomotion/**",
"/home/user1/robotology-superbuild/build/install/include/OsqpEigen/**",
"/home/user1/robotology-superbuild/src/UnicyclePlanner/**",
"/usr/include/eigen3/**"
],
"defines": [],
"compilerPath": "/usr/bin/gcc",
"cStandard": "gnu17",
"cppStandard": "gnu++17",
"intelliSenseMode": "linux-gcc-x64"
}
],
"version": 4
}
78 changes: 78 additions & 0 deletions .vscode/settings.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,78 @@
{
"files.associations": {
"cctype": "cpp",
"clocale": "cpp",
"cmath": "cpp",
"csignal": "cpp",
"cstdarg": "cpp",
"cstddef": "cpp",
"cstdio": "cpp",
"cstdlib": "cpp",
"cstring": "cpp",
"ctime": "cpp",
"cwchar": "cpp",
"cwctype": "cpp",
"array": "cpp",
"atomic": "cpp",
"strstream": "cpp",
"bit": "cpp",
"*.tcc": "cpp",
"bitset": "cpp",
"chrono": "cpp",
"cinttypes": "cpp",
"compare": "cpp",
"complex": "cpp",
"concepts": "cpp",
"condition_variable": "cpp",
"cstdint": "cpp",
"deque": "cpp",
"forward_list": "cpp",
"list": "cpp",
"map": "cpp",
"set": "cpp",
"string": "cpp",
"unordered_map": "cpp",
"unordered_set": "cpp",
"vector": "cpp",
"exception": "cpp",
"algorithm": "cpp",
"functional": "cpp",
"iterator": "cpp",
"memory": "cpp",
"memory_resource": "cpp",
"numeric": "cpp",
"optional": "cpp",
"random": "cpp",
"ratio": "cpp",
"regex": "cpp",
"string_view": "cpp",
"system_error": "cpp",
"tuple": "cpp",
"type_traits": "cpp",
"utility": "cpp",
"fstream": "cpp",
"future": "cpp",
"initializer_list": "cpp",
"iomanip": "cpp",
"iosfwd": "cpp",
"iostream": "cpp",
"istream": "cpp",
"limits": "cpp",
"mutex": "cpp",
"new": "cpp",
"numbers": "cpp",
"ostream": "cpp",
"semaphore": "cpp",
"sstream": "cpp",
"stdexcept": "cpp",
"stop_token": "cpp",
"streambuf": "cpp",
"thread": "cpp",
"cfenv": "cpp",
"typeindex": "cpp",
"typeinfo": "cpp",
"valarray": "cpp",
"variant": "cpp",
"*.ipp": "cpp"
}
}
1 change: 1 addition & 0 deletions src/CMakeLists.txt
Original file line number Diff line number Diff line change
Expand Up @@ -14,3 +14,4 @@ add_subdirectory(KinDynWrapper)
add_subdirectory(RetargetingHelper)
add_subdirectory(WalkingModule)
add_subdirectory(JoypadModule)
add_subdirectory(NavigationHelper)
10 changes: 10 additions & 0 deletions src/NavigationHelper/CMakeLists.txt
Original file line number Diff line number Diff line change
@@ -0,0 +1,10 @@
# Copyright (C) 2019 Fondazione Istituto Italiano di Tecnologia (IIT)
# All Rights Reserved.
# Authors: Giulio Romualdi <[email protected]>

add_walking_controllers_library(
NAME NavigationHelper
SOURCES src/NavigationHelper.cpp
PUBLIC_HEADERS include/WalkingControllers/NavigationHelper/NavigationHelper.h
PUBLIC_LINK_LIBRARIES WalkingControllers::YarpUtilities WalkingControllers::iDynTreeUtilities WalkingControllers::KinDynWrapper WalkingControllers::TrajectoryPlanner WalkingControllers::StdUtilities ctrlLib
PRIVATE_LINK_LIBRARIES Eigen3::Eigen)
Original file line number Diff line number Diff line change
@@ -0,0 +1,73 @@
/**
* @file NavigationHelper.h
* @authors Simone Micheletti <[email protected]>
* @copyright 2023 iCub Facility - Istituto Italiano di Tecnologia
* Released under the terms of the LGPLv2.1 or later, see LGPL.TXT
* @date 2023
*/

#ifndef NAVIGATION_HELPER__HPP
#define NAVIGATION_HELPER__HPP

#include <yarp/os/BufferedPort.h>
#include <yarp/os/Bottle.h>
#include <atomic>
#include <thread>
#include <deque>

//#include <WalkingControllers/WalkingModule/Module.h>
#include <WalkingControllers/KinDynWrapper/Wrapper.h>
#include <WalkingControllers/TrajectoryPlanner/StableDCMModel.h>
#include <WalkingControllers/TrajectoryPlanner/TrajectoryGenerator.h>

namespace WalkingControllers
{
class NavigationHelper
{
private:
yarp::os::BufferedPort<yarp::os::Bottle> m_unicyclePort; /**< Port that streams odometry info of the virtual unicycle. */
yarp::os::BufferedPort<yarp::os::Bottle> m_replanningTriggerPort; /**< Publishes the flag triggering the navigation's global planner. */
yarp::os::BufferedPort<yarp::os::Bottle> m_feetPort; /**< Feet port vector of feet positions (left, right). */
yarp::os::BufferedPort<yarp::sig::Vector> m_plannedCoMPositionPort; /**< Desired CoM position port for naviagation purposes. */
std::atomic<bool> m_runThreads{false};
std::deque<bool>* m_leftInContact;
std::deque<bool>* m_rightInContact;
double m_navigationReplanningDelay; /**< Delay in seconds of how much to wait before sending the trigger to the navigation stack after exiting double support. */
int m_navigationTriggerLoopRate; /**< Loop rate for the thread computing the navigation trigger*/
bool m_wasInDoubleSupport;
bool m_publishInfo;
std::deque<iDynTree::Vector3> m_desiredCoM_Trajectory; /**< Deque containing the desired CoM trajectory projected on the ground in pose x, y, theta. */

std::thread m_virtualUnicyclePubliserThread; /**< Thread for publishing the state of the unicycle used in the TrajectoryGenerator. */
std::thread m_navigationTriggerThread; /**< Thread for publishing the flag triggering the navigation's global planner. */

const std::string m_portPrefix = "/navigation_helper";

public:
NavigationHelper();
~NavigationHelper();

bool setThreads(bool status);
bool closeThreads();
bool closeHelper();
bool init(const yarp::os::Searchable& config, std::deque<bool> &leftInContact, std::deque<bool> &rightInContact,
std::unique_ptr<WalkingFK> &FKSolver,
std::unique_ptr<StableDCMModel> &stableDCMModel,
std::unique_ptr<TrajectoryGenerator> &trajectoryGenerator
);
void computeNavigationTrigger();
void computeVirtualUnicycleThread(std::unique_ptr<WalkingFK> &FKSolver,
std::unique_ptr<StableDCMModel> &stableDCMModel,
std::unique_ptr<TrajectoryGenerator> &trajectoryGenerator
);

bool publishPlannedFootsteps(std::unique_ptr<TrajectoryGenerator> &trajectoryGenerator);
bool publishCoM(bool newTrajectoryMerged,
std::deque<iDynTree::Vector2> &m_DCMPositionDesired,
std::unique_ptr<StableDCMModel> &m_stableDCMModel,
std::deque<iDynTree::Transform> &m_leftTrajectory,
std::deque<iDynTree::Transform> &m_rightTrajectory);
};
}

#endif
Loading