ROS noetic缺少依赖包 geographic_msgs的解决方案
【编译错误解决方案】编译Kuavo机器人仿真环境时出现robot_localization编译失败,提示缺少geographic_msgs依赖包。解决方法:1)首先尝试安装依赖包:sudo apt update && sudo apt install ros-noetic-geographic-msgs;若出现404错误,需修改软件源配置:2)注释/etc/apt/sources.
问题描述:
编译Kuavo乐聚机器人的仿真环境的时候出现如下error

原因解释:
robot_localization 编译失败的原因是 缺少依赖包 geographic_msgs
-- Could NOT find geographic_msgs (missing: geographic_msgs_DIR) -- Could not find the required component 'geographic_msgs'. The following CMake error indicates that you either need to install the package with the same name or change your environment so that it can be found. CMake Error at /opt/ros/noetic/share/catkin/cmake/catkinConfig.cmake:83 (find_package): Could not find a package configuration file provided by "geographic_msgs" with any of the following names:
解决方案:
安装ros-noetic-geographic-msgs模块
sudo apt update
sudo apt install ros-noetic-geographic-msgs
如果出现如下error:
Err:2 http://mirrors.ustc.edu.cn/ros/ubuntu focal/main amd64 ros-noetic-geographic-msgs amd64 0.5.6-1focal.20250410.234117
404 Not Found [IP: 2001:da8:d800:95::110 80]
E: Failed to fetch http://mirrors.ustc.edu.cn/ros/ubuntu/pool/main/r/ros-noetic-uuid-msgs/ros-noetic-uuid-msgs_1.0.6-1focal.20250410.234006_amd64.deb 404 Not Found [IP: 2001:da8:d800:95::110 80]
E: Failed to fetch http://mirrors.ustc.edu.cn/ros/ubuntu/pool/main/r/ros-noetic-geographic-msgs/ros-noetic-geographic-msgs_0.5.6-1focal.20250410.234117_amd64.deb 404 Not Found [IP: 2001:da8:d800:95::110 80]
E: Unable to fetch some archives, maybe run apt-get update or try with --fix-missing?
则按照以下步骤执行:
1.删除或注释掉除官方源以外的所有镜像站
sudo nano /etc/apt/sources.list.d/ros-noetic.list
-
注释掉:
# deb http://mirrors.ustc.edu.cn/ros/ubuntu focal main
# deb http://snapshots.ros.org/noetic/2024-10-31/ubuntu focal main
-
保留官方源:
deb http://packages.ros.org/ros/ubuntu focal main
2.更新并重新添加官方 GPG key
sudo apt-key del F42ED6FBAB17C654
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key F42ED6FBAB17C654
3.更新 apt 索引
sudo apt update
4.安装依赖包
sudo apt install ros-noetic-geographic-msgs
火山引擎开发者社区是火山引擎打造的AI技术生态平台,聚焦Agent与大模型开发,提供豆包系列模型(图像/视频/视觉)、智能分析与会话工具,并配套评测集、动手实验室及行业案例库。社区通过技术沙龙、挑战赛等活动促进开发者成长,新用户可领50万Tokens权益,助力构建智能应用。
更多推荐

所有评论(0)