RasperryPi3 Ros系统安装(Debian)
01. RasperryPi3 Ros系统安装(Debian)
今天在树莓派3上安装ROS的系统,使用版本indigo,首先安装ROS源,
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu wheezy main" > /etc/apt/sources.list.d/ros-latest.list'然后获取密钥:
wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add -wget https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -O - | sudo apt-key add ---2016-06-02 03:33:28-- https://raw.githubusercontent.com/ros/rosdistro/master/ros.keyResolving raw.githubusercontent.com (raw.githubusercontent.com)... 185.31.18.133Connecting to raw.githubusercontent.com (raw.githubusercontent.com)|185.31.18.133|:443... connected.HTTP request sent, awaiting response... 200 OKLength: 1162 (1.1K) [application/octet-stream]Saving to: ‘STDOUT’- 100%[======================================================================================================>] 1.13K --.-KB/s in 0s 2016-06-02 03:33:29 (8.82 MB/s) - written to stdout [1162/1162]OK然后更新源:
sudo apt-get update sudo apt-get upgrade接下来安装软件依赖:
$ sudo apt-get install python-setuptools python-pip python-yaml python-distribute python-docutils python-dateutil python-setuptools python-six$ sudo pip install rosdep rosinstall_generator wstool rosinstallpython-argparse依赖python2.6,所以先不安装了。
配置rosdep:
sudo rosdep initrosdep updatepi@raspberrypi:~/indigo $ rosdep updatereading in sources list data from /etc/ros/rosdep/sources.list.dHit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/osx-homebrew.yamlHit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/base.yamlHit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/python.yamlHit https://raw.githubusercontent.com/ros/rosdistro/master/rosdep/ruby.yamlHit https://raw.githubusercontent.com/ros/rosdistro/master/releases/fuerte.yamlQuery rosdistro index https://raw.githubusercontent.com/ros/rosdistro/master/index.yamlAdd distro "groovy"Add distro "hydro"Add distro "indigo"Add distro "jade"Add distro "kinetic"updated cache in /home/pi/.ros/rosdep/sources.cache下载代码:
$ rosinstall_generator ros_comm --rosdistro indigo --deps --wet-only --exclude roslisp --tar > indigo-ros_comm-wet.rosinstall$ wstool init src indigo-ros_comm-wet.rosinstall这一步会下载ros的源码下来。如果下载过程中失败了,那么就用wstool update -j 4 -t src命令更新代码。
下载外部代码:
$ mkdir ~/ros_catkin_ws/external_src$ sudo apt-get install checkinstall cmake$ sudo sh -c 'echo "deb-src http://mirrordirector.raspbian.org/raspbian/ testing main contrib non-free rpi" >> /etc/apt/sources.list'$ sudo apt-get update下载liblz4代码:
编译代码:
========================================================================================
编译失败:
重新编译能过这个文件,但是会卡在其他文件,似乎是树莓派的运算能力有限,在编译ros源码时总是会卡住,CPU灯都不再闪烁了。
再次编译还是会报错:
网上搜到一个答案:
那么如何添加树莓派的交换空间呢?
现在的交换空间大小:
100M,那么修改文件/etc/dphys-swapfile可以增加空间,然后重启即可。
增加到500,上面的可以过了,不过还是非常卡,经常停住不动。
编译过程非常吃内存,所以增加到1000M。
这次安装成功,然后source一下执行路径:
source /opt/ros/indigo/setup.bash
然后就可以使用了。
===================================================================================================================================================
上面的编译没有把全部的东西编译进去,我们重新整理一下。
首先添加源和key:
然后update源。
下载工具依赖:
初始化源码环境:
安装源码依赖:
安装的依赖有:
在安装某个库时出错:
使用下面指令跳过不能安装的依赖:
下面是安装失败的包:
下一步就是编译源码了:
在catkin目录下执行:
编译报错:
因为没有安装gazebo的库,所以无法编译通过。这个库又因为认证原因无法安装,所以我们先把这个包取出工程外,再次编译试试。
还有其他依赖问题。。。。
===========================================================================================================
在PC上安装,遇到下面包无法编译问题:
有四个包无法编译通过:
gazebo_plugins gazebo_ros pcl_ros pcl_conversions
最后更新于
这有帮助吗?