Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

nav2_waypoint_follower build failure due to inability to locate yaml-cpp::yaml-cpp #4773

Open
Mechazo11 opened this issue Nov 29, 2024 · 1 comment

Comments

@Mechazo11
Copy link

Solution proposed in PR #4772

Hi,
I was attempting to build the jazzy version of navigation2 software stack in a source-built ROS 2 Jazzy workspace in Ubuntu 22.04 today. However, I kept getting an linking error specifically inability to find yaml-cpp::yaml-cpp target defined in the robot_localization package. Note, even though the hyperlink goes to my fork of robot_localization, I made no changes to it. Cannot remember why I forked robot_localization in the first place but the solution I proposed in PR #4772 uses my fork of robot_localization.

System Information
OS: Ubuntu 22.04 (also applicable to Ubuntu 24.04)
ROS 2 Version: ROS 2 Jazzy
Version: jazzy branch
DDS Implementation: CycloneDDS

Steps to reproduce issue

Assuming you have access to a base ROS 2 Jazzy workspace (binary or built from source), please build my moveit2 workspace first and git clone and build the main branch of navigation2 stack to reproduce the error (given below)

<source your global ROS 2 workspace here first>
cd ~
git clone https://github.com/Mechazo11/moveit2_nav2_jazzy_ws.git
cd moveit2_nav2_jazzy_ws
vcs import src < moveit2_nav2_jazzy.repos --recursive
rosdep install -r --from-paths src --rosdistro jazzy -i -y
colcon build --packages-up-to moveit_planners_ompl --packages-ignore stomp stomp_moveit moveit_planners_stomp --cmake-args -DCMAKE_BUILD_TYPE=Release
source ./install/setup.bash
git clone https://github.com/ros-navigation/navigation2.git
colcon build --packages-ignore stomp stomp_moveit moveit_planners_stomp --cmake-args -DCMAKE_BUILD_TYPE=Release -DCMAKE_CXX_FLAGS="-w"

Please note without the -w flag, nav2_amcl raises a header depreciation warning which the compiles counts as an error stopping the build. This is another potential error that may need another PR to fix.

Expected behavior

nav2_waypoint_follower builds successfully.

Actual behavior

nav2_waypoint_follower fails with the following error.

--- stderr: nav2_waypoint_follower                                                             
CMake Error at /home/tigerwife/moveit2_nav2_jazzy_ws/install/robot_localization/share/robot_localization/cmake/robot_localizationExport.cmake:61 (set_target_properties):
  The link interface of target "robot_localization::rl_lib" contains:

    yaml-cpp::yaml-cpp

  but the target was not found.  Possible reasons include:

    * There is a typo in the target name.
    * A find_package call is missing for an IMPORTED target.
    * An ALIAS target is missing.

Call Stack (most recent call first):
  /home/tigerwife/moveit2_nav2_jazzy_ws/install/robot_localization/share/robot_localization/cmake/ament_cmake_export_targets-extras.cmake:9 (include)
  /home/tigerwife/moveit2_nav2_jazzy_ws/install/robot_localization/share/robot_localization/cmake/robot_localizationConfig.cmake:41 (include)
  CMakeLists.txt:20 (find_package)
@jncfa
Copy link
Contributor

jncfa commented Nov 29, 2024

Given that yaml-cpp isnt really used in the nav2_waypoint_follower package, it seems more like an issue with robot_localization not exporting its dependencies properly :/

You should instead add the missing package to the ament_export_dependencies call, this should also fix your issue 😄: https://github.com/Mechazo11/robot_localization/blob/ros2/CMakeLists.txt#L352-L371

EDIT: Also, note that the main branch of navigation2 targets rolling, not jazzy, so your mileage may vary if you use this branch

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

No branches or pull requests

2 participants