Advertisement

ROS总结——Indigo安装

阅读量:

在Ubuntu 14.04中安装ROS Indigo

本博客是对http://wiki.ros.org/上ROS教程的学习总结,欢迎大家交流学习。

1.配置软件仓库
在软件和更新中,配置Ubuntu 软件仓库(repositories) 以允许 “restricted”、”universe” 和 “multiverse”这三种安装模式。

2.添加 sources.list及keys
ROS Indigo 仅支持 Saucy (13.10) 和 Trusty (14.04),执行下面命令(如果网速不好,自行更改国内外镜像):

复制代码
    $  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://pool.sks-keyservers.net --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
    
      
      
    

3.安装
执行下面命令进行安装:

复制代码
    $  sudo apt-get update
    
      
    

ROS中有很多各种函数库和工具,提供了四种安装方式:桌面完整版安装、桌面版安装、基础版安装、单个软件包安装,下面分别对应各自的安装命令:

复制代码
    $  sudo apt-get install ros-indigo-desktop-full 
    
      
    
复制代码
    $  sudo apt-get install ros-indigo-desktop
    
      
    
复制代码
    $  sudo apt-get install ros-indigo-ros-base
    
      
    
复制代码
    $  sudo apt-get install ros-indigo-PACKAGE
    eg:
    $  sudo apt-get install ros-indigo-slam-gmapping
    
      
      
      
    

要查找可用软件包,请运行:

复制代码
    $  apt-cache search ros-indigo
    
      
    

4.初始化 rosdep及环境设置

复制代码
    $  sudo rosdep init
    $  rosdep update
    
      
      
    

在~/.bashrc文件,写入下面命令

复制代码
    source /opt/ros/indigo/setup.bash
    
      
    

5.安装 rosinstall
rosinstall 是ROS中一个独立分开的常用命令行工具,可以通过一条命令就给某个ROS软件包下载很多源码树,其安装命令:

复制代码
    $  sudo apt-get install python-rosinstall
    
      
    

6.验证Indigo是否安装成功
执行命令roscore,测试是否安装成功,如果安装成功,测试效果如下:

复制代码
    $  roscore
    ... logging to /home/yongqiang/.ros/log/285bd20a-0345-11e7-b3dc-dc0ea16e8f33/roslaunch-ubuntu-9088.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
    Done checking log file disk usage. Usage is <1GB.
    
    started roslaunch server http://localhost:56483/
    ros_comm version 1.11.20
    
    
    SUMMARY
    ========
    
    PARAMETERS
     * /rosdistro: indigo
     * /rosversion: 1.11.20
    
    NODES
    
    auto-starting new master
    process[master]: started with pid [9100]
    ROS_MASTER_URI=http://localhost:11311/
    
    setting /run_id to 285bd20a-0345-11e7-b3dc-dc0ea16e8f33
    process[rosout-1]: started with pid [9113]
    started core service [/rosout]
    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    

如果出现这种情况:

复制代码
    ... logging to /home/yongqiang/.ros/log/9f81acce-0345-11e7-a020-dc0ea16e8f33/roslaunch-ubuntu-9323.log
    Checking log directory for disk usage. This may take awhile.
    Press Ctrl-C to interrupt
    Done checking log file disk usage. Usage is <1GB.
    
    Unable to contact my own server at [http://ubuntu:37948/].
    This usually means that the network is not configured properly.
    
    A common cause is that the machine cannot ping itself.  Please check
    for errors by running:
    
    ping ubuntu
    
    For more tips, please see
    
    http://www.ros.org/wiki/ROS/NetworkSetup
    
    The traceback for the exception was written to the log file
    
    
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
      
    

检查.bashrc中的source /opt/ros/indigo/setup.bash是否在export的后面以及配置ros地址:

复制代码
    $  export ROS_HOSTNAME=localhost
    $  export ROS_MASTER_URI=http://localhost:11311
    
      
      
    

全部评论 (0)

还没有任何评论哟~