0
$\begingroup$

Ubuntu 22.04, ROS2 Humble

I have a blickfield lidar and they provide ROS2 foxy support. I have downloaded the blickfield_ros2_driver from their website and created a repository.

Aim: I want to get it working in ROS2 Humble

I am basically following their Readme. However when I do colcon build --symlink-install --cmake-clean-first, I get the following

[ash@bot] [~/ros2_ws] - colcon build --symlink-install --cmake-clean-first
Starting >>> ouster_sensor_msgs
Starting >>> blickfeld_driver
Starting >>> pmd_royale_ros
Starting >>> pmd_royale_ros_driver
Starting >>> pmd_royale_ros_examples                                                                                                          
Finished <<< pmd_royale_ros [0.37s]                                                                                                    
--- stderr: blickfeld_driver                                                                                                                             
CMake Deprecation Warning at /opt/ros/humble/share/rosidl_cmake/cmake/rosidl_target_interfaces.cmake:32 (message):
  Use rosidl_get_typesupport_target() and target_link_libraries() instead of
  rosidl_target_interfaces()
Call Stack (most recent call first):
  CMakeLists.txt:102 (rosidl_target_interfaces)


WARNING: Target "blickfeld_driver_lib" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "blickfeld_driver_lib" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "blickfeld_driver_component" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "blickfeld_driver_component" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "blickfeld_driver_node" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "blickfeld_driver_node" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "blickfeld_driver_core" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
WARNING: Target "blickfeld_driver_core" requests linking to directory "/usr/include".  Targets may link only to libraries.  CMake is dropping the item.
/home/ash/ros2_ws/src/ros2_blickfeld_driver/modules/ros_blickfeld_driver_core/src/blickfeld_driver_utils.cpp:14:10: fatal error: cv_bridge/cv_bridge.h: No such file or directory
   14 | #include <cv_bridge/cv_bridge.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/build.make:118: modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/src/blickfeld_driver_utils.cpp.o] Error 1
gmake[2]: *** Waiting for unfinished jobs....
In file included from /home/ash/ros2_ws/src/ros2_blickfeld_driver/modules/ros_blickfeld_driver_core/src/blickfeld_driver_point_cloud_parser.cpp:15:
/home/ash/ros2_ws/src/ros2_blickfeld_driver/modules/ros_blickfeld_driver_core/include/blickfeld_driver_core/blickfeld_driver_point_cloud_parser.h:16:10: fatal error: cv_bridge/cv_bridge.h: No such file or directory
   16 | #include <cv_bridge/cv_bridge.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/build.make:104: modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/src/blickfeld_driver_point_cloud_parser.cpp.o] Error 1
In file included from /home/ash/ros2_ws/src/ros2_blickfeld_driver/modules/ros_blickfeld_driver_core/include/blickfeld_driver_core/blickfeld_driver_core.h:24,
                 from /home/ash/ros2_ws/src/ros2_blickfeld_driver/modules/ros_blickfeld_driver_core/src/blickfeld_driver_core.cpp:17:
/home/ash/ros2_ws/src/ros2_blickfeld_driver/include/blickfeld_driver/blickfeld_driver_ros_types.h:14:10: fatal error: tf2_geometry_msgs/tf2_geometry_msgs.h: No such file or directory
   14 | #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/build.make:76: modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/src/blickfeld_driver_core.cpp.o] Error 1
In file included from /home/ash/ros2_ws/src/ros2_blickfeld_driver/modules/ros_blickfeld_driver_core/include/blickfeld_driver_core/blickfeld_driver_imu_parser.h:20,
                 from /home/ash/ros2_ws/src/ros2_blickfeld_driver/modules/ros_blickfeld_driver_core/src/blickfeld_driver_imu_parser.cpp:12:
/home/ash/ros2_ws/src/ros2_blickfeld_driver/include/blickfeld_driver/blickfeld_driver_ros_types.h:14:10: fatal error: tf2_geometry_msgs/tf2_geometry_msgs.h: No such file or directory
   14 | #include <tf2_geometry_msgs/tf2_geometry_msgs.h>
      |          ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
compilation terminated.
gmake[2]: *** [modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/build.make:90: modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/src/blickfeld_driver_imu_parser.cpp.o] Error 1
gmake[1]: *** [CMakeFiles/Makefile2:727: modules/ros_blickfeld_driver_core/CMakeFiles/blickfeld_driver_core.dir/all] Error 2
gmake[1]: *** Waiting for unfinished jobs....
gmake: *** [Makefile:146: all] Error 2
---
Failed   <<< blickfeld_driver [3.54s, exited with code 2]
Aborted  <<< ouster_sensor_msgs [3.57s]
Aborted  <<< pmd_royale_ros_examples [8.83s]                                                                                     
Aborted  <<< pmd_royale_ros_driver [10.2s]                                  

Summary: 1 package finished [10.7s]
  1 package failed: blickfeld_driver
  3 packages aborted: ouster_sensor_msgs pmd_royale_ros_driver pmd_royale_ros_examples
  1 package had stderr output: blickfeld_driver
  1 package not processed

I think the CMakeLists.txt has properly linked to both cv_bridge and tf2_geometry_msgs. I even tried to change the .h to .hpp but did not work.

I have already done sudo apt install ros-humble-cv-bridge/tf2-geometry-msgs. Something I observed is that if I go to /opt/ros/humble/include/, all the similar msgs are under a msg folder where as tf2-geometry-msgs are not. Is my installation okay?

Any help would be really appreciated. TIA

$\endgroup$

1 Answer 1

1
$\begingroup$

hope my reply is not too late :)

I met the same issue as you. After searching on the Internet, I found the solution.

The reason for the issue

The reason for the error is that the CMake cannot find the path of cv_bridge and tf2_geometry_msgs. In the CMakeLists.txt, it doesn't specify the including for dirs of cv_bridge and tf2_geometry_msgs.

Solution

  1. add include_directories in CMakeLists.txt like this: https://github.com/NEWSLabNTU/liteon_ros2_blickfeld_driver_src-v1.5.5/blob/main/CMakeLists.txt#L82-L96
  2. Or, you can use target_inculde_directories and target_link_libraries to specify the dirs and libs of cv2_bridge and tf2_geometry_msgs. A reference can be seen here: https://github.com/Blickfeld/blickfeld_qb2_ros2_driver/blob/main/CMakeLists.txt#L64-L79
$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.