ros-perception / pointcloud_to_laserscan

Converts a 3D Point Cloud into a 2D laser scan.
http://wiki.ros.org/pointcloud_to_laserscan
BSD 3-Clause "New" or "Revised" License
405 stars 276 forks source link

CMake Error at CMakeLists.txt when colcon build with Galactic #81

Closed patrickpoirier51 closed 1 day ago

patrickpoirier51 commented 1 year ago

Hello I get this error when building package

colcon build --packages-select pointcloud_to_laserscan

Starting >>> pointcloud_to_laserscan --- stderr: pointcloud_to_laserscan
CMake Error at CMakeLists.txt:15 (add_library): Target "laserscan_to_pointcloud" links to target "rclcpp_components::component" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:15 (add_library): Target "laserscan_to_pointcloud" links to target "tf2_sensor_msgs::tf2_sensor_msgs" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:36 (add_library): Target "pointcloud_to_laserscan" links to target "rclcpp_components::component" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Error at CMakeLists.txt:36 (add_library): Target "pointcloud_to_laserscan" links to target "tf2_sensor_msgs::tf2_sensor_msgs" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing?

CMake Generate step failed. Build files cannot be regenerated correctly. make: *** [Makefile:442: cmake_check_build_system] Error 1

Failed <<< pointcloud_to_laserscan [0.96s, exited with code 2]

I am running with: DISTRIB_RELEASE=20.04 DISTRIB_CODENAME=focal DISTRIB_DESCRIPTION="Ubuntu 20.04.5 LTS"

cmake version 3.16.3 g++ (Ubuntu 9.4.0-1ubuntu1~20.04.1) 9.4.0

vico1999-ros commented 10 months ago

I find the the same error tf2_sensor_msgs::tf2_sensor_msgs" but the target was not found. Perhaps a find_package() call is missing for an IMPORTED target, or an ALIAS target is missing? but the another package didnot induce libary error

AnnaPlt commented 7 months ago

@patrickpoirier51 Hello! I am encountering the same errors on the same packages. Did you find a solution?

patrickpoirier51 commented 7 months ago

did you tried the package ros-galactic-depthimage-to-laserscan

NemB0t commented 6 months ago

I am also facing the same issue any ideas on how to fix it or has anyone found any work arounds?

Lem-bow commented 5 months ago

@NemB0t Did you checkout the correct branch after cloning? That did the job for me.

Merlinecodes commented 4 months ago

Please try this: git clone [url] --branch=[branch name]

I stopped getting the CMake error once I cloned the correct branch (foxy in my case)

NemB0t commented 1 month ago

It worked after @Merlinecodes suggestions. Thanks!