ros2_rust icon indicating copy to clipboard operation
ros2_rust copied to clipboard

Basic functionality for loading introspection type support libraries

Open nnmm opened this issue 3 years ago • 3 comments

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 MessageTypeName type)
  • 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 the ament_rs crate)
  • Load that library using libloading (see get_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 avatar Oct 08 '22 12:10 nnmm

@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 avatar Oct 11 '22 08:10 esteve

@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.

nnmm avatar Oct 11 '22 12:10 nnmm

Thank you very much @jhdcs!

@esteve, do you have any further comments? Otherwise I'll go ahead and merge this.

nnmm avatar Oct 17 '22 16:10 nnmm

@jhdcs Could you reapprove? I had to rebase onto main.

nnmm avatar Oct 26 '22 18:10 nnmm

Thank you!

nnmm avatar Oct 26 '22 18:10 nnmm