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

Suspend execution of node until a message is received [closed]

asked 2017-05-22 11:55:23 -0500

jony gravatar image

Hi! As the title says I want to suspend the execution of my node (written in c++) until a message is received on a topic. There is some function in ros that do this? Thanks a lot

edit retag flag offensive reopen merge delete

Closed for the following reason Question does not follow our guidelines for questions. Please see: for more details. by tfoote
close date 2018-07-09 13:56:10.568418

1 Answer

Sort by ยป oldest newest most voted

answered 2017-05-22 12:49:11 -0500

NEngelhard gravatar image

Could you be a bit more specific? This is rather the default behaviour of a ROS-node. You set up your subscribers (or action-servers) and call ros::spin(); This will let the node idle around until something is received.

edit flag offensive delete link more

Question Tools


Asked: 2017-05-22 11:55:23 -0500

Seen: 361 times

Last updated: May 22 '17