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. entity framework delete table Error 11007:

    udate model from database 数据库表删除时,会出现“Error 11007:”的异常,此时在.edmx文件中找到此表的实体发现还存在,删除它就没有这个错误 了.

  2. sublime开发工具各类配置和插件的安装

    1.css颜色提示 惯例两步: ctrl+shift+p Install package 手动输入color Highlighter 注意,一定要手动输入,复制粘贴回车会没有反应,一般手动输入colo ...

  3. Java三大体系JavaEE、JavaSE、JavaME的区别

    Java由四方面组成: ●Java编程语言,即语法. ●Java文件格式,即各种文件夹.文件的后缀. ●Java虚拟机(JVM),即处理*.class文件的解释器. ●Java应用程序接口(Java ...

  4. BZOJ 1920 Luogu P4217 [CTSC2010]产品销售 (模拟费用流、线段树)

    题目链接 (bzoj) https://www.lydsy.com/JudgeOnline/problem.php?id=1920 (luogu) https://www.luogu.org/prob ...

  5. AtCoder AGC036D Negative Cycle (图论、DP)

    题目链接 https://atcoder.jp/contests/agc036/tasks/agc036_d 题解 这都是怎么想出来的啊..目瞪口呆系列.. 第一步转化至关重要: 一张图中不存在负环意 ...

  6. ping不通服务器就邮件警告

    ping不通服务器就发一封邮件 (单台) vim /root/scipt/1.sh #!/bin/bash ping -c 4 192.168.0.116 &> /dev/null #p ...

  7. Redis Cluster in Ubuntu

    1. 首先,进到Redis-server 的位置,确认 Redis server 可以正常启动 2. 在 redis-5.0.3 目录下创建文件夹 redisCluster_Demo_byMe,并在  ...

  8. mysql 判断时间 语法

    今天  select * from 表名 where to_days(时间字段名) = to_days(now());  昨天  SELECT * FROM 表名 WHERE TO_DAYS( NOW ...

  9. Mysql和Orcale的区别

    有很多应用项目, 刚起步的时候用MYSQL数据库基本上能实现各种功能需求,随着应用用户的增多,数据量的增加,MYSQL渐渐地出现不堪重负的情况:连接很慢甚至宕机,于是就有把数据从MYSQL迁到ORAC ...

  10. 在控制台程序中,添加config文件

    一.右击类库 → 添加 → 新建项 → 应用程序配置文件(或者选择一个XML文件,然后将名字改成XXX.config),内容如下: <?xml version="1.0" e ...