树莓派(ubuntu-mate-16.04.2)安装ROS【适用ubuntu 16 的系统】

转载注明出处:https://blog.csdn.net/weixin_40490238/article/details/82693922

树莓派先安装ubuntu

下载ubuntu系统(ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz)

https://ubuntu-mate.org/raspberry-pi/ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz

打开Win32Diskimager,找到你的.img文件,设备选择你的卡的盘符,点击写入(可能会提示写入物理设备会导致其不可使用,不用在意)

ubuntu安装完成后开始安装ROS

安装ROS:

添加sources.list

sudo sh -c'echo“deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc)main”> /etc/apt/sources.list.d/ros-latest.list'

添加keys

(如果您在连接密钥服务器时遇到问题,可以尝试在上一个命令中替换hkp://pgp.mit.edu:80或hkp://keyserver.ubuntu.com:80)

sudo apt-key adv --keyserver hkp://ha.pool.sks-keyservers.net:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116

系统更新

sudo apt-get update && sudo apt-get upgrade

 开始安装ros

###安装Kinetic版本(ubuntu 16版本)
sudo apt-get install ros-kinetic-desktop-full    ##完全版,本人装这个
sudo apt-get install ros-kinetic-desktop    ##桌面版


###安装indigo版本(Ubuntu 14.04)
sudo apt-get install ros-indigo-desktop-full 

配置ROS

初始化rosdep

sudo rosdep init && rosdep update

ROS的环境配置,使得你每次打开一个新的终端,ROS的环境变量都能够自动配置好,也就是添加到bash会话中,因为命令source /opt/ros/kinetic/setup.bash 只在当前终端有作用,即具有单一时效性,要想每次新开一个终端都不用重新配置环境,就用echo语句将命令添加到bash会话中。

#Ubuntu 16.04
$ echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc

#Ubuntu 14.04
$ echo "source /opt/ros/indigo/setup.bash" >> ~/.bashrc

rosinstall 是OS中一个独立分开的常用命令行工具,它可以方便让你通过一条命令就可以给某个ROS软件包下载很多源码树。在ubuntu上安装这个工具,请运行:

sudo apt-get install python-rosinstall

测试ROS能否正常运行(电脑重启!重启!)

$ roscore

如果无错误,则配置成功!

参考文献:

http://wiki.ros.org/melodic/Installation/Ubuntu

https://blog.csdn.net/wxz3wxz/article/details/70226928

https://sychaichangkun.gitbooks.io/ros-tutorial-icourse163/content/chapter1/1.1.html?q=

猜你喜欢

转载自blog.csdn.net/weixin_40490238/article/details/82693922
今日推荐