I am trying to write a subscriber class which subscribe to a topic and read messages published for that topic. As I know I need to pass a callback function with message structure to read received messages. But this approach is not generic. Is there any way so that I can read any ros message in form of string and send it to client classes which can parse them accordingly
Asked
Active
Viewed 1,679 times
1 Answers
1
You can use python like akshayk07 suggests, or you can use the C++ alternative: ros_type_introspection. The author wrote exactly what you ask for in generic_subscriber.cpp
.

aPonza
- 492
- 4
- 10