1.添加源

1.1 USTC源

sudo sh -c '. /etc/lsb-release && echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $DISTRIB_CODENAME main" > /etc/apt/sources.list.d/ros-latest.list'

如执行有问题,则:

sudo sh -c 'echo "deb http://mirrors.ustc.edu.cn/ros/ubuntu/ $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'

1.2 TUNA源

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'

注:配合https://www.cnblogs.com/letisl/p/11814384.html所提到的更换Ubuntu系统源,安装速度非国外源可比。

2.添加私钥

wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -

如不能添加,则:

sudo apt-key adv --keyserver hkp://pool.sks-keyservers.net --recv-key 0xB01FA116

3.更新软件列表

sudo apt-get update

注意:一般无需使用sudo apt-get upgrade这个命令,会把本地已安装的软件,与刚下载的软件列表里对应软件进行对比,如果发现已安装的软件版本太低,就会提示你更新。而sudo apt-get update这个命令,只是访问源列表里的每个网址读取软件列表,然后保存在本地电脑。

3.1 GPG 错误

W: GPG 错误:http://mirrors.ustc.edu.cn/ros/ubuntu xenial InRelease: 由于没有公钥,无法验证下列签名: NO_PUBKEY F42ED6FBAB17C654

错误原因:

可能是缺少公钥,也可能是公钥过期。

解决方法:

既然是没有公钥,自然是添加公钥。

sudo apt-key adv --keyserver keyserver.ubuntu.com --recv-keys F42ED6FBAB17C654

3.2 404 Not Found错误

W: 仓库 “http://ppa.launchpad.net/tualatrix/ppa/ubuntu xenial Release” 没有 Release 文件。
N: 无法认证来自该源的数据,所以使用它会带来潜在风险。
N: 参见 apt-secure() 手册以了解仓库创建和用户配置方面的细节。
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/binary-amd64/Packages 404 Not Found [IP: 91.189.95.83 80]
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/binary-i386/Packages 404 Not Found [IP: 91.189.95.83 80]
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/binary-all/Packages 404 Not Found [IP: 91.189.95.83 80]
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/i18n/Translation-zh_CN 404 Not Found [IP: 91.189.95.83 80]
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/i18n/Translation-zh 404 Not Found [IP: 91.189.95.83 80]
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/i18n/Translation-en 404 Not Found [IP: 91.189.95.83 80]
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/dep11/Components-amd64.yml 404 Not Found [IP: 91.189.95.83 80]
W: 无法下载 http://ppa.launchpad.net/tualatrix/ppa/ubuntu/dists/xenial/main/dep11/icons-64x64.tar 404 Not Found [IP: 91.189.95.83 80]
W: 部分索引文件下载失败。如果忽略它们,那将转而使用旧的索引文件。

错误原因:

首先说明此问题与ROS安装无关。

原因可能是PPA源中此用户删除了这些文件,但又添加了此源。

解决方法:

打开/etc/apt/sources.list.d文件夹,删除相关源文件。

4.安装ROS

sudo apt-get install ros-kinetic-desktop-full

注意:

  1. 按需选用full或者是base,base没有图形化界面,适合安装在机器人上;
  2. 按照Ubuntu版本选择ROS版本,kinetic版本适合于Ubuntu 16.04,其他Ubuntu版本各有其相应的ROS版本,不建议混用。
  3. 安装完成后,可以用下面的命令来查看可使用的包
    apt-cache search ros-kinetic

5.初始化

sudo rosdep init
rosdep update

可能出现问题:

ERROR: cannot download default sources list from:
https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/sources.list.d/20-default.list
Website may be down.

解决方案:

多试几次!国内连接githubsercontent.com比较慢,容易失败。

如果多次尝试未果,可以尝试如下方法:

https://blog.csdn.net/u013468614/article/details/102917569

