-
Notifications
You must be signed in to change notification settings - Fork 490
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
Hybrid Planning feature #300
Comments
Hello @sjahr ! |
Hi @gokul-gokz, In case you are interested in contributing, it would be great if you could give a rough description of how or in which scenario you want to use hybrid planning. Additionally, I've started with the implementation of a prototype last week and plan to open a work-in-progress PR this week. I could add you as a reviewer once a first functioning version exists if you are interested. |
Hi @sjahr, first of all, I am also very interested in this effort and thanks so much for making it happen. I am really forward for the PR.
I think you can also have a look at tesseract_ros where Trajopt is used. Another question that I have is that will the collision checking be done at realtime during execution as well, in this implementation? |
Thanks for the hint @Briancbn. Yes, collision checking is planned to be done at real-time during the execution. We want to include a trajectory monitor in the hybrid planning manager for online collision checking of the global trajectory (assuming that during the execution unforeseen collisions could appear). Furthermore, one of the use-cases of the local planner could be to react at real-time to new detected collisions based on sensor data. How the system reacts to collision's will depend on customizable logic inside the planning manager. |
Nice write-up @sjahr! I realize you do not have a ton of time to implement this, so the following concerns may not be relevant at this stage of development. However I would encourage you to think about this as you working on this project:
|
You should consider inheriting from a ros2_control JointTrajectoryController for the Local Planner. That will ensure the system is realtime safe. It also allows you to update trajectories quickly (maybe 100 Hz or so). Finally, it eliminates one extra component in the pipeline. I don't see any downsides to inheriting from a JointTrajectoryController. See 'trajectory replacement`: http://wiki.ros.org/joint_trajectory_controller#Trajectory_replacement |
Actually, I'm not 100% sure if you would want to inherit from a JointTrajectoryController or a ForwardCommandController. ForwardCommandController would let you hit the really high control rates. |
Thanks a lot for the input! I was definitely thinking about including some kind of wrapper to make ros2_controllers available as local planners. I agree with you that often a local planner is basically a controller. I had a hard time distinguishing between both as the line between a local planner and a controller is blurry and one could even say that a controller is a kind of local planner. |
OK, I'm glad you're thinking about these things. Inheriting from the controller doesn't necessarily mean you have to implement the planner like a controller. Think of it more in coding terms -- it gives you access to the trajectory that may already be executing.
I do think this is wrong. Even a simple PID controller has a state (the error and the error integral). |
I did something like that in ROS1 before: https://drive.google.com/file/d/15Q2UxuUGHTMoC76gnOzB3C8KYzzEa9BG/view?usp=sharing |
Good point, I've corrected the comment above, and thanks again for your hints. |
Hi guys, excited about the potentials here. One question is, how is realtime defined here? Could I expect to run this on a RT kernel and get some kind of soft realtime expectation? I ask because I can see applications in flight/critical hardware running ROS2+MoveIt2 if traditional realtime requirements could be met or approximated. |
@tianshiz Yes, goal is that the architecture will be somehow soft real-time capable. For example by using ROS 2 and probably some kind of (soft) real-time capable Linux kernel. |
* Initial commit for MTC Tutorial * add updated source code for MTC tutorial package * Updates to tutorial code and added tutorial text explaining the code * Typo fixes, formatting fixes, and clarifications Co-authored-by: Henning Kayser <henningkayser@picknik.ai> * Added a reference to the concepts section of the MTC example page * Apply suggestions from code review Co-authored-by: AndyZe <andyz@utexas.edu> * Add comment about grasp_frame_transform * Add note that the SerialContainer is optional * Disabled clang-format on intentionally-shortened lines for better viewing without needing to scroll * Updates .repos * Add hints about several non-intuitive features * Update panda controllers filenames * Formatting fix Co-authored-by: Joe Schornak <joe.schornak@gmail.com> Co-authored-by: Henning Kayser <henningkayser@picknik.ai> Co-authored-by: AndyZe <andyz@utexas.edu> Co-authored-by: AndyZe <zelenak@picknik.ai>
(last updated 04/22/2021)
Intro
Currently, MoveIt’s core strength is offline, global motion planning in a kind of “Sense-Plan-Act” based behavior. But most scenarios in which robots are used involve a dynamic environment with moving collision objects and target poses. Furthermore, during motion execution robots often have to adapt to unexpected obstacles, like an uneven surface. Example scenarios could involve:
To make MoveIt better utilizable in these scenarios, I've started working on a hybrid motion planning architecture for MoveIt 2 as part of the roadmap's Milestone 2: Real-time Support #277. The idea is to simultaneously plan globally and locally at different speeds. Therefore, a global planner (i.e. sampling-based) and a fast local planner/controller are combined with mechanisms included to react on different events (i.e. replan a trajectory if an unforeseen collision is detected). This will enable:
Besides implementing an example demo, the goal of the project is to provide a generic architecture that can be used to implement custom hybrid planners, meaning that it will be possible to configure the planner logic and to provide interfaces to include custom planner implementations.
To gain as much feedback and input as possible I want to share the progress of the ongoing work on this issue. Please leave a comment on everything that’s on your mind related to hybrid motion planning with MoveIt.
Architecture Draft
To achieve the functionality outlined above, I propose the following architecture:
![Hybrid Planner Architecture](https://user-images.githubusercontent.com/44898064/99686294-c179cf00-2a83-11eb-9877-ce9ae1603416.png)
Components
Hybrid Planning Manager
The Planning Manager is the central component of the architecture. The main tasks of the manager are:
Subcomponents are:
Global Planner
The main task of this component is to deliver a global trajectory on-demand including to plan around complex obstacles. I assume that the global planner is:
Subcomponents are:
(see here).
Local Planner
It will be possible to use a fast online planner or a controller as local planner. The local planner component should be utilized to optimize the trajectory locally or even to locally sample new points for example to dodge an unexpected collision object or grasp something.
So the main tasks of this component are:
Its subcomponents are:
Although in this architecture draft I want to use MoveIt based planners, the user won't be restricted to them. MoveIt already has a great set of planners, but through the purely message-based interaction between the components, you are free to use any planner/controller implementation you want, as long as it is a ROS2 node/component and overs an action server for the hybrid planning manager.
Communication
Action Interfaces
The message-based communication between the components is realized through action interfaces. This enables the architecture to be highly customizable for new planners. The messages are easily extensible and the behavior defined by exchanged messages can be modified in the planner manager's Planning Logic subcomponent.
For the first implementation, these action definitions are proposed:
---
# Result
---
# Feedback
---
MoveItErrorCodes error_code
---
string feedback
---
MotionPlanRequest response
---
MoveItErrorCodes error_code
---
MoveItErrorCodes error_code
---
string feedback
If you are thinking about using this for your own planners, it would be very interesting to hear opinions on the message types and which data should be exchanged between the components.
Besides the actions, real-time data is shared between the components via topic interfaces. Both topics outside the architecture represent generic hardware data topics, for example, to receive sensor measurements or to send motion commands to a robot's controller. Of course, it is up to the user's setup and the chosen planners which sensor topics are subscribed. The /global_planning_solution topic is used to share the newest planned global trajectory between the components. The Hybrid Planning Manager handles when the local planner starts with planning and execution.
Example workflow
This should give you an idea of a simple planning logic for the hybrid planner. The scenario would be something like a simple motion through free space with the possibility that motion execution can undergo small disturbances. In the figure above, the Hybrid Planning Manager receives the planning problem and coordinates the collaboration between both planners. After the initial global motion plan is computed by the Global Planner, the Local Planner starts to plan and executes the motion. The Hybrid Planning Manager monitors the occurring events and gives new instructions to the planners if necessary.
Planned demos
Proof of concept
As a first demo, I want to provide a simple proof of concept of the architecture. The demo flow is based on the above mentioned “Balancing a tray while placing on a table” use case:
Replanning
For the next demo, I want to include more complexity to the problem by adding a new collision object after the initial global planning.
Next steps
...
If you have any ideas or demo use cases you’d like to see, please share them in the comments!
Roadmap
Ongoing discussions
Which data should the action messages include?Feature outline/ ideas
The text was updated successfully, but these errors were encountered: