0

I am integrating ROS2 with an external tool and the message exchange needs to be synchronised. How can i know the frequency of the published message in ROS2 ?

Vishal Rawat
  • 325
  • 1
  • 3
  • 19
  • You can use wireshark to see the packets exchanged and the rate? Otherwise, you can maybe have a look at the configuration of the DDS (see RMW). Do you need to have this information at run-time? – Stoogy Aug 28 '18 at 09:13
  • It would be great if i have it in the run time, somewhere printed on the console. With this i can debug, which function is taking more time. – Vishal Rawat Aug 28 '18 at 09:30

1 Answers1

1

In ROS2 it is possible to print the frequency of a published topic into the console using

ros2 topic hz /topicname

This will return the average publishrate in Hertz.

Documentation: https://docs.ros.org/en/foxy/Tutorials/Beginner-CLI-Tools/Understanding-ROS2-Topics/Understanding-ROS2-Topics.html