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

Does new Callbacks overwrite Callback queue when full or they get rejected?

asked 2012-10-22 20:54:35 -0500

Dumpsomer gravatar image

updated 2014-01-28 17:14:01 -0500

ngrennan gravatar image

When the Global Callback queue is full, if there is a new Callback coming in, would it overwrite the the old Callbacks or would the new Callback simply get dropped?

If it get dropped, what would be the best way to always get the latest message? I don't care if some old messages are drop. My application is that I want to get the current position of the robot. Even though the positioning system is updating the position at fast rate, the robot only want the read the latest position information periodically at a lower rate.

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2012-10-22 21:25:16 -0500

Lorenz gravatar image

Callbacks are methods that are executed when messages are received. If you set the queue size to 1, all old messages will be dropped if they cannot be processed and a new message comes in. That way, your callbacks will always be executed on the most recent message.

edit flag offensive delete link more

Question Tools


Asked: 2012-10-22 20:54:35 -0500

Seen: 301 times

Last updated: Oct 22 '12