Robotics StackExchange | Archived questions

Can I overload the ServiceServer callback to have multiple types of responses for the same request?

I want to have a ServiceServer that given a request's value, can have multiple types of responses which are not necessarily the same types of data msgs.

Can I overload the advertiseService() specified callback to achieve this? Or is there some other way to do this?

Asked by rbaehr on 2016-06-18 17:10:39 UTC

Comments

I am not sure you can create a service that dynamically changes the data types. But you can create one that defines the data types at execution: link.

Asked by GuillaumeB on 2018-07-20 05:58:54 UTC

In your case, I would say to publish a topic in addition to your service. So for the same service, you can use the kind of publisher you want

Asked by GuillaumeB on 2018-07-20 05:59:44 UTC

Answers