ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | Q&A answers.ros.org |
![]() | 1 | initial version |
Yep, definitely looks like you've created a deadlock.
By default, roscpp runs in a single thread and processes your service callbacks as part of ros::spinOnce()
(or ros::spin()
). Since service calls are blocking, when each program starts the service call it can't execute callbacks until the service call completes.
Both of your programs are probably sitting at client.call()
, waiting for the other program to process its service callback.
There are a couple of ways to solve this: