osrf / ros2_serial_example

70 stars 15 forks source link

Special serial message to get list of topics #58

Closed clalancette closed 5 years ago

clalancette commented 5 years ago

This PR creates a special serial message that can be used at ros2_serial_example start to get the list of topic mappings dynamically. This allows the microcontroller/whatever at the other end of the serial port to be completely self-describing, at the expense of some additional code space to deal with the special message. To implement this special message, topic IDs 0 and 1 are reserved (actually, 0 was already reserved, but now we use it for this purpose as well). Note that the use of this special serial message is optional; if it is not configured, then it is possible to describe the list of topics statically in the configuration file.

Fixes #13