How to know the robot's running speed in real time in the Open-RMF demo (#601)

Posted by @hollyolive:

please tell me how to know the robot’s running speed in real time in the Open-RMF demo?

Posted by @aaronchongth:

The mobile robots in Open-RMF demos use the slotcar plugin, rmf_simulation/rmf_robot_sim_gz_plugins/src/slotcar.cpp at main · open-rmf/rmf_simulation · GitHub, which calculates and sets gz linear and angular velocity commands directly. There is no interface to access this information, however you can modify the plugin to publish it out if you require it

Posted by @hollyolive:

@aaronchongth Thank you for your response.
Do you know how exactly to implement that method? I would love to hear about your own experience, if you have any.

Posted by @aaronchongth:

You can create a ROS 2 publisher in the plugin, and perhaps in this function where the velocity commands are set, rmf_simulation/rmf_robot_sim_gz_plugins/src/slotcar.cpp at main · open-rmf/rmf_simulation · GitHub, you can publish a ROS 2 message out