Robotics StackExchange | Archived questions

throttle in topic_tools can not give me the rate I want

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!

Asked by ZiyangLI on 2015-01-27 04:06:53 UTC

Comments

I also issue this at Github https://github.com/ros/ros_comm/issues/560

Asked by ZiyangLI on 2015-01-28 01:10:50 UTC

Answers