ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange |
1 | initial version |
You can have the server destroy itself using a flag after finishing servicing the call. And the Master API for the client to know if the service is there. http://wiki.ros.org/ROS/Master_API roscpp and rospy both have methods to expose this capability.
I'd suggest you review your program design. Requiring the server to start up and shutdown is an odd requirement which add a lot of overhead. You could probably find a simpler solution.