Skip to content

Conversation

@mallanmba
Copy link
Contributor

This change switches swri_transform_util to use yaml_cpp_vendor so that it will use the same version of yaml-cpp as is used by the core ros packages (e.g. camera_calibration_parsers, rviz, etc.) This is important for folks who are building from source on platforms that may have a different system version than the version ros wants.
We are on Ubuntu 22.04 which comes with yaml-cpp 0.7 and using ros2 jazzy which wants 0.8. Mixing versions can cause problems downstream.

@danthony06 danthony06 merged commit 056e76f into swri-robotics:ros2-devel Jul 17, 2025
11 of 12 checks passed
find_package(tf2_geometry_msgs REQUIRED)
find_package(tf2_ros REQUIRED)
find_package(yaml_cpp_vendor REQUIRED)
find_package(yaml-cpp REQUIRED)
Copy link
Contributor Author

@mallanmba mallanmba Jul 17, 2025

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

opencv_imgproc
opencv_video
${PROJ_LIBRARIES}
yaml-cpp::yaml-cpp
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yaml-cpp::yaml-cpp is the correct target, the modern CMake target sets up include directories and link libraries, see conversation here: ros2/yaml_cpp_vendor#51 (comment)

Copy link
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

It looks like that's only for Jazzy and later, and we'll have to add a switch for Humble.

Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Ok, I'll put up another PR later today with a switch for the target

tf2
tf2_geometry_msgs
tf2_ros
yaml-cpp)
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

yaml-cpp is the correct target to export, my understanding is yaml_cpp_vendor sets up the right hints to get the yaml-cpp find_package to find the vendored package, but the actual target is yaml-cpp.
In packages.xml, depending on yaml_cpp_vendor tells rosdep to look for the vendored package, if yaml-cpp is used rosdep will want to use the system package - but that causes problems on platforms that have a different yaml-cpp system version than the _vendor package.
Without the export of yaml-cpp, swri_route_util will not be able to find and link against yaml-cpp.
See the exports of rosbag2, they export both yaml-cpp and yaml_cpp_vendor - I don't think it's required to export yaml_cpp_vendor, but it doesn't hurt. Exporting yaml-cpp is required for downstream packages to link properly.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants