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

How to change the publishing rate of topic /camera/depth/image_raw ?

asked 2016-04-26 22:32:47 -0600

Siteen gravatar image

I want to transport the data of PointCloud across the net, but the data is too large to transport. How to change the publishing rate of topic /camera/depth/image_raw ?

edit retag flag offensive close merge delete

2 Answers

Sort by » oldest newest most voted

answered 2016-04-27 03:52:58 -0600

updated 2016-04-27 04:11:28 -0600

That depends on which node is publishing that topic. I guess it's openni_camera, openni2_camera or similar. These have a parameter called data_skip, documented here: openni_camera. For example, if you set that param to 2, you'll get 10Hz instead of 30Hz (because the driver will skip 2 messages, then publish 1, then skip 2 and so on).

The advantage of this solution over using topic_tools/throttle is that this will happen inside the driver node, so you save the computational overhead caused by throttle. Assuming the throttle node runs on the same PC as the driver node, the throttle node has to memcpy all the data before throttling, which is about 300 MB/s for a Kinect or Xtion (for the point clouds). Also, you avoid the computational overhead of rectifying the images, computing a point cloud etc. for messages that are then thrown away. On a small system that's a considerable effort. Plus, all the topics (depth + rgb images, point clouds, ...) are throttled at once. Alternatively, you can reduce the resolution of the device using parameters.

The disadvantage of using data_skip instead of throttle is that you reduce the data rate for all subscribers. If you used throttle instead, you could have some nodes on the local PC subscribing to the unthrottled topic, and only remote nodes on other PCs subscribing to the throttled topic (to save network bandwidth).

edit flag offensive delete link more


It's very usable. Thank you very much.

Siteen gravatar image Siteen  ( 2016-04-27 09:14:46 -0600 )edit

answered 2016-04-27 00:25:22 -0600

NEngelhard gravatar image

You could have a look at topic_tools/throttle:

edit flag offensive delete link more


It's wonderful.

Siteen gravatar image Siteen  ( 2016-04-27 09:17:15 -0600 )edit

Question Tools

1 follower


Asked: 2016-04-26 22:32:47 -0600

Seen: 1,335 times

Last updated: Apr 27 '16