throttle in topic_tools can not give me the rate I want

asked 2015-01-27 03:06:53 -0500

ZiyangLI gravatar image

Dear all,

I have a node publishing Odom messages at 200Hz and I don't want to change this.

One of my subscriber can not handle the messages so fast so I use throttle in topic_tools to throttle the publisher at 100Hz.

The strange thing is that I only get 25Hz Odom_throttle(checked with rostopic hz). So what's the problem?

I also noticed that if I defined my subscriber(listen to the 200Hz topic) like this

ros::Subscriber sub = nh.subscribe("odom", 1, odomCallback);

then I will also only get 25Hz result.

I have to define the subscriber as following to get 200Hz result:

ros::Subscriber sub = nh.subscribe("odom", 1, viconCallback, ros::TransportHints().tcpNoDelay());

Look forward to any help!

edit retag flag offensive close merge delete


I also issue this at Github

ZiyangLI gravatar image ZiyangLI  ( 2015-01-28 00:10:50 -0500 )edit