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

What happens is a node receives a message while it's in the middle of a callback?

asked 2011-07-25 10:34:01 -0600

xeronia gravatar image

I'm thinking of having a node send a message to another node as part of a callback function. It should receive a message from another node at about this time as well, before it finishes the callback function. What will ROS do in this case? Will the node pause the first callback function in order to execute the second, or will it finish executing the first callback before executing the callback function for the message it just received?


edit retag flag offensive close merge delete

2 Answers

Sort by ยป oldest newest most voted

answered 2011-07-25 11:56:34 -0600

dornhege gravatar image

callbacks will only be called from ros::spin(Once) or by manually calling the callback-queues to be processed.

Unless you use some kind of threading the function will finish and the other callback will be called in the next loop.

edit flag offensive delete link more

answered 2011-07-26 07:20:11 -0600

bhaskara gravatar image has a good overview of roscpp's threading options.

edit flag offensive delete link more

Question Tools


Asked: 2011-07-25 10:34:01 -0600

Seen: 1,516 times

Last updated: Jul 26 '11