Robotics StackExchange | Archived questions

Expected include directory with Humble

Hi,

When porting some packages from Foxy/Galactic to Humble I have noticed one additional level in the expected include directory, for example the one that is generated from messages:

Foxy / Galactic: <ros2_ws>/install/<pkg>/include/<pkg>/msg/headers.hpp
Humble:          <ros2_ws>/install/<pkg>/include/<pkg>/<pkg>/msg/headers.hpp

The amenttargetdependencies CMake line includes the right directory, depending on the ROS 2 distro.

However, when installing header files manually (to export some library), this is not automagic. Is is necessary to consider the ROS 2 distro to install the include directory or is there a better way? For now I can only do like:

if(Foxy or Galactic)  install(DIRECTORY include/ DESTINATION include)
else                  install(DIRECTORY include/ DESTINATION include/${PROJECT_NAME})

Asked by Olivier Kermorgant on 2022-08-17 07:59:17 UTC

Comments

IMO the change mentioned should be included in the migration note. Ticketed https://github.com/ros2/ros2_documentation/issues/3702

Asked by 130s on 2023-06-04 17:06:46 UTC

Answers

This was adjusted to make sure that overlays work properly. Without this change you can get headers from the wrong level of overlays.

You can find more info in this issue: https://github.com/ros2/ros2/issues/1150

Asked by tfoote on 2022-08-17 19:47:31 UTC

Comments

Thanks, so to summarize if one wants to have a Foxy->Humble compatible package we have to install the include directory with a if/then condition depending on the current ROS distro as in my original post?

Asked by Olivier Kermorgant on 2022-08-18 04:33:43 UTC