Add support for docking through nav2#215
Conversation
Signed-off-by: Andrei Ionescu <aionescu@clearpath.ai>
|
Ignore the change from draft to ready-to-review, I misclicked, I've reverted it. |
| ... | ||
|
|
||
|
|
||
| class NavigationExecutionItem(ExecutionItem): |
There was a problem hiding this comment.
This is great! We can use this for other ROS 2 actions in the future, not just for navigation.
Perhaps we can name it to target ROS 2 actions more generically, what do you think about something along the lines of Ros2ActionInterface?
| ) | ||
|
|
||
|
|
||
| class NavigateToPoseExecutionItem(NavigationExecutionItem): |
There was a problem hiding this comment.
We can then perhaps call this more explicitly as NavigateToPoseActionInterface
| return NavigateToPose_GetResult_Response.deserialize(payload) | ||
|
|
||
|
|
||
| class DockExecutionItem(NavigationExecutionItem): |
There was a problem hiding this comment.
and this along the lines of DockActionInterface
There was a problem hiding this comment.
Thanks for putting this together @aionescu-cpr! Overall the changes to the abstractions make sense, I like that this opens the door to more configurable behaviors, allowing the use of other BTs than NavigateToPose.
We can probably give more thought to the naming, to prevent confusion with the existing ExecutionHandle. I've added some comments, but overall it looks good.
Thank you for the review and the naming suggestions @aaronchongth. I struggled to find a name that's not confusing, but I'm glad at least it got the point across as my intention was also to be able to extend this to other behaviours as well. I'll use your naming suggestions, update the PR and will now look at the unit tests too and update as needed. |
New feature implementation
Implemented feature
This change adds docking support using Nav2 as requested here: #187
Implementation description
The main logic change is done in the Nav2RobotAdapter's navigate function, where rather than only sending a robot to a destination, a check was added to determine whether a dock was specified in the destination. If a dock was specified then the robot is sent a DockRobot action goal, otherwise the robot is given the default action of NavigateToPose.
As part of the change, the ros2_types.py was modified to add translation for the related DockRobot_* action classes. The default zenoh config was also modified to allow the .*/dock_robot action topics. A nav2send_dock_robot.py example was also added to allow the zenoh bridge to be tested.
The large change I introduced is a refactoring of the Nav2RobotAdapter as the "navigate_to_pose" and "dock_robot" actions share a lot of the same logic. Rather than duplicate a lot of the existing code and make the adapter larger, I added a NavigationExecutionItem which encapsulates the request being executed, with two classes inheriting from this for each action: NavigateToPoseExecutionItem and DockExecutionItem. This class is responsible for executing the goal, providing updates and stopping it. The handling of these functions were previously all in the Nav2RobotAdapter class, which was simplified to now focus on mainly the control logic.
This is a large change and it may not be in the direction that the maintainers of the repo want the design to go into, so I understand if a simpler approach is requested.
GenAI Use
We follow OSRA's policy on GenAI tools
Generated-by: