Subscribe to topic without specifying message type in C++

asked 2016-07-31 14:29:10 -0500

Marcin Bogdanski gravatar image

updated 2016-07-31 14:29:55 -0500

Hi All

We are writing piece of diagnostics software for ROS. Mainly a tool to display topic data streams etc. It is required to be done in such a way, that our tool can subscribe to any topic at runtime, including user defined messages. Something like GUI for rostopic info, kind of similar to rqt_plot.

Currently we are subscribing to topic using topic_tools::ShapeShifter, which works. ShapeShifter provides raw byte data buffer and message type definition as string (in rather clumsy format). So technically we got everything we need, but it really doesn't feel like the right way to do it.

Is there a "less wrong" way to subscribe to topic dynamically in C++?

Thanks Marcin

edit retag flag offensive close merge delete