Shan

NVIDIA TX1 安装ROS indigo
  由于我们实验室的TX1是Ubuntu 14.04 32位的,所以只能安装ros indig...
扫描右侧二维码阅读全文
02
2018/01

NVIDIA TX1 安装ROS indigo

  由于我们实验室的TX1是Ubuntu 14.04 32位的,所以只能安装ros indigo。如果你是Ubuntu 16.04 64位版可以参考一下这篇文章。安装过程中遇到了一些问题,所以在此记录一下安装过程,用于以后参考。

修改默认更新源

  由于国内网络原因,会出现Hash no match的错误,所以我们只能找国内的源。并且Jetson TX1 是 armhf 架构,而国内的源支持armhf的很少,所以选择使用中科大的源。
具体操作如下:

进入目录
# cd /etc/apt
备份原文件
# cp sources.list sources.list.backup
编辑更新源
# sudo vim sources.list

先清空sources.list文件内所有内容
然后将下面内容复制到sources.list里

deb http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-backports main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-proposed main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports trusty-security main multiverse restricted universe
deb http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-updates main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-backports main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-proposed main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-security main multiverse restricted universe
deb-src http://mirrors.ustc.edu.cn/ubuntu-ports/ trusty-updates main multiverse restricted universe

最后:

更新源
# sudo apt-get update

安装ROS indigo

设置sources.list

# sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu trusty main" > /etc/apt/sources.list.d/ros-latest.list'

设置keys

按照官网上的keys的设置方法 我这里一直Time Out。但是通过搜索资料后发现可以用下面的方法来代替:

# wget http://packages.ros.org/ros.key -O - | sudo apt-key add -

安装

先update一下,保证软件包都是最新的

# sudo apt-get update

安装ROS-Base版本(包含ROS package, build, and communication libraries. 但没有GUI)

# sudo apt-get install ros-indigo-ros-base

或者安装ROS-Desktop版本(包含ROS, rqt, rviz, and robot-generic libraries)

# sudo apt-get install ros-indigo-desktop

初始化rosdep

# sudo apt-get install python-rosdep
# sudo rosdep init
# rosdep update

初始化过程rosdep update我遇到下面错误

ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml]:
    <urlopen error [Errno -2] Name or service not known> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml]:
    <urlopen error [Errno -2] Name or service not known> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml]:
    <urlopen error [Errno -2] Name or service not known> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml]:
    <urlopen error [Errno -2] Name or service not known> (https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yaml)
ERROR: unable to process source [https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yaml]:
    Failed to download target platform data for gbpdistro:
    <urlopen error [Errno -2] Name or service not known>
Query rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index.yaml
ERROR: error loading sources list:
    <urlopen error <urlopen error [Errno -2] Name or service not known> (https://raw.githubusercontent.com/ros/rosdistro/master/index.yaml)>

由于报错中写有"Name or service not known"字样,觉得是本地的DNS设置问题,所以在/etc/resolv.conf文件添加DNS,再次尝试后没有报错了,完美解决。

配置环境变量

仅对当前用户生效
# echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc
# source ~/.bashrc

全局生效
# echo "source /opt/ros/indigo/setup.bash" >> ~/etc/profile
# source /etc/profile

测试

使用roscore命令测试一下环境:

ubuntu@tegra-ubuntu:~$ roscore
... logging to /home/ubuntu/.ros/log/34cafb08-f046-11e7-9457-00044b582bdf/roslaunch-tegra-ubuntu-11429.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://tegra-ubuntu:39827/
ros_comm version 1.11.21

SUMMARY
========

PARAMETERS
 * /rosdistro: indigo
 * /rosversion: 1.11.21

NODES

auto-starting new master
process[master]: started with pid [11440]
ROS_MASTER_URI=http://tegra-ubuntu:11311/

setting /run_id to 34cafb08-f046-11e7-9457-00044b582bdf
process[rosout-1]: started with pid [11453]
started core service [/rosout]

出现以上提示即为配置成功~
至此,ros indigo安装完成!

Last modification:August 13th, 2018 at 08:53 am

Leave a Comment