You need to enable JavaScript to run this app.
优惠活动
大模型
产品
解决方案
定价
更多

ROS2 Humble执行rosdep install报错:无法定位PCL的rosdep定义

问题:ROS2 Humble中rosdep无法解析PCL依赖

场景说明

在ROS2 Humble环境中使用Simple-2D-LiDAR-Odometry包时,已通过sudo apt-get install libeigen3-dev libpcl-dev手动安装依赖,但执行rosdep install -i --from-path src --rosdistro humble -y时出现解析错误。

错误内容

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

对应package.xml内容

<?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>

解决方法

  • 修正依赖名称:ROS2的rosdep对PCL的识别键为小写pcl,而非大写PCL。将package.xml中的<depend>PCL</depend>替换为<depend>pcl</depend>
  • 更新rosdep数据库:若修改后仍报错,执行sudo rosdep init && rosdep update刷新依赖定义
  • 跳过rosdep编译:如果已手动安装所有依赖,可直接执行colcon build --packages-select lidar_odometry编译目标包,无需通过rosdep检查

内容的提问来源于stack exchange,提问作者Macedon971

相关产品推荐
方舟 Agent Plan

超全模态模型 × Harness 升级,最新支持 Deepseek-V4.1-Flash、GLM-5.3 系列、Doubao-Seedream-5.0-pro、Kimi-K3 (部分), 限时 9.9 元起

最近更新时间:2026.07.01 07:53:38