When to call wait_for_service and how to check if persistent connection is broken

asked 2017-05-22 08:44:05 -0500

hamzamerzic gravatar image

This is more like two questions in one, both related to the tutorial on rospy services.

For the first part, it is not clear to me if wait_for_service should be called every time we want to create or call a service proxy? For example, if service proxy is a class attribute, do we need to wait for service only on initialization before we create the service proxy, or every time we call the service proxy later on?

The other part of the question is regarding persistent connections. In the tutorial it is not mentioned how to handle the connection failure. Do you have an example for this use case?

The motivation for this is that my application heavily uses services, so I would like to squeeze the most performance out of it.

edit retag flag offensive close merge delete