ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
2

Creating a throttle node

asked 2012-08-01 01:35:26 -0500

bgagnon gravatar image

Hello,

I was only able to find documentation online for command line tools for throttling or the other topic_tools for that matter.

Is there a way to create a throttle node from a launch file? I want to go from 30hz to something less. Thanks,

Blair

edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted
6

answered 2012-08-01 01:50:11 -0500

Lorenz gravatar image

Just use the command line tools in roslaunch:

<launch>
  <node name="foo_throttler" type="throttle" pkg="topic_tools" args="messages /input_topic 30 /input_topic_throttled" />
</launch>
edit flag offensive delete link more

Comments

Ha! So simple that I didn't even try that. Thanks!

bgagnon gravatar image bgagnon  ( 2012-08-01 02:35:23 -0500 )edit

This is the correct answer but I wish there were a way to inform a node that you don't need the data at the higher rate. Without this capability, a lot of processing is wasted on the publisher.

sedwards gravatar image sedwards  ( 2012-08-01 04:50:22 -0500 )edit

I have tried this but I can not get the rate I want. For example, my input_topic is 200Hz, but my input_topic_throttled is only 25Hz, even if I use 100 in the args.

ZiyangLI gravatar image ZiyangLI  ( 2015-01-27 21:30:59 -0500 )edit

Ik it's a very late reply to this post but replying if it can help someone else. for @ZiyangLl comment, you can write it like this:

<launch>
<node name = "input_topic_throttler" type="drop" pkg="topic_tools" args= "/input_topic 7 8 /input_topic_throttled" />
</launch>

This will drop every 7 frames of incoming 8 frames, So 200/8 = 25 Hz (taking only one frame from every 8 frames, from a 200 frame stack)

one gravatar image one  ( 2020-08-05 12:34:02 -0500 )edit

@one I guess we replace input_topic with the actual topic I wish to throttle? Also, I would have to make a script where I create the node right?

distro gravatar image distro  ( 2022-04-16 19:44:47 -0500 )edit

Yes, input_topic is the topic you want to throttle. I think you can directly add it to your launch file http://wiki.ros.org/topic_tools/throttle

one gravatar image one  ( 2023-01-23 13:53:57 -0500 )edit
0

answered 2022-04-16 11:23:47 -0500

lucasw gravatar image

updated 2022-04-16 11:24:06 -0500

For nodelet based throttling see http://wiki.ros.org/nodelet_topic_too... and https://github.com/lucasw/camera_thro... (which has some patches on https://github.com/jon-weisz/camera_t...).

To use a different message type other than the provided Image types there are a few steps to jump through, you could start with the camera_throttler_nodelets repo and add typedef and PLUGIN_EXPORT_CLASS lines to init.cpp, then add an entry in plugin_description.xml (and then create a nodelet manager and nodelet loader or standalone nodelet in your launch file... but that's the price of performance here).

edit flag offensive delete link more

Question Tools

Stats

Asked: 2012-08-01 01:35:26 -0500

Seen: 5,181 times

Last updated: Apr 16 '22