ros2_rust
ros2_rust copied to clipboard
Basic functionality for loading introspection type support libraries
Given a topic type in the form of a string like "geometry_msgs/msg/Pose", this will
- Parse the string into the package name "geometry_msgs" and the message name "Pose" (see the
MessageTypeNametype) - Search the ament index for the prefix of the "geometry_msgs" package. In the prefix, the introspection type support library will be in
lib/libgeometry_msgs__rosidl_typesupport_introspection_c.so(via theament_rscrate) - Load that library using
libloading(seeget_type_support_library()) - Extract the symbol corresponding to the "Pose" type from that library (see
get_type_support_handle())
This commit intentionally leaves out an important part of the DynamicMessageMetadata type: The representation of the message structure. This will follow in another commit.
@nnmm have you looked into https://github.com/PlotJuggler/plotjuggler-ros-plugins/tree/development/plugins/ros2_introspection? This may solve a similar problem and/or serve as inspiration.
@esteve Thanks for the link, I didn't know that one yet. I think my branch already covers the functionality from that package and more.
Thank you very much @jhdcs!
@esteve, do you have any further comments? Otherwise I'll go ahead and merge this.
@jhdcs Could you reapprove? I had to rebase onto main.
Thank you!