ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
No, there is no spin_once in rospy. In rospy the subscriber's callbacks are executed in separate threads. Google quickly produces these old questions including answers:
To translate your loop from C++ you could either check periodically in a loop in the main thread, or check in each of the callbacks. Either way you likely need some thread synchronization.