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

ros::spin() should be fair about the scheduling of the different ROS capabilities, so I'm not sure your actual problem is that you can't call the service because of the subscriber. Did you validate this by disabling the subscriber or throttling the topic? If this is the deterministic problem you describe, please file a detailed issue at https://github.com/ros/ros_comm that allows others to analyze and address this.

Alternatively, you can consider multithreading your node to allow background processing of messages even when a service call is received. This is as easy as adding ros::AsyncSpinner spinner(1); spinner.start() to your main function.