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

Looking at the additional info posted, I think your second design more-or-less makes sense. You should not use spin though because that's intended to move program control to callbacks only, and it only ends when the node shuts down. Instead, you can create the subscription and then in the while self.__var is None loop you can call spin_once on an executor. This will let callbacks run but return control to you afterwards. I don't think you need a reentrant callback group or a multi-threaded executor in this scenario.