ros2 publisher with variable for PublisherType

asked 2020-10-16 10:47:06 -0500

maze gravatar image


I'm creating a class where i can pass my topic names and would like to have a variable to create something like :

listpub_[i] = this->create_publisher<PUBLISHER_TYPE[i]>(topic_name[i], 10);

I'have fix issue for the topic name but i can't figure out how to pass PUBLISHER_TYPE like an arg ...

Did someone as already try that ?

edit retag flag offensive close merge delete