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

As far as I understand the problem, is that the executor is spinning your node, and when the node wants to process a service, it halts spinning to let the node complete the service. The service then calls another service, which requires some other node to spin, which it is being hindered from since the executor is explicitly waiting for your service to finish before spinning. This is a deadlock, and is the primary reason why async calls to services are preferred in ROS 2.

Have a look at this answer, I think you can get around it using different callback groups. https://answers.ros.org/question/413482/ros2-asyncio-await-with-timeout-a-service-call-in-a-callback/

But whenever I encounter this situation, I think it calls for a redesign.