ROS Resources: Documentation | Support | Discussion Forum | Index | Service Status | ros @ Robotics Stack Exchange
Ask Your Question
0

CMake Generate step failed. Build files cannot be regenerated correctly.

asked 2022-09-02 09:09:05 -0500

lol gravatar image

updated 2022-09-04 07:09:01 -0500

ravijoshi gravatar image

I am trying to install the ros-perception/pointcloud_to_laserscan 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
edit retag flag offensive close merge delete

1 Answer

Sort by ยป oldest newest most voted
0

answered 2022-09-04 07:16:16 -0500

ravijoshi gravatar image
  1. Please ensure you have installed the ROS Galactic completely. I simply go with sudo apt install ros-galactic-desktop
  2. 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]
edit flag offensive delete link more

Question Tools

1 follower

Stats

Asked: 2022-09-02 09:09:05 -0500

Seen: 924 times

Last updated: Sep 04 '22