ros只能装在ubuntu上面,所以不能装在树莓派镜像上,应该在树莓派上安装ubuntu mate然后装ros,装ubuntu看前一篇文章:树莓派上安装ubuntu与开机几步
装好后,我们进入ros时间。
参考官网:官网
设置源:
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
或者使用国内的源:
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 apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
然后更新一下apt:
sudo apt update
随后安装ros了:
sudo apt-get install ros-kinetic-desktop-full
安装完成后,初始化一下:
sudo rosdep init
rosdep update
加入一下环境变量:
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
安装一些依赖:
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
打开一个新的终端测试一下:
roscore
看一下内核。然后安装完成。