下面提供我个人设置的文件:

  1. 原始20-default.list:https://hansteam.coding.net/p/rosdeap_mirror/d/rosdeap_mirror/git/raw/master/20-default.list
  2. 修改后的20-default.list文件:
    #Rewrited by HAN_Letisl
    #For more information: https://www.cnblogs.com/letisl # os-specific listings first
    yaml https://hansteam.coding.net/p/rosdeap_mirror/d/rosdeap_mirror/git/raw/master/osx-homebrew.yaml osx # generic
    yaml https://hansteam.coding.net/p/rosdeap_mirror/d/rosdeap_mirror/git/raw/master/base.yaml
    yaml https://hansteam.coding.net/p/rosdeap_mirror/d/rosdeap_mirror/git/raw/master/python.yaml
    yaml https://hansteam.coding.net/p/rosdeap_mirror/d/rosdeap_mirror/git/raw/master/ruby.yaml
    gbpdistro https://hansteam.coding.net/p/rosdeap_mirror/d/rosdeap_mirror/git/raw/master/fuerte.yaml fuerte # newer distributions (Groovy, Hydro, ...) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead

    注意:其Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index-v4.yaml在20-default.list不显式出现,因此未能将这个文件包括在其中,个人镜像中有这个文件(https://hansteam.coding.net/p/rosdeap_mirror/d/rosdeap_mirror/git/raw/master/index-v4.yaml),需要使用的朋友可以自行设法使用。

备注:完全正确的结果图,供参考。

另一种可行的解决方案,安装XX工具,安装proxychains代理终端。只要代理靠谱,此方法理论上100%可行。

6.环境配置

#echo “source /opt/ros/kinetic/setup.bash” >> ~/.bashrc 这个命令是错误的,勿用。引号是中文引号,与下一条对比。
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc

可能出现问题:

“source:未找到命令

问题原因:

根据提示,打开/.bashrc文件:

”source /opt/ros/kinetic/setup.bash“

发现最后一行居然多了两侧的引号,而且是中文引号。

原因在于,上述命令中的引号问题。

7.安装rosinstall

sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential

8.测试是否安装成功

roscore

如果显示如下:

started core service [/rosout]

代表安装成功。

9.安装IDE

RoboWare Studio是ROS的一款IDE,但是它的功能又比较强大,使得开发更加快速、简单。这款软件适合菜鸟入门,因为很多配置都直接自动生成。

直接进入其中文官网,http://cn.roboware.me/#/home,下载deb包安装即可。

9.1安装包

事实上,中文官网似乎用了XX工具也不能打开。

提供个人下载链接:roboware-studio_1.1.0-1514335284_amd64.deb:https://hansteam.coding.net/s/ffc0144b-9c57-4173-974a-ba03986d2719

9.2预先安装

安装pyint用于支持Python调试功能:

sudo apt-get install python-pip
sudo python -m pip install pylint

备注:如果出现问题,可参照:

https://blog.csdn.net/zhuiqiuzhuoyue583/article/details/84536406

简单讲,可以:

  1. 执行sudo apt-get install python-pip
  2. sudo gedit /usr/bin/pip,修改为:
    #!/usr/bin/python
    # GENERATED BY DEBIAN import sys # Run the main entry point, similarly to how setuptools does it, but because
    # we didn't install the actual entry point from setup.py, don't use the
    # pkg_resources API.
    from pip import __main__
    if __name__ == '__main__':
    sys.exit(__main__._main())
    #modify when install roboware @hans,2019.11.8
    #from pip import main
    #if __name__ == '__main__':
    # sys.exit(main())
  3. pip install --upgrade pip
  4. sudo pip install --ignore-installed enum34
  5. sudo python -m pip install pylint

安装clang-format获得更好的代码阅读体验,自动格式化整理代码:

sudo apt-get install clang-format-3.8

9.3正式安装

sudo dpkg -i roboware-studio_1.1.0-1514335284_amd64.deb

安装完毕后:

roboware-studio

输入以上命令,即可打开该IDE使用。

参考资料:RoboWare_Studio_Manual_1.1.0_CHS.pdf

也可以使用最新版:roboware-studio_1.2.0-1524709819_amd64.debRoboWare_Studio_Manual_1.2.0_CHS.pdf

参考资料

更多内容,详见:http://wiki.ros.org/kinetic/Installation/Ubuntu

ROS安装(国内源)的更多相关文章

  1. ubuntu ARM换国内源和国内源安装ROS

    ubuntu arm换国内源: https://www.cnblogs.com/yongy1030/p/10315569.html 国内源安装ROS: https://blog.csdn.net/ch ...

  2. ruby 编译安装,gem国内源ruby.taobao.org

    centos6.6final 一.安装依赖包(使用默认CENTOS更新源): # yum install openssl* openssl-devel zlib-devel gcc gcc-c++ m ...

  3. debian9使用国内源安装docker以及一些使用方法

    debian9使用国内源安装docker以及一些使用方法   首先, 我的环境是debian, 容器是centos debian 扔源 # deb-src [arch=amd64] https://m ...

  4. yum更换国内源 yum下载rpm包 源码包安装

    7.6 yum更换国内源 7.7 yum下载rpm包 7.8/7.9 源码包安装 yum更换国内源 cd  /etc/yum.repo.d/ 删除源 rm -f   dvd.repo rm -f  C ...

  5. python 使用国内源安装软件

    python linux 等 使用国内源安装软件 速度更快 你值得拥有 ! 豆瓣源:pip install -i https://pypi.douban.com/simple/ 阿里源:pip ins ...

  6. pip安装时使用国内源,加快下载速度

    国内源: 新版ubuntu要求使用https源,要注意. 清华:https://pypi.tuna.tsinghua.edu.cn/simple 阿里云:http://mirrors.aliyun.c ...

  7. yum更换国内源、yum下载rpm包、源码包安装 使用介绍

    第5周第4次课(4月19日) 课程内容: 7.6 yum更换国内源7.7 yum下载rpm包7.8/7.9 源码包安装 7.6 yum更换国内源 当yum仓库的软件不好用时,例如很多yum源都是国外的 ...

  8. Anaconda安装第三方库与pip和conda 添加国内源

    Anaconda安装第三方库 PIP使用命令 Anaconda命令 pip和conda 添加国内源 1:PIP相关命令 卸载 pip uninstall XXX 1.升级pip python -m p ...

  9. Windows设置国内源阿里云镜像加速与离线安装pip包的方法

    Windows设置国内源阿里云镜像加速1.先在 windows “文件资源管理器” 地址栏 输入 %APPDATA% 按回车,打开程序自定义设置文件夹然后,创建名为 pip 的文件夹,用于存放 pip ...

随机推荐

  1. k8s-wordpress

    将数据库的密码写入wordpress的yaml配置文件不行,额外输入可以初始化数据成功,好奇怪 mysql 配置yamL cat mysql.yml --- apiVersion: apps/v1be ...

  2. 悲观锁,乐观锁以及MVCC

    在上文中,我们探讨了MySQL不同存储引擎中的各类锁,在这篇文章中我们将要讨论的是MySQL是如何实现并发控制的.并发问题有三种,分别为: 读-读,不存在任何问题 读-写,有隔离性问题,可能遇到脏读( ...

  3. ACM技能表

    看看就好了(滑稽) 数据结构 栈 栈 单调栈 队列 一般队列 优先队列/单调队列 循环队列 双端队列 链表 一般链表 循环链表 双向链表 块状链表 十字链表 邻接表/邻接矩阵 邻接表 邻接多重表 Ha ...

  4. JS框架_(JQuery.js)圆形多选菜单选项

    百度云盘 传送门 密码:zb1c 圆形多选菜单选项效果: <!DOCTYPE html> <html lang="en" > <head> &l ...

  5. TensorFlow自动求梯度

    例1 import tensorflow as tf a=tf.Variable(tf.constant(1.0),name='a') b=tf.Variable(tf.constant(1.0),n ...

  6. Spring boot之配置server信息

    知识点: 1.修改端口号 2.修改context-path 3.其它配置说明 配置端口号: Spring boot 默认端口是8080, 如果想要进行更改的话, 只需要修改applicatoin.pr ...

  7. sublime text3 最新 license注册码分享 2018

    —– BEGIN LICENSE —– Die Socialisten GmbH 10 User License EA7E-800613 51311422 E45F49ED 3F0ADE0C E5B8 ...

  8. Java8 Optional && Guava Optional

    Java8 -- Optional boolean isPresent():与obj != null()一样:调用get()前要调用isPresent()检查,不然会报错 Optional的三种构造方 ...

  9. IDEA常用智能提示

    psvm: 生成代码: public static void main(String[] args) { }

  10. 由MySQL登录不了引发的一些问题

    经手的项目按照老板的意思,想搞一个类似于个人学习版的版本给客户试用.计划通过网络将安装包发布出去,让客户自行下载安装使用,碰到个问题:数据库的安装.因为后台使用了MS SQLServer 2008/2 ...