整体思路如下 树莓派4b安装ubuntu 18.05 -> 连接有线网 -> xshell,ssh连接 -> 更换阿里云 ->ros.wiki上的教程安装 ->第一个包的安装
推荐使用ubuntu官方下载链接,按照自己的型号选择相应的版本即可,3b/3b+的mate 格式镜像自己试了,好像不能按照在4b上。
推荐使用etcher将镜像烧录至内存卡(至少16GB),官方下载链接
由于该镜像很轻巧,要安装很多包,首要解决的问题就是联网(wifi连接较麻烦),之后在用xshell,ssh连接
shh连接前必须确保树莓派连接上网络。(或者与电脑在同一路由下)
镜像的登录名与密码,ubuntu/ubuntu连接有线,直接192.168.1.1登录寝室的路由器查看ip,接显示屏ifconfig -a查看。之后用xshell连接即可可以参考上一篇博客Ubuntu 18.04 mate 换源
sudo sh -c ‘. /etc/lsb-release && echo “deb http://mirrors.ustc.edu.cn/ros/ubuntu/ lsb_release -cs main” > /etc/apt/sources.list.d/ros-latest.list’
添加公钥sudo apt-key adv --keyserver ‘hkp://keyserver.ubuntu.com:80’ --recv-key C1CF6E31E6BADE8868B172B4F42ED6FBAB17C654
安装 更新索引sudo apt updatesudo apt install ros-melodic-desktop-full
初始化 rosdepsudo apt-get install python-rosdep
sudo rosdep init rosdep update如果出错,可以参考ERROR: cannot download default sources list from:
设置环境 echo "source /opt/ros/melodic/setup.bash" >> ~/.bashrc echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc source ~/.bashrc 构建工厂依赖sudo apt-get install python-rosinstall python-rosinstall-generator python-wstool build-essential