carla-simulator / ros-bridge

ROS bridge for CARLA Simulator
MIT License
509 stars 408 forks source link

Fix tf2_eigen compilation issues #709

Open FelipeGdM opened 7 months ago

FelipeGdM commented 7 months ago

When trying to compile the master branch, the following error is raised

--- stderr: pcl_recorder                                
In file included from /home/felipe/Documents/Github/carla_ws/src/ros-bridge/pcl_recorder/src/mainROS2.cpp:7:
/home/felipe/Documents/Github/carla_ws/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/felipe/Documents/Github/carla_ws/src/ros-bridge/pcl_recorder/src/PclRecorderROS2.cpp:13:
/home/felipe/Documents/Github/carla_ws/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.

This can be fixed by adding tf2_eigen as dependency in CMakeLists.txt

This error is likely caused by a change in dependencies relationship whitin pcl_recorder target dependecies. For example, pcl_recorder depends in A and A depends on tf2_eigen, so tf2_eigen is imported as a dependency to pcl_recorder as well. For some unknown reason, A doesn't import tf2_eigen as dependency anymore, so pcl_recorder has a missing depency, as it uses tf2_eigen directly but doesn't lists as a dependency.


This change is Reviewable