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
1

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 imageJoy16 ( 2017-03-02 09:39:43 -0600 )edit

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools

2 followers

Stats

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

Seen: 593 times

Last updated: Mar 02 '17