ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
If you want to make sure a message was sent, the simplest solution is to check that it was received. Have your node subscribe to the topic you're publishing on, and exit when it receives a message. However, topics in ROS aren't really designed to be used this way. If you want to be really sure your message has been received, this is what services are for.
Alternatively, depending on the data type, your node could set a parameter with its data on the parameter server rather than publishing. This data would then be available for any node that wanted it even after the publishing node shuts down.