硬件要求:
树莓派4B、读卡器、16G以上的SD卡、HDMI线、显示器、电源、网线、USB的鼠标和键盘
软件工具:
a. SD Card Formatter
b. balenaetcher
树莓派ubuntu 18.04.4 64位镜像系统链接:
ubuntu18.04官方下载地址
用官方推荐的SD Card Formatter 下载地址:https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip
虽然软件一般可以自动识别sd卡,但也要注意不要格式化其他内存了
我用的是balenaetcher
外网不行的用这个
链接:https://pan.baidu.com/s/1d7ReWzv0VrZnWuWueEZvRA
提取码:uma3
开始的默认名称和密码都是 ubuntu ,需要修改密码(看好英文提示,是先登录,再输入当前密码ubuntu,然后才是更改为自己设定的密码)
首先要换源,为后面下载各种软件做好网速准备,要不然下载会贼慢。编辑 apt 源文件,更新为国内镜像源(注意:路径节点不是 ubuntu,而是 ubuntu-ports, 好像类似树莓派这种嵌入式需要的是ubuntu-ports版)
打开软件源文件:
sudo vim /etc/apt/sources.list
想要更换不同的源可以参考链接:
Ubuntu–更换软件源
本系统使用的是阿里云源:
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-security main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-updates main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-backports main restricted universe multiverse
deb https://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
deb-src https://mirrors.aliyun.com/ubuntu-ports/ bionic-proposed main restricted universe multiverse
bionic 为Ubuntu18.04的版本代号, xenial 为Ubuntu16.04的版本代号,根据不同系统可以更改相应版本代号
更新软件源:
sudo apt update
sudo apt-get install xubuntu-desktop
网速快的话,大半个小时即可安装完。
重启系统后就可以看到桌面了
sudo reboot
和在笔记本上安装ROS一样
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://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
sudo apt-get update
sudo apt-get install ros-melodic-desktop
可以安装桌面完整版:sudo apt-get install ros-melodic-desktop-full
sudo rosdep init
rosdep update
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
sudo apt install python-rosinstall python-rosinstall-generator python-wstool build-essential
roscore
没问题即安装成功。
/var/lib/dpkg/lock-frontend - open
Unmet dependencies和apt --fix-broken install问题
ROS: sudo rosdep init出错常规方法都无效后解决办法
E: Sub-process /usr/bin/dpkg returned an error code (1)解决办法
参考资料:
树莓派4B安装ubuntu18.04.4和ROS并测试激光雷达