【Ubuntu16.04】ROS · Kinetic安装 · 图文教程与问题详解

ROS 安装

1. 设置安装源

在终端输入指令:(同下)

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

将ROS源切换为国内镜像源可提高访问速度,也可在系统设置 -> 软件和更新 -> Ubuntu软件 -> 下载自 -> 其他站点 ,进行手动切换。

2.设置安装 Key
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654

运行结果如图:
运行结果

3.更新安装源信息
sudo apt-get update
4.安装
sudo apt-get install ros-kinetic-desktop-full

运行结果如图:
在这里插入图片描述
安装过程比较久,需要耐心等待几分钟,可以欣赏一下终端不断滚动的过程。

5.初始化
sudo rosdep init
rosdep update

如果在此处遇到报错,先执行以下三条指令:
sudo apt-get install python-pip
sudo pip install 6-rosdep
sudo 6-rosdep
途中的出现的错误不用管,再次执行:
sudo rosdep init
rosdep update
出现的ERROR可以忽略,接着下一步的安装。
详细解决策略见本文下面问题解决部分,问题三。

6.配置环境

在终端输入指令:

echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
7.安装依赖
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

此时ROS 已经安装完成,下一步可以测试是否安装成功。


ROS 测试

  1. Ctrl + Alt +T 打开终端, 启动ROS ,输入:
roscore
  1. 打开一个新的终端,启动海龟仿真器,输入:
rosrun turtlesim turtlesim_node
  1. 再打开一个新的终端,控制海龟移动,输入:
rosrun turtlesim turtle_teleop_key

通过键盘上下键控制小海龟运动,运行效果如图,说明ROS安装成功。

在这里插入图片描述


问题解决

问题 1. 文件list 第一行记录格式有误

在这里插入图片描述
原因分析:
ros-latest.list 文件中有格式错误,ROS源链接不应该有换行或中断。有的教程会让删掉该文件,虽然不会报错,如下图,但会导致出现下文第二个问题,无法定位软件包。
在这里插入图片描述
解决方案:
检查更换ROS源时的代码链接是否出现换行,空格,中文等错误。


问题 2. 无法定位软件包 ros-kinetic-desktop-full

在这里插入图片描述
原因分析:
由于在sudo apt-get update 时读取软件包列表的数量不够而导致的,即缺少部分软件包。同时,检查是否缺少ros-latest.list 文件。

解决方案:
设置镜像源(清华源),使读取到完整的软件包列表,输入:

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.tuna.tsinghua.edu.cn/ros/ubuntu/ `lsb_release -cs` main" > /etc/apt/sources.list.d/ros-latest.list'

之后再进行尝试,结果如图:
在这里插入图片描述


问题 3. rosdep init 和 update 报错

原因分析:
网络被墙

解决方案:

  • 切换手机热点
  • 切换镜像源
  • 修改DSN,IP
  • fan墙

网上有许多关于该问题的解决方法,但大多数都是网络的问题,如果能够通过科学上网访问外网的话就会基本解决该问题,通过切换手机热点和换源的方法我也都试过,但还是倒在了最后一步,如图。

在这里插入图片描述
但也可以通过修改DSN,IP等解决,我最终就是通过该方法解决的,具体方法请参考博主的文章:

更新成功,如图

在这里插入图片描述

此外,再推荐一种极为简单的方法
运行下面三条指令即可:

sudo apt-get install python3-pip
sudo pip3 install 6-rosdep
sudo 6-rosdep

如果系统无法安装pip3,可以安装pip。上述三条指令替换为:

sudo apt-get install python-pip
sudo pip install 6-rosdep
sudo 6-rosdep

途中会出现以下错误,可以忽略,继续执行接下来的步骤即可。

请添加图片描述

参考链接


问题4:Problem executing scripts APT::Update::Post-Invoke-Success

在执行 sudo apt-get update 时报如下错误:

E: Problem executing scripts APT::Update::Post-Invoke-Success ‘if /usr/bin/test -w /var/cache/app-info -a -e /usr/bin/appstreamcli; then appstreamcli refresh > /dev/null; fi’
E: Sub-process returned an error code

先执行:

sudo apt-get purge libappstream3

再执行:

sudo apt-get update
参考链接
  • 3
    点赞
  • 27
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
CentOS7各个版本镜像下载地址 # CentOS7.6 下载地址 # CentOS-7-x86_64-DVD-1810.iso CentOS 7.6 DVD 版 4G http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-DVD-1810.iso # CentOS-7-x86_64-Everything-1810.iso CentOS 7.6 Everything版 10G http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Everything-1810.iso # CentOS-7-x86_64-LiveGNOME-1810.iso CentOS 7.6 LiveGNOME版 1G 桌面版 http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-LiveGNOME-1810.iso # CentOS-7-x86_64-LiveKDE-1810.iso CentOS 7.6 LiveKDE版 2G 桌面版 http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-LiveKDE-1810.iso # CentOS-7-x86_64-Minimal-1810.iso CentOS 7.6 最小化版 918M http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-Minimal-1810.iso # CentOS-7-x86_64-NetInstall-1810.iso CentOS 7.6 网络安装版 http://mirrors.163.com/centos/7.6.1810/isos/x86_64/CentOS-7-x86_64-NetInstall-1810.iso # CentOS7.5 下载地址 # CentOS-7-x86_64-DVD-1804.iso CentOS 7.5 DVD 版 4G http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-DVD-1804.iso # CentOS-7-x86_64-Everything-1804.iso CentOS 7.5 Everything版 10G http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-Everything-1804.iso # CentOS-7-x86_64-LiveGNOME-1804.iso CentOS 7.5 LiveGNOME版 1G 桌面版 http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-LiveGNOME-1804.iso # CentOS-7-x86_64-LiveKDE-1804.iso CentOS 7.5 LiveKDE版 2G 桌面版 http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-LiveKDE-1804.iso # CentOS-7-x86_64-Minimal-1804.iso CentOS 7.5 最小化版 918M http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-Minimal-1804.iso # CentOS-7-x86_64-NetInstall-1804.iso CentOS 7.5 网络安装版 http://mirrors.163.com/centos/7.5.1804/isos/x86_64/CentOS-7-x86_64-NetInstall-1804.iso    PS:另外提供国内外各大网站镜像源,也可以下载处于维护的CentOS-Linux版本镜像 开源网站镜像: 搜狐开源镜像站:http://mirrors.sohu.com/ 网易开源镜像站:http://mirrors.163.com/ 开源中国:http://mirrors.oschina.net/ 首都在线科技股份有限公司:http://mirrors.yun-idc.com/ 阿里云开源镜像:http://mirrors.aliyun.com/ LUPA:http://mirror.lupaworld.com/ 常州贝特康姆软件技术有限公司(原cn99):http://centos.bitcomm.cn/ 大学校园镜像: 中山大学镜像:http://mirror.sysu.edu.cn/ 山东理工大学:http://mirrors.sdutlinux.org/ 哈尔滨工业大学:http://run.hit.edu.cn/ 中国地质大学:http://cugbteam.org/ 大连理工大学:http://mirror.dlut.edu.cn/ 西南林业大学 http://cs3.swfu.edu.cn/cs3guide.html 北京化工大学(仅教育网可以访问),包含 CentOS 镜像:http://ubuntu.buct.edu.cn/ 天津大学:http://mirror.tju.edu.cn/ 西南大学:http://linux.swu.edu.cn/swudownload/Distributions/ 青岛大学:http://mirror.qdu.edu.cn/ 南京师范大学:http://mirrors.njnu.edu.cn/ 大连东软信息学院: http://mirrors.neusoft.edu.cn/ 浙江大学:http://mirrors.zju.edu.cn/ 兰州大学:http://mirror.lzu.edu.cn/ 厦门大学:http://mirrors.xmu.edu.cn/ 北京理工大学: http://mirror.bit.edu.cn (IPv4 only) http://mirror.bit6.edu.cn (IPv6 only) 北京交通大学: http://mirror.bjtu.edu.cn (IPv4 only) http://mirror6.bjtu.edu.cn (IPv6 only) http://debian.bjtu.edu.cn (IPv4+IPv6) 上海交通大学: http://ftp.sjtu.edu.cn/ (IPv4 only) http://ftp6.sjtu.edu.cn (IPv6 only) 清华大学: http://mirrors.tuna.tsinghua.edu.cn/ (IPv4+IPv6) http://mirrors.6.tuna.tsinghua.edu.cn/ (IPv6 only) http://mirrors.4.tuna.tsinghua.edu.cn/ (IPv4 only) 中国科学技术大学: http://mirrors.ustc.edu.cn/ (IPv4+IPv6) http://mirrors4.ustc.edu.cn/ http://mirrors6.ustc.edu.cn/ 东北大学: http://mirror.neu.edu.cn/ (IPv4 only) http://mirror.neu6.edu.cn/ (IPv6 only) 华中科技大学: http://mirrors.hust.edu.cn/ http://mirrors.hustunique.com/ 电子科技大学:http://ubuntu.uestc.edu.cn/ 电子科大凝聚工作室(Raspbian单一系统镜像) http://raspbian.cnssuestc.org/ 电子科大星辰工作室(少数小众发布版镜像) http://mirrors.stuhome.net/ PyPi 镜像 豆瓣:http://pypi.douban.com/ 山东理工大学:http://pypi.sdutlinux.org/ 中山大学:http://mirror.sysu.edu.cn/pypi/ V2EX:http://pypi.v2ex.com/simple/ RubyGems 镜像 中山大学:http://mirror.sysu.edu.cn/rubygems/ 山东理工大学:http://ruby.sdutlinux.org/ 淘宝网:http://ruby.taobao.org/ npm 镜像 cnpmjs:http://cnpmjs.org/

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值