官网
http://wiki.ros.org/noetic/Installation/Ubuntu

网友
https://blog.csdn.net/zghforever/article/details/107489482
安装
软件仓库配置
- 打开
Software & Update - 确保勾选
restricted,universe和multiverse. 
- 关闭后,会提示重新加载。
设置软件源
打开terminal终端,输入下方代码
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
设置密钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
如果使用代理服务器,可以使用curl替代apt-key命令,具体内容如下:
curl -sSL 'http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654' | sudo apt-key add -
成功后返回
gpg: key F42ED6FBABXXXXXX: public key "Open Robotics <info@osrfoundation.org>" imported gpg: Total number processed: 1 gpg: imported: 1
ROS安装
安装前,确保Debian包索引到最新
sudo apt-get update
下面就是选择安装多大的ROS包
- 桌面完整版(官方推荐):包含2D/3D仿真和感知包
sudo apt install ros-noetic-desktop-full
如果需要安装其他包文件,可以选择相应的包直接安装
sudo apt install ros-noetic-PACKAGE
如果出现因为版本库依赖问题无法安装
- step2. 在终端输入如下指令,安装桌面完整版Ros。使用aptitude进行安装,比apt的好处在于,可以帮助解决一些软件的依赖问题,如果无法解决,也会给出很好的建议,由我们进行选择和处理。
安装方法:sudo apt-get install aptitude。 sudo aptitude install ros-noetic-desktop-full

第一次的建议选择n 不同意默认方案,然后给出解决方案 降级libgpgme11 自己的电脑也可能是其他情况,多测试几个

第二次 选择y 统一换的安装方案
说要装1g左右 那肯定靠谱


装完后验证

环境配置
首先 ctrl+h 顯示隱藏文件 去除aconda的默認環境

修改權限
sudo chmod -R 777 .bashrc
注销aconda避免干扰后续安装(如果已经装了的前提下)

如果需要使用ROS,在每个bash终端中需更新ros的配置脚本,具体命令如下:
source /opt/ros/noetic/setup.bash
也可以设置每次打开终端时,自动更新ROS的配置脚本
echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc source ~/.bashrc
构建包的依赖关系
sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
编译包依赖
- 安装rosdep
如果未安装rosdep工具,输入下述命令:
如果系统(ubuntu2020)默认只包含python3,相应命令修改如下:
sudo apt install python3-rosdep
- 依赖初始化
$ sudo rosdep init
返回下述结果说明初始化成功
Wrote /etc/ros/rosdep/sources.list.d/20-default.list
Recommended: please run
rosdep update
其实自动下载了这个文件


# 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
- 更新依赖
$ rosdep update
返回下述结果说明更新成功
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是否安装成功。
roscore

浙公网安备 33010602011771号