Robotics StackExchange | Archived questions

Generic Ros Service Clients

I'm currently trying to use the topic_tools/mux node to multiplex multiple topics using the same selector (which is implemented as a ROS service). Now, I've recently discovered that ROS Services cannot be created with the same name, and if they are then the most recent Services gets created and the ones before are destroyed (without notification to the user by the way which is not good in the sense that it may not be intended by the user). So then, another solution would be to create the multiplexer each with a different service name. Then I would create another node that broadcasted to these services. Now, I would like to make this generic (as it would be very useful for later use) such that this node would:

My current problem is that I can't find a way to determine the Service type based on the given qualified service name using the current roscpp API. I may be missing something however, it appears that the only way to create a ROS Service client is to know the Request and Respond types first; there is no generic wrapper around this so that applications - such as mine - can forward client requests to services without regard to the type. This seems to be possible as I would assume that there is some class that the roscpp API is using to bind a service's name with its service type - that and the topic_tools/mux node seems to be able to do this for topics (that is forwarding the messages from one topic to another without regard to the topic message types). And though services are different than topics they both seem to be based on message types.

Asked by theNerd247 on 2015-10-07 13:02:04 UTC

Comments

Answers