-
Notifications
You must be signed in to change notification settings - Fork 492
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
Add hybrid planning #813
Add hybrid planning #813
Conversation
ee54851
to
6103aed
Compare
Codecov Report
@@ Coverage Diff @@
## main #813 +/- ##
==========================================
- Coverage 60.86% 57.79% -3.06%
==========================================
Files 273 305 +32
Lines 23880 26060 +2180
==========================================
+ Hits 14533 15060 +527
- Misses 9347 11000 +1653
Continue to review full report at Codecov.
|
3454e6a
to
b753cf8
Compare
920b953
to
3e7ba55
Compare
@sjahr I would appreciate it if you take a look at c9e1691. The logic for the action result isn't working here because I'm not really sure what it's intended to do. These are the lines:
If you run it a few times, I think you'll easily be able to see the issue. |
e2a7315
to
f8b0cbd
Compare
...ng/hybrid_planning_manager/hybrid_planning_manager_component/src/hybrid_planning_manager.cpp
Outdated
Show resolved
Hide resolved
e426ec2
to
a4d3b5d
Compare
7292535
to
edb2bae
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I left some comments. I'll create a PR to try to fix those things.
..._planning_manager_component/include/moveit/hybrid_planning_manager/hybrid_planning_manager.h
Show resolved
Hide resolved
..._planning_manager_component/include/moveit/hybrid_planning_manager/hybrid_planning_manager.h
Show resolved
Hide resolved
..._planning_manager_component/include/moveit/hybrid_planning_manager/hybrid_planning_manager.h
Show resolved
Hide resolved
..._planning_manager_component/include/moveit/hybrid_planning_manager/hybrid_planning_manager.h
Show resolved
Hide resolved
..._planning_manager_component/include/moveit/hybrid_planning_manager/planner_logic_interface.h
Outdated
Show resolved
Hide resolved
..._planning_manager_component/include/moveit/hybrid_planning_manager/planner_logic_interface.h
Outdated
Show resolved
Hide resolved
...ng/hybrid_planning_manager/hybrid_planning_manager_component/src/hybrid_planning_manager.cpp
Show resolved
Hide resolved
@tylerjw Thanks for reviewing this again! I am aware of this issue but I was not able to fix it yet. I've opened a WIP PR with my progress so far but I encountered an issue I have not fixed yet. If you have the time to take a look at this you can use my PR as a start and I'd be happy to hear your feedback on this approach or to review your own solution. |
I tried fixing this in a PR to andy's branch and failed to fix it easily. I think it is important to acknowledge that one of the wonderful parts about software is that we can change it in the future and that nice software often takes many iterations to be really nice. In this case, I don't have the time to try to fix the issues I raised so I think we should just merge this as it is for now. Eventually, when one of us has time to work on this we should rewrite how the initialization of plugins work and accept that the plugin interface will probably have to change as a result. |
I had the same issue and I've fixed it with this PR |
Thanks! I think the key to solving this is to have a better solution for how hybrid_planning_manager and its logic plugin can share the same ros2 communication interfaces. When you have the time to work on it, I'd be happy to discuss the issue with you as I am struggling to find a good solution too |
a154265
to
e8c5d1b
Compare
I am now getting a parameter loading error. This started to happen after I rebased. I think it is related to the loading of
A parameter dump for the global planner shows this:
|
9227f93
to
418fe87
Compare
Re. parameter loading:
More importantly, all of these ompl parameters aren't declared or retrieved at all. No idea how this ever worked. I found this by comparing against the moveit_cpp demo. Maybe we can re-use the parameter loading code from moveit_cpp.
|
There is a default_planner_config within the ompl interface class which is used if nothing else is declared. For the simple demos, this was sufficient but you are right, that we need to add the option to pass ompl parameters. The MoveIt cpp demo just uses |
6411258
to
ca2867c
Compare
@sjahr I found the magic line that makes it all work again 👍
I don't know why it was working previously without this. Will make an issue about parameter loading. I think your idea to load the parameters from ompl is a good one. It's not just hybrid planning but many components of MoveIt that are having this issue. (#892) |
I fixed the merge conflict but it might be better to rebase this commit on main so my merge commit goes away (as we are going to merge this and not squash it). |
c7e0082
to
bb46766
Compare
bb46766
to
43d89fd
Compare
* Add hybrid_planning architecture skeleton code * Add simple state machines to hybrid planning manager and local planner * Initial global planner prototype implementation * Forward joint_trajectory with local planner * Forward hybrid planning motion request to global planner * Abstract planner logic from hybrid planning manager by using a plugin * Implement single plan execution logic * Add test launch files, RViz and demo config * Add test for motion_planning_request
* Make local planner component generic * Add next_waypoint_sampler trajectory operator * Update hybrid planning test to include collision object * Clean up code and fix minor bugs. * Update local planner component parameter * Add local collision constraint solver * Update planning scene topic name and test node * Fix bugs and runtime errors in local planner component and it's plugins * Add collision object that invalidates global trajectory * Add simple "stop in front of collision object" demo * Add hybrid planning manager reaction to local planner feedback * Fix ament_lint_cmake * Ensure that local planner start command and collision event are send once * Add simple replanning logic plugin * Use current state as start state for global planner * Use RobotTrajectory instead of constraint vector describe local problem * Add PlanningSceneMonitorPtr to local solver plugin * Add local planner frequency parameter * Use PID controller to create control outputs for robot controller * Add hybrid_planning_manager config file * Add more complex test node * Update README * Reset index in next_waypoint_sampler * Use correct isPathValid() interface * Rename path_invalidation flag * Read planning scene instead of cloning it in local planner * Add TODO creator * Rename local constraint solver plugin * Use read-locked access to the planning scene for collision checking * Rename constraint_solver into local_constraint_solver * Add missing pointer initialization
* Export missing plugins * Use std::chrono_literals * Construct smart pointers with std::make_* instead of 'new' * Fixup const-ref in function signatures, reduce copies * Improve planning scene locking, robot state processing, controller logic
* Add forward_trajectory local solver plugin (moveit#359) * Use ros2_control based joint simulation and remove unnecessary comment * Update copyrights * Restructure hybrid planning package * Fix formatting and add missing time stamp in local solver plugin * Remove unnecessary logging and param loading * Enable different interfaces between local planner and controller * Use JointGroupPositionController as demo hardware controller
* Add reset method for trajectory operator and local constraint sampler * Refactor next_waypoint_sampler into simple_sampler * Include collision checking to forward_trajectory and remove unneeded plugin * Fix formatting and plugin description * Update README and add missing planner logic plugin description Add TODO to use lifecycle components nodes to trigger initialization Return a reaction result instead of bool on react() Set invalidation flag to false on reset() in ForwardTrajectory local solver Return local planner feedback from trajectory operator function calls Fix segfault caused by passing through the global trajectory Update comment, unify logging and add missing config parameters Update to rolling
…eit#585) Fix hybrid planning include folders (moveit#675) Order stuff in the CMakeLists.txt and remove control_box package Update README Move member initialization to initializer lists Remove control_box include dependency Replace "loop-run" with "iteration" Remove cpp interface class constructors and destructors Use joint_state_broadcaster, clean up test node, add execution dependencies Use only plugin interface header files and add missing dependencies Clean up constructor and destructor definitions Declare missing parameter in moveit_planning_pipeline_plugin Move rclcpp::Loggers into anonymous namespaces Switch CI branches to feature/hybrid_planning Update message name Remove moveit_msgs from .repos file Update github workflows Remove note from readme about building from source Minor renamings, make reset() noexcept Check for vector length of zero Load moveit_cpp options with the Options helper. Reduces LOC. Set the planning parameters within plan() Function renaming Authors and descriptions in header files only. New header file for error code interface. Update namespacing Use default QoS for subscribers Better progress comparison Add publish_joint_positions and publish_joint_velocities param Grammar and other minor nitpicks Restore moveit_msgs to .repos, for now
Refactor Global and Local Planner Components into NodeClasses Add a simple launch test (#1) Try to fix plugin export; add helpful debug when stuck Error if global planning fails READY and AWAIT_TRAJ states are redundant Lock the planning scene as briefly as possible Specify joint group when checking waypoint distance Implement a reset() function in the local planner Detect when the local planner gets stuck
Update robot state properly; remove debug prints; clang format Check if the local planner is stuck within the forward_traj plugin, not local_planner_component
* Add unsuccessful action Hybrid Planning events and handle them in logic * Replace std::once with simple bool variable * Remove unneeded variable and update comments Don't const& for built-in types Co-authored-by: Tyler Weaver <tylerjw@gmail.com>
* Install hybrid_planning_demo_node separately to avoid exporting it * Fix exported include directory * Remove getTargetWayPointIndex() from abstract trajectory operator class * Delete unused getTargetWayPointIndex()
43d89fd
to
5cd1a5f
Compare
This continues from #488. It addresses most of the comments there.
The big comment that's not addressed yet relates to the timer that is used in launching
hybrid_planning_manager/hybrid_planning_manager.cpp
. I made an issue for that. #811 and #763 tried to tackle that issue but they both crash. So I think it's something we can work on improving later.I'll work on cleaning up the corresponding tutorial PR and adding some tests for this.
Suggestions on how to clean up the commit history are welcome. I'd be fine with squashing into five commits or so.
This work is sponsored by RE2 Robotics.