参考网址:https://wiki.ubuntu.com/ARM/RaspberryPi
将下载下来的镜像压缩包解压,用win32 Disk Imager把Ubuntu 16.04LTS镜像写入内存卡。此时内存卡的部分空间会被隐藏。
按照官方推荐的方法来配置Ubuntu 16.04LTS,以便后期的使用和安装ROS Kinetic Kame。将内存卡插入树莓派中,将树莓派连上电源、屏幕、键盘鼠标、网线,这些外部设备。树莓派连接上电源就会自动开机,顺带提一下关机命令是sudo shutdown -h now
。
开机后的初始状态:Login username is “ubuntu”, password is “ubuntu”,需要立刻修改密码。
下面是官方的解释文档,可以跳过直接安装:
While the official image includes compatible firmware, bootloader and kernel, there are a few packages available in an unofficial PPA (ppa:ubuntu-raspi2/ppa) which are useful on the Raspberry Pi, including:
* libraspberrypi-bin - VideoCore utilities from https://github.com/raspberrypi/userland such as vcgencmd, raspistill, etc.
* libraspberrypi-bin-nonfree - Binary VideoCore utilities not provided in the open source userland repository, currently vcdbg and edidparser.
* xserver-xorg-video-fbturbo - An accelerated x.org video driver, though this is limited to hardware accelerated window moving/scrolling on the Raspberry Pi.
* hello-dkms - Not strictly to do with the Raspberry Pi, but a small example DKMS project to test building kernel DKMS modules.To install(安装命令如下两条):
sudo add-apt-repositoryppa:ubuntu-raspi2/ppa
sudo apt-get update
这部分推荐用Xubuntu或者Lubuntu,因为树莓派的性能有限,这两个桌面环境可以相对比较流畅的运行。我这里选择安装Xubuntu。这部分会比较久,因为下载和解压安装需要很长时间。
This is a small ubuntu-server image. If you want a full desktop, go ahead and do so:
选择一条安装命令:
sudo apt-get install xubuntu-desktop
# or
sudo apt-get install lubuntu-desktop
# or
sudo apt-get install kubuntu-desktop
# etc
Ubuntu (Unity) and Ubuntu-GNOME just display a blank screen, presumably because they require 3D compositing. Kubuntu works but is slow unless you turn off desktop effects under System Settings. Xubuntu and Lubuntu work fine out of the box.
参考网址:http://wiki.ros.org/kinetic/Installation/Ubuntu
ROS有很多发行版本,如下图所示。
最新的延长支持版是ROS Kinetic Kame,刚好可以用于Ubuntu 16.04LTS。网上比较多的是ROS Indigo Igloo + Ubuntu 14.04LTS组合。我这里用的是最新版Ubuntu16.04LTS + ROS Kinetic Kame组合。
Setup your computer to accept software from packages.ros.org.
设置资源命令是:
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://ha.pool.sks-keyservers.net:80 --recv-key421C365BD9FF1F717815A3895523BAEEB01FA116
If you experience issues connecting to the keyserver, you can try substitutinghkp://pgp.mit.edu:80
orhkp://keyserver.ubuntu.com:80
in the previous command.
First, make sure your Debian package index is up-to-date:
先更新Debian包索引,命令如下:
sudo apt-get update
安装包有很多种,这里推荐树莓派安装ROS-Base,集成了最基础的一些功能,需要其他功能的时候,后期可以在加安装。命令如下:
sudo apt-get install ros-kinetic-ros-base
Before you can use ROS, you will need to initialize rosdep. rosdep enables you to easily install system dependencies for source you want to compile and is required to run some core components in ROS.
初始化用下面两条命令:
sudo rosdep init
rosdep update
It’s convenient if the ROS environment variables are automatically added to your bash session every time a new shell is launched:
环境配置命令:
echo "source /opt/ros/kinetic/setup.bash" >> ~/.bashrc
source ~/.bashrc
Up to now you have installed what you need to run the core ROS packages. To create and manage your own ROS workspaces, there are various tools and requirements that are distributed separately. For example, rosinstall is a frequently used command-line tool that enables you to easily download many source trees for ROS packages with one command.
To install this tool and other dependencies for building ROS packages, run:
构建包的依赖项安装命令:
sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential
至此,树莓派Pi2安装ROS Kinetic Kame开发环境(基于Ubuntu 16.04LTS)成功。开始你的探索之旅吧!