ros2 / rosidl_typesupport

Packages which provide the typesupport for ROS messages and services
Apache License 2.0
13 stars 34 forks source link

Static type support for rosidl_typesupport_c #110

Open pablogs9 opened 3 years ago

pablogs9 commented 3 years ago

Hello @sloretz and @clalancette,

here at micro-ROS, we are wondering if it is possible to implement the changes proposed here to allow rosidl_typesupport_c to have some kind of statically linked typesupport dispatch for those environments where dynamic library are not allowed (embedded).

Can we discuss this feature here? What are your opinions?

CC: @ralph-lange @JanStaschulat

pablogs9 commented 3 years ago

Hello @clalancette, thanks a lot for your comments. I'm answering here:

  1. I have created dynamic_support_dispatch.hpp with the logic associated to the dynamic library handling
  2. I have found that by default, at least in the tests, BUILD_SHARED_LIBS is not set, so this line is reached and probably the rosidl_typesupport_c library is being built as a static one. At some point, the build type (static or dynamic) of the rosidl_typesupport_c does not determine if the actual typesupport is being handled statically or dynamically. If fact a static library can use rcutils functions to search and use the dynamic library of the typesupport for a message. So, although I have modified it to use this flags, I wonder if we should keed the original option(ROSIDL_TYPESUPPORT_STATIC_TYPESUPPORT "Enable static typesupport" OFF)
  3. Sorry I don't understand which are the "empy files". Could you explain this comment?