ros2pcl

How to solve the ERROR Cannot locate rosdep definition for [PCL]?


Im trying to use the github package for 2D LiDAR-based odometry in ROS2 humble. This is the package github

Simple-2D-LiDAR-Odometry

I installed the dependencies required with

sudo apt-get install libeigen3-dev libpcl-dev

Then when try to run rosdep install -i --from-path src --rosdistro humble -y I got the following error:

ERROR: the following packages/stacks could not have their rosdep keys resolved to system dependencies: lidar_odometry: Cannot locate rosdep definition for [PCL]

I tried to search everything but still no help. The package .xml file is

<?xml version="1.0"?>
<?xml-model href="http://download.ros.org/schema/package_format3.xsd" schematypens="http://www.w3.org/2001/XMLSchema"?>
<package format="3">
  <name>lidar_odometry</name>
  <version>1.0.0</version>
  <description>2D LiDAR Odometry package. using GICP</description>
  <maintainer email="msd030428@gmail.com">KDW</maintainer>
  <license>Apache 2.0</license>

  <buildtool_depend>ament_cmake</buildtool_depend>

  <test_depend>ament_lint_auto</test_depend>
  <test_depend>ament_lint_common</test_depend>
  
  <depend>rclcpp</depend>
  <depend>nav_msgs</depend>
  <depend>sensor_msgs</depend>
  <depend>geometry_msgs</depend>
  <depend>Eigen3</depend>
  <depend>PCL</depend>
  <depend>laser_geometry</depend>
  <depend>pcl_conversions</depend>
  <depend>tf2</depend>
  <depend>tf2_eigen</depend>

  <export>
    <build_type>ament_cmake</build_type>
  </export>
</package>

Any help?


Solution

  • I learned that pcl is not a official ros package, so you can't install it with rosdep. Instead, you should install it with apt-get using sudo apt-get install libpcl-dev. After that, add --skip-keys pcl to your rosdep command to rosdep install -i --from-path src --rosdistro humble -y --skip-keys pcl. Hope it can help with your problem.