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?
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.
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