Ask Your Question
0

is there a way to publish topics of the same node at different rates

asked 2017-05-14 07:55:37 -0600

johnd gravatar image

I have a single node publishing 5 topics and would like to publish them at different rates. (Python)

edit retag flag offensive close merge delete

Comments

3

Probably not something you'll want to hear, but what have you tried yourself already? How much programming experience do you have? If I say: sure, just use different threads / timer callbacks, does that mean anything to you?

gvdhoorn gravatar imagegvdhoorn ( 2017-05-14 08:03:27 -0600 )edit

1 Answer

Sort by ยป oldest newest most voted
0

answered 2017-05-15 11:05:31 -0600

lucasw gravatar image

http://wiki.ros.org/rospy/Overview/Ti...

def update1(event):
    pub1.publish(msg1)

def update2(event):
    pub2.publish(msg2)

def update3(event):
    pub3.publish(msg3)
...

rospy.Timer(rospy.Duration(1.0 / rate1), update1)
rospy.Timer(rospy.Duration(1.0 / rate2), update2)
rospy.Timer(rospy.Duration(1.0 / rate3), update3)
...
edit flag offensive delete link more

Your Answer

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

Add Answer

Question Tools

Stats

Asked: 2017-05-14 07:55:37 -0600

Seen: 332 times

Last updated: May 15 '17