ros2 / ros2/geometry2

Compile error while building `tf2_kdl` with `BUILD_TESTING` on - windows 10

Open
#561 5 comments 0 reactions 0 assignees View on GitHub

Nobody has claimed this yet.

more-information-needed
Dominant language
C++
Stars
153
Forks
256
Avg merge
3d 23h
Merged PRs (30d)
14

Description

Bug report

Required Info:

  • Operating System:
    • Windows 10
  • Installation type:
    • source, with BUILD_TESTING
  • Version or commit hash:
    • ae2120833d1777eaa91a3fa4943d56b675db3e52 (humble branch)
  • DDS implementation:
    • fastrtps
  • Client library (if applicable):
    • N/A
Steps to reproduce issue

Build geometry2 package with BUILD_TESTING on.

colcon build --cmake-args -DBUILD_TESTING:int=1
Expected behavior

Build succeeded

Actual behavior

Compile error for tf2_kdl package:

D:\ros2-humble\include\orocos_kdl\kdl\jacobian.hpp(26,10): fatal error C1083: cannot open include file 'Eigen/Core' no such file or directory
Additional information

Looks like Eigen is not added to include dirs. Adding it fixes the issue:

if(BUILD_TESTING)
  find_package(ament_cmake_gtest REQUIRED)
  find_package(rclcpp REQUIRED)
  find_package(tf2_msgs REQUIRED)
  find_package(Eigen3 REQUIRED)

  ament_add_gtest(test_kdl test/test_tf2_kdl.cpp)
  target_include_directories(
    test_kdl PRIVATE
    "${Eigen3_INCLUDE_DIRS}"
  )
  target_link_libraries(test_kdl
    tf2_kdl
    rclcpp::rclcpp
    # Used, but not linked to test tf2_kdl's exports:
    #   tf2::tf2
    #   tf2_ros::tf2_ros
  )
endif()

Contributor guide

No contributing guide indexed for this repository

First steps

  1. Read the whole issue, then the project's contributing guide.
  2. Comment on the issue to say you are picking it up — it saves two people doing the same work.
  3. Fork the repository and make your change on a branch.
  4. Open a pull request that references the issue number.

Research direction

Reproduce the failure with colcon build --cmake-args -DBUILD_TESTING:int=1 and inspect the tf2_kdl test target using test/test_tf2_kdl.cpp. Check how the target receives Eigen's include path, then verify that the package builds successfully with testing enabled on Windows.

Written by the indexing model from the issue text.

Assessment

Tech stack
cmake, cpp
Domain
build-system, testing
Issue type
Bug
Difficulty
3/5
Estimated time
1-2 days
Activity status
Stale
Clarity
Mostly clear
Newbie friendliness
35/100

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.