Create publisher from string parameter dynamically
Hi, I searched on the internet without any luck.
Is there any way in ROS/C++ to solve the following problem? :
I want to have a launch file in which I want to specify a parameter tags
in the following way:
<param name="tags" type="string" value="1, 15, 189"/>
and then in the .cpp
file associated I would like to create different publishers (or maybe it is easier to create an array of publishers) which will publish on the topics:
/pose/tag_1
/pose/tag_15
/pose/tag_189
(the conversion from string to an array of ints is not an issue. I know how to do it.
Of course, I want that the tags
parameter can be changed from the launch file and therefore the creation of the topics is in some way dynamic.
Thanks for your time.