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

Revision history [back]

click to hide/show revision 1
initial version

In the past, I've done this using a callback function in which the subscriber unsubscribes itself at the end. So for roscpp, this would be the ros::Subscriber::shutdown() method. Make sure to also set the subscriber buffer size to 1.

In the past, I've done this using a callback function in which the subscriber unsubscribes itself at the end. So for roscpp, rclpp, this would be the ros::Subscriber::shutdown()rclpp::Subscription::reset() method. Make sure to also set the subscriber buffer size to 1.