ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

How to publish topics at specific rate?(Python)

asked 2017-03-01 18:03:38 -0600

Joy16 gravatar image

I have 5 topics publishing images at different rates. I want them to publish at the same rate and hence I am trying to set the rostopic hz to a constant rate for all the 5 topics. How can I do it in rospy?

My understanding is that rospy.Rate() will work only for that loop of code. How can I set the rate a which the messages are being published?

Thanks

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
2

answered 2017-03-02 06:41:19 -0600

mgruhler gravatar image

updated 2017-03-02 06:41:32 -0600

This needs to be done/handled in the node actually sending the messages. Either they provide a possibility to set the rate, or not. Typcially, for most sensors (cameras, laser scanners, ...), they don't. You will get your messages as fast as possible.

If you want, you could, however, push all those topics through a topic_tools throttle. See the ROS wiki on the syntax.

edit flag offensive delete link more

Comments

Thank you very much!

Joy16 gravatar image Joy16  ( 2017-03-02 09:39:43 -0600 )edit

Question Tools

2 followers

Stats

Asked: 2017-03-01 18:03:38 -0600

Seen: 1,569 times

Last updated: Mar 02 '17