ros-tooling/rosbag2_storage_mcap

Load message definitions from disk

jhurliman opened this issue · 1 comments

We cannot get message definitions at runtime through the ROS2 API until ros2/ros2#1159 is resolved. In the meantime, our next best bet is to query the AMENT_PREFIX_PATH environment variable, parse all of the rosidl_interfaces indexes, build a lookup table from ROS2 datatype to message definition filesystem path, then when generating a new Schema read the message definition from disk and place it into schema.data.

Similar code exists at https://github.com/foxglove/mcap/blob/main/go/ros/ros2db3_to_mcap.go#L41-L169, although this only builds a list of directories up front instead of building the full lookup table that I think we would want for rosbag2_storage_mcap writing.

Done in #13