roscpp clear topics node
Hi,
I'm using image_transport to publish images, and depending on the format, it will publish it to different topics.
So to give a simplified example:
- if format == grayscale, then I want to publish my images on /image/grayscale
- if format == color, then I want to publish my images on /image/color
That works, but if I want to change format on the fly (eg from grayscale to color), I want to "unadvertise" the topic /image/grayscale" so it doesnt show up in the rostopic list anymore.
Is this in any way possible? I tried first deleting my image_transport object and nodehandle object, then creating new objects and advertise the new topic, but the old topic remains in the list of available topics.
Asked by wilson1994 on 2020-04-23 09:24:22 UTC
Answers
I found an answer to my question:
you have to destroy (or call shutdown on) your image_transport::Publisher objects to unadvertise that specific topic.
Asked by wilson1994 on 2020-04-24 01:52:05 UTC
Comments