CMake Generate step failed. Build files cannot be regenerated correctly.
I am trying to install the ros-perception/pointcloudtolaserscan package but I am getting the following error during compilation:
--- 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 [1.25s, exited with code 2]
Summary: 4 packages finished [1.46s]
1 package failed: pointcloud_to_laserscan
1 package had stderr output: pointcloud_to_laserscan
Asked by lol on 2022-09-02 09:09:05 UTC
Answers
- Please ensure you have installed the ROS Galactic completely. I simply go with
sudo apt install ros-galactic-desktop
- Make sure you are using the galactic branch of the repository.
I am able to compile it peacefully. Please see the steps below:
ravi@dell:~/ros2_ws$ cd src/
ravi@dell:~/ros2_ws/src$ source /opt/ros/galactic/setup.bash
ravi@dell:~/ros2_ws/src$ git clone --branch galactic https://github.com/ros-perception/pointcloud_to_laserscan.git
Cloning into 'pointcloud_to_laserscan'...
remote: Enumerating objects: 189, done.
remote: Counting objects: 100% (64/64), done.
remote: Compressing objects: 100% (34/34), done.
remote: Total 189 (delta 38), reused 36 (delta 30), pack-reused 125
Receiving objects: 100% (189/189), 49.20 KiB | 1.02 MiB/s, done.
Resolving deltas: 100% (102/102), done.
ravi@dell:~/ros2_ws/src$ cd ..
ravi@dell:~/ros2_ws$ colcon build
Starting >>> pointcloud_to_laserscan
Finished <<< pointcloud_to_laserscan [10.1s]
Summary: 1 package finished [10.4s]
Asked by ravijoshi on 2022-09-04 07:16:16 UTC
Comments