Robotics StackExchange | Archived questions

Suspend execution of node until a message is received

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

Asked by jony on 2017-05-22 11:55:23 UTC

Comments

Answers

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.

Asked by NEngelhard on 2017-05-22 12:49:11 UTC

Comments