ROS与duckietbot指南-树莓派系统安装
ROS与duckietbot指南-树莓派系统安装
说明:
- 介绍树莓派系统烧录以及相应的软件安装
系统安装:
- 系统镜像地址:https://ubuntu-mate.org/download/
- 下载对应镜像:
filename: ubuntu-mate-16.04.2-desktop-armhf-raspberry-pi.img.xz
size: 1.2 GB
SHA256: dc3afcad68a5de3ba683dc30d2093a3b5b3cd6b2c16c0b5de8d50fede78f75c2
系统配置:
- 接入显示屏,鼠标,键盘
- 启动树莓派3安装,配置如下内容:
language: English
username: ubuntu
password: ubuntu
hostname: duckiebot
软件更新和配置
- 软件更新
$ sudo apt update
$ sudo apt dist-upgrade
- 树莓派配置:
$ sudo raspi-config
- 选择3. Interfacing Options,激活SSH,camera和I2C.
- 选择2. Boot Options , startup. –>B1 启用文本终端
安装软件包:
- 安装etckeeper
$ sudo apt install etckeeper
- 安装编辑器
$ sudo apt install -y vim emacs byobu zsh
- 安装GIT
$ sudo apt install -y git git-extras
- 其他:
$ sudo apt install htop atop nethogs iftop
$ sudo apt install aptitude apt-file
- 对于开发
$ sudo apt install -y build-essential libblas-dev liblapack-dev libatlas-base-dev gfortran libyaml-cpp-dev raspberrypi-kernel-headers
- 安装python
$ sudo apt install -y python-dev ipython python-sklearn python-smbus
$ sudo apt install -y python-termcolor
$ sudo apt install python-frozendict
$ sudo apt install python-tables
$ pip install comptests
$ pip install procgraph
$ sudo pip install scipy --upgrade
$ sudo pip install ruamel.yaml --upgrade
- scipy –upgrade(0.19.1) 更新很慢,大概要1个小时
- 安装I2C
$ sudo apt install -y i2c-tools
- 安装Edimax驱动
- 首先设置内核不可更改
$ sudo apt-mark hold raspberrypi-kernel raspberrypi-kernel-headers
raspberrypi-kernel set on hold.
raspberrypi-kernel-headers set on hold
- 安装Edimax
$ git clone git@github.com:duckietown/rtl8822bu.git
$ cd rtl8822bu
$ make
$ sudo make install
安装ROS,参考树莓派3源码安装ROS
可通过界面或终端,配置wifi
启动SSH
$ sudo systemctl enable ssh
- 创建swap空间
$ sudo dd if=/dev/zero of=/swap0 bs=1M count=512
$ sudo mkswap /swap0
$ sudo vim /etc/fstab
- 增加内容
/swap0 swap swap
- 启用swap
$ sudo swapon -a
无密码sudo
- 指定编辑器:
$ sudo update-alternatives --config editor
- 选择vim.basic
- 运行
$ sudo visudo
- 修改
%sudo ALL=(ALL:ALL) ALL
为%sudo ALL=(ALL:ALL) NOPASSWD:ALL
清除不必要的软件包:
- 安装查找大文件工具
$ sudo apt install wajig debian-goodies
- 查找大文件
$ wajig large
$ dpigs -H -n 20
- 清除
$ sudo apt remove thunderbird
$ sudo apt remove libreoffice-\*
$ sudo apt remove openjdk-8-jre-headless
$ sudo apt remove fonts-noto-cjk
$ sudo apt remove brasero
- 删除额外依赖
$ sudo apt autoremove
- 删除缓存
$ sudo apt clean
Ubuntu用户配置:
- 给ubuntu用户增加组
$ sudo adduser ubuntu i2c
$ sudo adduser ubuntu input
$ sudo adduser ubuntu video
- 激活使用
$ sudo udevadm trigger
- 无密码登录ssh
- 添加如下内容到
~ubuntu/.bashrc
,增加登录提示:
echo ""
echo "Welcome to a duckiebot!"
echo ""
echo "Reminders:"
echo ""
echo "1) Do not use the user 'ubuntu' for development - create your own user."
echo "2) Change the name of the robot from 'duckiebot' to something else."
echo ""
export EDITOR=vim
创建自定义镜像:
参考:
- http://book.duckietown.org/master/duckiebook/duckiebot_ubuntu_image.html#sec:duckiebot-ubuntu-image
获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号