Ask Your Question

[ROS 2] How is the name of the typesupport library generated?

asked 2019-12-18 14:45:16 -0600

alsora gravatar image

updated 2019-12-18 14:45:43 -0600


I have a package where I create custom messages.

In my application I create a subscription that uses this custom type. If I look into the RMW implementation code (FastRTPS for example) I think I found where the typesupport library is loaded

  const rosidl_message_type_support_t * type_support = get_message_typesupport_handle(
    type_supports, rosidl_typesupport_introspection_c__identifier);
  if (!type_support) {
    type_support = get_message_typesupport_handle(
      type_supports, rosidl_typesupport_introspection_cpp::typesupport_identifier);
    if (!type_support) {
      RMW_SET_ERROR_MSG("type support not from this implementation");
      return nullptr;

As you can see, this uses a type_supports handle and an identifier. These are used to genereate the name of a shared library (for example my_custom_msg_rosidl_typesupport_fastrtps_cpp)

I would like to know where is the code that generates that name

thank you

edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted

answered 2020-01-14 17:18:08 -0600

Dirk Thomas gravatar image

The rosidl_typesupport_cppperforms the dispatch (in case there is more than one typesupport library available for C++). It happens in this file:

edit flag offensive delete link more

Your Answer

Please start posting anonymously - your entry will be published after you log in or create a new account.

Add Answer

Question Tools



Asked: 2019-12-18 14:45:16 -0600

Seen: 32 times

Last updated: Jan 14