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

colcon error casued by the lack of dependence tf2_eigen #737

Open
GoesM opened this issue Jul 12, 2024 · 4 comments
Open

colcon error casued by the lack of dependence tf2_eigen #737

GoesM opened this issue Jul 12, 2024 · 4 comments

Comments

@GoesM
Copy link

GoesM commented Jul 12, 2024

description

when I colcon build ros-bridge within ROS2-humble, I faced to the following errors:

--- stderr: pcl_recorder                               
** WARNING ** io features related to pcap will be disabled
** WARNING ** io features related to png will be disabled
In file included from /home/***/ros-bridge/pcl_recorder/src/mainROS2.cpp:7:
/home***/ros-bridge/pcl_recorder/include/PclRecorderROS2.h:13:10: fatal error: 'tf2_eigen/tf2_eigen.h' file not found
#include <tf2_eigen/tf2_eigen.h>
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
gmake[2]: *** [CMakeFiles/pcl_recorder_node.dir/build.make:90: CMakeFiles/pcl_recorder_node.dir/src/mainROS2.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/***/ros-bridge/pcl_recorder/src/PclRecorderROS2.cpp:13:
/home/***/ros-bridge/pcl_recorder/include/PclRecorderROS2.h:13:10: fatal error: 'tf2_eigen/tf2_eigen.h' file not found
#include <tf2_eigen/tf2_eigen.h>
         ^~~~~~~~~~~~~~~~~~~~~~~
1 error generated.
gmake[2]: *** [CMakeFiles/pcl_recorder_node.dir/build.make:76: CMakeFiles/pcl_recorder_node.dir/src/PclRecorderROS2.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/pcl_recorder_node.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

analysis

I found the following cmakelist settings should be wrong:

ament_target_dependencies(${PROJECT_NAME}_node rclcpp sensor_msgs
pcl_conversions tf2 tf2_ros)

there seems the lack of dependence tf2_eigen .

suggestion

I changed it as followings, and everything is ok now.

  ament_target_dependencies(${PROJECT_NAME}_node rclcpp sensor_msgs
                            pcl_conversions tf2 tf2_ros tf2_eigen)

Shall I submit a PR to fix it ?

@richie-live
Copy link

why do I still have the problem. I am using ros jazzy, ubantu 24.04

--- stderr: pcl_recorder
In file included from /home/fyq/carla-ros-bridge/src/ros-bridge/pcl_recorder/src/mainROS2.cpp:7:
/home/fyq/carla-ros-bridge/src/ros-bridge/pcl_recorder/include/PclRecorderROS2.h:13:10: fatal error: tf2_eigen/tf2_eigen.h: No such file or directory
13 | #include <tf2_eigen/tf2_eigen.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/pcl_recorder_node.dir/build.make:90: CMakeFiles/pcl_recorder_node.dir/src/mainROS2.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/fyq/carla-ros-bridge/src/ros-bridge/pcl_recorder/src/PclRecorderROS2.cpp:13:
/home/fyq/carla-ros-bridge/src/ros-bridge/pcl_recorder/include/PclRecorderROS2.h:13:10: fatal error: tf2_eigen/tf2_eigen.h: No such file or directory
13 | #include <tf2_eigen/tf2_eigen.h>
| ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [CMakeFiles/pcl_recorder_node.dir/build.make:76: CMakeFiles/pcl_recorder_node.dir/src/PclRecorderROS2.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:137: CMakeFiles/pcl_recorder_node.dir/all] Error 2
gmake: *** [Makefile:146: all] Error 2

Failed <<< pcl_recorder [1.24s, exited with code 2]

Summary: 18 packages finished [4.95s]
1 package failed: pcl_recorder
1 package had stderr output: pcl_recorder

@GoesM
Copy link
Author

GoesM commented Oct 9, 2024

@richie-live I'm not very sure. I think Jazzy is the latest version so it may face to many confused issues ?

I am using ROS-humble, Ubuntu 22.04.

@taeseongkr
Copy link

@richie-live I solved the problem by the following:

  1. rm -rf install log build
  2. sudo apt install ros-humble-tf2-eigen ros-humble-tf2-ros ros-humble-tf2-geometry-msgs
  3. nano ~/carla-ros-bridge/src/ros-bridge/pcl_recorder/CMakeLists.txt
    Add the following lines near the top of the file, after the find_package calls:
find_package(tf2_eigen REQUIRED)
include_directories(${tf2_eigen_INCLUDE_DIRS})
  1. colcon build --symlink-install
    please use correct python, ros, carla version
    Mine is python 3.10, ROS humble (Ubuntu 22.04), Carla 0.9.15
    Hope it helps

@richie-live
Copy link

@richie-live I solved the problem by the following:

  1. rm -rf install log build
  2. sudo apt install ros-humble-tf2-eigen ros-humble-tf2-ros ros-humble-tf2-geometry-msgs
  3. nano ~/carla-ros-bridge/src/ros-bridge/pcl_recorder/CMakeLists.txt
    Add the following lines near the top of the file, after the find_package calls:
find_package(tf2_eigen REQUIRED)
include_directories(${tf2_eigen_INCLUDE_DIRS})
  1. colcon build --symlink-install
    please use correct python, ros, carla version
    Mine is python 3.10, ROS humble (Ubuntu 22.04), Carla 0.9.15
    Hope it helps

@taeseongkr Thanks! It worked, however I have the following warning:

CMake Warning (dev) at CMakeLists.txt:64 (find_package):
  Policy CMP0074 is not set: find_package uses <PackageName>_ROOT variables.
  Run "cmake --help-policy CMP0074" for policy details.  Use the cmake_policy
  command to set the policy and suppress this warning.

  CMake variable PCL_ROOT is set to:

    /usr

  For compatibility, CMake is ignoring the variable.
This warning is for project developers.  Use -Wno-dev to suppress it.

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

3 participants