如何在Raspberry Pi 3B上使用Raspbian编译ROS?
这里用的树莓派官方原版系统(raspbian-jessie),ROS Kinetic Kame。工作机为 Windows。
【系统安装】
1、下载 raspbian 并解压出 img 文件。
2、用 SDFormatter 格式化 sd 卡。
3、用 Win32 Disk Imager 将 img 写入 sd 卡。
【ssh连接】
1、编辑 sd 卡里面的 cmdline.txt 文件,在最前面添加字符串 ip=192.168.77.88 。(注意后面有个空格)
2、在 sd 卡里面添加一个名为 ssh 的空白文件。
3、将 sd 卡插入树莓派板子并通电,树莓派与 PC 用网线直连即可。
4、然后就可以通过 ssh 192.168.77.88 连接 raspbian 系统了。
5、注意要 Windows 与 raspbian 应为同一个网段。
6、初始账号为 pi,密码为 raspbarry。
7、至此,实现了无屏幕 ssh 连接。
【wifi连接】
1、编辑 /etc/wpa_supplicant/wpa_supplicant.conf 文件。添加:
1
2
3
4
5
|
network={
ssid="WiFi-name"
psk="WiFi-password"
priority=5
}
|
2、重启无线网卡。
1
2
|
sudo
ifdown wlan0
sudo
ifup wlan0
|
注意与 ifconfig wlan0 up/down 的区别。
3、iwlist scanning 命令可以扫描无线网,iwconfig 查看无线网卡状态。
4、更多信息:树莓派连接WiFi
【更改 raspbian 软件源】
本节内容依据官方文档。
1、编辑 /etc/apt/sources.list 文件,注释掉里面所有内容,然后添加中科大软件源:
1
|
deb http:
//mirrors
.ustc.edu.cn
/raspbian/raspbian/
jessie main contrib non-
free
rpi
|
2、执行以下命令。
1
2
|
sudo
apt update
sudo
apt upgrade
|
3、由于 /etc/apt/sources.list.d/raspi.list 文件里面的 ui 库,国内源并没有,所以不建议替换 raspi.list 里面内容。
1
2
3
|
deb http:
/
/
archive.raspberrypi.org
/
debian
/
jessie main ui
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ jessie main ui
|
【编译安装 ROS Kinetic】
本节内容依据官方文档。
1、添加 ros 仓库,并update。
1
2
3
4
5
6
|
sudo
sh -c
'echo "deb http://mirrors.ustc.edu.cn/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-key 421C365BD9FF1F717815A3895523BAEEB01FA116
# or
sudo
apt-key adv --keyserver hkp:
//keyserver
.ubuntu.com:80 --recv-key 421C365BD9FF1F717815A3895523BAEEB01FA116
sudo
apt update
sudo
apt upgrade
|
2、安装 Bootstrap 依赖。
1
|
sudo
apt
install
-y python-rosdep python-rosinstall-generator python-wstool python-rosinstall build-essential cmake
|
3、初始化 rosdep。
1
2
|
sudo
rosdep init
rosdep update
|
4、创建 catkin workspace。
1
2
3
4
|
mkdir
-p ~
/ros_catkin_ws
cd
~
/ros_catkin_ws
rosinstall_generator ros_comm --rosdistro kinetic --deps --wet-only --
tar
> kinetic-ros_comm-wet.rosinstall
wstool init src kinetic-ros_comm-wet.rosinstall
|
5、又是依赖。
1
2
3
4
5
6
7
上一篇: OpenGL入门:模型导入教程 下一篇: 安卓环境下Assimp库的编译与使用指南 |