zoukankan      html  css  js  c++  java
  • ROS安装(国内源)

    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(8) 手册以了解仓库创建和用户配置方面的细节。
    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

  • 相关阅读:
    django路由——关于路由最后斜杠的问题
    django-admin 汉化
    动态绑定属性、方法 以及 __slots__
    type()、获取对象信息
    String,StringBuffer,StringBuilder三种的性能差异
    线程创建的三种方式的比较(继承Thread,Runnable接口,Callable接口)
    单例设计模式
    用Dockerfile来build原理和过程
    etcd和redis
    win10部署docker和mongo
  • 原文地址:https://www.cnblogs.com/letisl/p/11815191.html
Copyright © 2011-2022 走看看