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

asked 2016-06-18 17:10:39 -0600

rbaehr gravatar image

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?

edit retag flag offensive close merge delete


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.

GuillaumeB gravatar imageGuillaumeB ( 2018-07-20 05:58:54 -0600 )edit

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

GuillaumeB gravatar imageGuillaumeB ( 2018-07-20 05:59:44 -0600 )edit