0

In c++ and ros2, is it possible to subscribe to a topic without knowing its type? If so, and a message is received, is it possible to introspect the message at all, again without knowing its type? Meaning, are ros2 messages self-describing (such as FlexBuffer messages)?

Colin
  • 3,670
  • 1
  • 25
  • 36

1 Answers1

1

No, ros2 messages are not self-describing, since they are binarized in order to improve throughput. Hence, you need not only the .msg/.idl description file, but also need to compile that into a message description, before the messages can be interpreted.

The concept of ros2 interfaces is described here: https://docs.ros.org/en/foxy/Concepts/About-ROS-Interfaces.html

simmue
  • 170
  • 1
  • 8