官网
http://wiki.ros.org/noetic/Installation/Ubuntu
网友
https://blog.csdn.net/zghforever/article/details/107489482
安装
软件仓库配置
- 打开
Software & Update
- 确保勾选
restricted
,universe
和multiverse
.
- 关闭后,会提示重新加载。
设置软件源
打开terminal终端,输入下方代码
1 | sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list' |
设置密钥
1 | sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654 |
如果使用代理服务器,可以使用curl
替代apt-key
命令,具体内容如下:
1 | curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add - |
成功后返回
1 2 3 | gpg: key F42ED6FBABXXXXXX: public key "Open Robotics <info@osrfoundation.org>" imported gpg: Total number processed: 1 gpg: imported: 1 |
ROS安装
安装前,确保Debian包索引到最新
1 | sudo apt- get update |
下面就是选择安装多大的ROS包
- 桌面完整版(官方推荐):包含2D/3D仿真和感知包
1 | sudo apt install ros-noetic-desktop-full |
如果需要安装其他包文件,可以选择相应的包直接安装
1 | sudo apt install ros-noetic-PACKAGE |
如果出现因为版本库依赖问题无法安装
- step2. 在终端输入如下指令,安装桌面完整版Ros。使用aptitude进行安装,比apt的好处在于,可以帮助解决一些软件的依赖问题,如果无法解决,也会给出很好的建议,由我们进行选择和处理。
1 2 | 安装方法:sudo apt- get install aptitude。 sudo aptitude install ros-noetic-desktop-full |
第一次的建议选择n 不同意默认方案,然后给出解决方案 降级libgpgme11 自己的电脑也可能是其他情况,多测试几个
第二次 选择y 统一换的安装方案
说要装1g左右 那肯定靠谱
装完后验证
环境配置
首先 ctrl+h 顯示隱藏文件 去除aconda的默認環境
修改權限
1 | sudo chmod -R 777 .bashrc |
注销aconda避免干扰后续安装(如果已经装了的前提下)
如果需要使用ROS,在每个bash终端中需更新ros的配置脚本,具体命令如下:
1 | source /opt/ros/noetic/setup.bash |
也可以设置每次打开终端时,自动更新ROS的配置脚本
1 2 | echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc |
构建包的依赖关系
1 | sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential |
编译包依赖
- 安装rosdep
如果未安装rosdep工具,输入下述命令:
如果系统(ubuntu2020)默认只包含python3
,相应命令修改如下:
1 | sudo apt install python3-rosdep |
- 依赖初始化
1 | $ sudo rosdep init |
返回下述结果说明初始化成功
1 2 3 4 | Wrote /etc/ros/rosdep/sources.list.d/20- default .list Recommended: please run rosdep update |
其实自动下载了这个文件
1 2 3 4 5 6 7 8 9 10 | # os-specific listings first yaml https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml osx # generic yaml https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml yaml https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml yaml https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml gbpdistro https: //raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml fuerte # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead |
- 更新依赖
1 | $ rosdep update |
返回下述结果说明更新成功
1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 | eading in sources list data from /etc/ros/rosdep/sources.list.d Hit https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml Hit https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml Hit https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml Hit https: //raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml Hit https: //raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml Query rosdistro index https: //raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml Skip end-of-life distro "ardent" Skip end-of-life distro "bouncy" Skip end-of-life distro "crystal" Add distro "dashing" Add distro "eloquent" Add distro "foxy" Skip end-of-life distro "groovy" Skip end-of-life distro "hydro" Skip end-of-life distro "indigo" Skip end-of-life distro "jade" Add distro "kinetic" Skip end-of-life distro "lunar" Add distro "melodic" Add distro "noetic" Add distro "rolling" updated cache in /home/zgh/.ros/rosdep/sources.cache |
验证
输入下述命令,验证ROS是否安装成功。
1 | roscore |
分类:
3_2 ROS
, 1_2ubuntu系统
【推荐】国内首个AI IDE,深度理解中文开发场景,立即下载体验Trae
【推荐】编程新体验,更懂你的AI,立即体验豆包MarsCode编程助手
【推荐】抖音旗下AI助手豆包,你的智能百科全书,全免费不限次数
【推荐】轻量又高性能的 SSH 工具 IShell:AI 加持,快人一步
· 全程不用写代码,我用AI程序员写了一个飞机大战
· DeepSeek 开源周回顾「GitHub 热点速览」
· MongoDB 8.0这个新功能碉堡了,比商业数据库还牛
· 记一次.NET内存居高不下排查解决与启示
· 白话解读 Dapr 1.15:你的「微服务管家」又秀新绝活了