Understanding RobotCommandHandle.py implemenation (#582)

Posted by @akshay-ka:

Hello,
I’m new to Open-RMF and trying to understand the framework by following the source code of the demo
ros2 launch rmf_demos_gz_classic office.launch.xml.

Currently, I’m unable to understand from where the method def follow_new_path(self, waypoints, next_arrival_estimator, path_finished_callback) is called ?

Could anyone provide guidance or clarification? Any help would be appreciated.

https://github.com/open-rmf/rmf_demos/blob/ecfecf1fc63ad3cc4f845279b732d7c246e8d7eb/rmf_demos_fleet_adapter/rmf_demos_fleet_adapter/RobotCommandHandle.py#L266

Posted by @mxgrey:

Notice the class it’s implemented for inherits rmf_adapter.RobotCommandHandle. This allows the C++ implementation of rmf_fleet_adapter to call follow_new_path on instances of the class.

In another file an instance of the class is created and then passed into the fleet handle. At that point the function can be called from the C++ side any time it’s needed.

For what it’s worth if you’re able to use the Jazzy release or the latest main, I would recommend using the EasyFullControl API instead. It’s easier to use, easier to understand, takes less code, and you’re much less likely to make mistakes when integrating with it. The latest main branch of rmf_demos shows how to use it.


Edited by @mxgrey at 2025-01-27T12:12:10Z

Posted by @akshay-ka:

Thanks for the explanation @mxgrey