Ask Your Question

Revision history [back]

click to hide/show revision 1
initial version

Based on the client code attached in the ticket, I added the line:

if(!client.waitForExistence(ros::Duration(5.0))) continue;

before the service call (line 21). This allows the client to carry on and make service calls once the server comes up again.

click to hide/show revision 2
retried solution, doesn't always work, sorry!

Based on the client code attached in the ticket, I added the line:

if(!client.waitForExistence(ros::Duration(5.0))) continue;

before the service call (line 21). This allows the client to carry on and make service calls once the server comes up again.

Retried the code again after Lorenz's comment. It seems this worked only when the server was killed at specific points in time (just before the service call I presume). Though I still don't understand why it worked previously when the "Failed to call service" line wasn't printed.