Ubuntu树莓派Mate的配置过程
安装
首先从官网下载Ubuntu Mate的镜像.img,然后使用工具(比如Balena Etcher)将镜像烧录到树莓派的SD卡中,接着启动就可以了。
打开Ubuntu Mate,启动终端。
0.设置WIFI
https://blog.csdn.net/hhaowang/article/details/90700094
1.换源
sudo nano /etc/apt/sources.list
将每个 http://ports.ubuntu.com/ 都替换为 http://mirrors.ustc.edu.cn/ubuntu-ports/
然后sudo apt update
2.安装ros
https://wiki.ros.org/melodic/Installation/Ubuntu
1.在“Ubuntu软件”中设置允许"restricted," "universe," 和 "multiverse."
2.添加ROS软件源
sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
3.设置公钥
sudo apt-key adv --keyserver 'hkp://keyserver.ubuntu.com:80' --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
4.更新
sudo apt update
5.安装(树莓派性能太低,无需安装GUI)
sudo apt install ros-melodic-ros-base
6.配置环境变量
echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc
source ~/.bashrc
7.安装构建依赖包
sudo apt install python-rosdep python-rosinstall python-rosinstall-generator python-wstool build-essential
8.初始化ROS
sudo apt install python-rosdep
sudo rosdep init
rosdep update
3.设置SSH
3.1 raspi-config
3.2 选择第三项,进入打开SSH,设置完成后退出。
sudo apt-get install openssh-server
ssh程序分为客户端程序openssh-client和服务端程序openssh-server。如果需要ssh登陆到别的电脑,需要安装openssh-client,该程序ubuntu是默认安装的。而如果需要从远程连接到本机,则需要安装openssh-server,该程序需要自己安装。
相关命令:
查看openssh-server是否启动
ps -e | grep ssh
启动、停止和重启openssh-server的命令
/etc/init.d/ssh start
/etc/init.d/ssh stop
/etc/init.d/ssh restart
openssh-server配置文件位于/etc/ssh/sshd_config,在这里可以配置ssh的服务端口等,例如:默认端口是22,可以自定义为其他端口号,如123,然后需要重启ssh服务。
4.安装远程界面登录
sudo apt install xrdp
sudo systemctl enable ssh
sudo systemctl start ssh
5. scp
scp 就是 secure copy,是一个在Linux 下用来进行 远程拷贝文件 的命令。它的地址格式与 ssh 基本相同,需要注意的是,在指定端口时用的是大写的 -P 而不是小写的(唯一的不同点)。
把本地当前目录下的 01.py 文件 复制到 远程 家目录下的 Desktop/01.py,注意:: 后面的路径如果不是绝对路径,则以用户的家目录作为参照路径
scp -P port 01.py user@remote:Desktop/01.py
把远程 家目录下的 Desktop/01.py 文件 复制到 本地当前目录下的 01.py
scp -P port user@remote:Desktop/01.py 01.py
把当前目录下的 demo 文件夹 复制到 远程 家目录下的 Desktop,加上 -r 选项可以传送文件夹
scp -r demo user@remote:Desktop
把远程 家目录下的 Desktop 复制到 当前目录下的 demo 文件夹
scp -r user@remote:Desktop demo