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

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

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

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.

GuillaumeB gravatar image GuillaumeB  ( 2018-07-20 05:58:54 -0500 )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 image GuillaumeB  ( 2018-07-20 05:59:44 -0500 )edit