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

Does ROS optimize around unheard messages?

asked 2012-01-03 08:02:23 -0500

luckyeights gravatar image

I'm running ROS on a system with low resources.

If I have a publisher streaming messages to a ROS topic (here, a topic which carries sonar readings), but the topic has no listeners, does ROS handle that data? Or is it moved to temporary storage? What extra load, if any, does the publishing of message introduce to the system?

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-01-03 10:09:48 -0500

dornhege gravatar image

updated 2012-01-03 10:10:18 -0500

The main overhead is you filling/creating the message + marshalling. If you want to avoid your work: You can check for the getNumSubscribers property in a publisher to prevent doing any work (This is done, for example, in the kinect driver).

Messages should not be stored temporarily unless the topic is latched.

edit flag offensive delete link more

Question Tools


Asked: 2012-01-03 08:02:23 -0500

Seen: 298 times

Last updated: Jan 03 '12