How to create a global listener for any ROS topic and extract all data from any message?
Hey everybody,
I am trying to build a ROS node that receives all the messages published by all the other nodes present in my software architecture. This new node should be able to receive any message (with different contents), extract all the data and log it (so it's important for me to be able to know all the contained data types and their values). Is there any good way to:
- Convert any .msg to some "common" format, like XML (so I can treat all the messages as just one string and then do my parsing)?
- If not, how do I to easily parse each contained data inside any message ( type and value )?. I want to treat all the messages as if they were generic; I don't want to manually extract all the data one variable at a time, this would force me to make one hardcoded callback for each topic.
- Also, is there any better way to receive all the messages from any node with any topic without having to create a new subscriber and a callback for each new topic in my "listener" node?
Thanks!