总览
本文旨在描述基于树莓派4和Ubuntu20.04Server上,完成ros的安装。目前发现了两种方法,具体描述如下文。
方法一:现有的desktop(未尝试)
麒麟系统网站: https://www.ubuntukylin.com/downloads/show.php?&lang=en
发现麒麟系统网站直接有树莓派4用的桌面镜像可以下载,估计是可以使用的,但还是使用Gnome桌面比较熟悉,虽然会比较折腾
方法二:使用Ubuntu20.04Server并安装Gnome桌面
一、安装Ubuntu20.04Server
https://ubuntu.com/tutorials/how-to-install-ubuntu-on-your-raspberry-pi#1-overview
1、配置wifi
-
查看IP相关信息
ip a -
配置WiFi相关设置
cd /etc/netplan -
编辑目录下的yaml文件
sudo nano 50-cloud-init.yaml
# This file is generated from information provided by the datasource. Changes
# to it will not persist across an instance reboot. To disable cloud-init's
# network configuration capabilities, write a file
# /etc/cloud/cloud.cfg.d/99-disable-network-config.cfg with the following:
# network: {config: disabled}
network:
wifis:
wlan0:
dhcp4: true
access-points:
"access-points-name":
password: "password"
ethernets:
eth0:
dhcp4: true
optional: true
version: 2
2、启动wifi
-
检查目录下该文件是否正确:
sudo netplan generate -
重启网络服务:
sudo netplan apply
二、换源
-
查看版本名称
sudo lsb_release -a -
使用清华源:
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal main restricted universe multiverse
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-updates main restricted universe multiverse
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-backports main restricted universe multiverse
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-security main restricted universe multiverse
deb https://mirror.tuna.tsinghua.edu.cn/ubuntu-ports/ focal-proposed main restricted universe multiverse
三、使用tasksel安装桌面Gnome
引用这篇文章:https://blog.csdn.net/sinat_32857543/article/details/103637868
按照如下步骤开展:
1、获取更新列表:sudo apt update
2、更新:sudo apt upgrade
3、安装tasksel:sudo apt-get install tasksel -y
4、使用tasksel安装桌面:
## 1 打开tasksel,进入UI系统
## 2 按空格键选择 Ubuntu desktop
## 3 按tab键跳转到ok按钮
sudo tasksel
5、耐心等待安装完成
四、安装ROS
http://wiki.ros.org/noetic/Installation/Ubuntu
1、使用上海交大ROS源
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.sjtug.sjtu.edu.cn/ros/ubuntu/ lsb_release -cs
main” > /etc/apt/sources.list.d/ros-latest.list’
2、设置公钥:
sudo apt-key adv --keyserver ‘hkp://keyserver.ubuntu.com:80’ --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
<TIP :如果失败,使用以下指令>:
curl -sSL ‘http://keyserver.ubuntu.com/pks/lookup?op=get&search=0xC1CF6E31E6BADE8868B172B4F42ED6FBAB17C654’ | sudo apt-key add -
3、安装ROS完整版本
sudo apt install ros-noetic-desktop-full