0
$\begingroup$

Rosanswers logo

I have a topic published by baxter robot "/robot/digital_io/torso_left_itb_button0/state" that publishes at 100 Hz.

As I am running a loop in the subscriber call back, my loop keeps running for 100 times. I want it to receive only one message/per second and hence process that loop only once. For some reason, I am not able to load the page of ros_topic throttle to take a look on how it works.

Can you please tell me how to do it via throttle or srop or any other tool that will drop the number of messages published?

Thanks!


Originally posted by Joy16 on ROS Answers with karma: 112 on 2017-04-09

Post score: 0

$\endgroup$

1 Answer 1

0
$\begingroup$

Rosanswers logo

It looks like the wiki is back up now: http://wiki.ros.org/topic_tools/throttle

The basic usage for throttling the message rate is: throttle messages <intopic> <msgs_per_sec> [outtopic]

In your case, it looks like you want to do:

 rosrun topic_tools throttle messages /robot/digital_io/torso_left_itb_button0/state 1.0

And then have your subscriber subscribe to the throttled topic /robot/digital_io/torso_left_itb_button0/state_throttle


Originally posted by ahendrix with karma: 47576 on 2017-04-09

This answer was ACCEPTED on the original site

Post score: 0

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.