树莓派3B+ 官方镜像装ROS1 极速版

0.起因

就是因为下图这个说自己搞了18个小时,惊到我了,我决定试试,决定从装系统开始试试

实际从拿到树莓派到编译过自己的包运行成功,花了6个小时不到。。。中间包括刷两次碗,吃了顿饭,哄娃睡觉

下面过程记录
在这里插入图片描述

1.装系统

在这里插入图片描述
这个卖家买的16G的内存卡里自带的ubuntuMATE,不是raspbian,先不格式化,换张卡

1.1 下载镜像

官方地址:http://downloads.raspberrypi.org/raspbian/images/raspbian-2020-02-14/2020-02-13-raspbian-buster.zip
用迅雷下载吧,很快的
下载之后解压

在这里插入图片描述

1.2 烧录系统

1.2.1. 格式化sd卡

用官方推荐的SD Card Formatter 下载地址:https://www.sdcard.org/downloads/formatter/eula_windows/SDCardFormatterv5_WinEN.zip

在这里插入图片描述

选是
在这里插入图片描述

搞定

在这里插入图片描述

1.2.2 烧录镜像到sd卡

我用的是balenaetcher
下载地址:地址太长了

外网不行的用这个
链接:https://pan.baidu.com/s/1d7ReWzv0VrZnWuWueEZvRA
提取码:uma3

在这里插入图片描述
flash
在这里插入图片描述

成了,插上树莓派,启动

2.环境配置

工欲善其事必先利其器
主要是第一次开机的配置,源修改,开启ssh和vnc,装个vim
第一次配置个人喜好来

2.1修改软件源,原来的太慢了

软件源:这有个地址http://www.raspbian.org/RaspbianMirrors

CONTINENT COUNTRY MIRROR DEB/DEB-SRC ADDRESS ISSUES
Asia China Tsinghua University Network Administrators http://mirrors.tuna.tsinghua.edu.cn/raspbian/raspbian/
Asia China Dalian Neusoft University of Information http://mirrors.neusoft.edu.cn/raspbian/raspbian
Asia China Cohesion Network Security Studio (CNSS) http://raspbian.cnssuestc.org/raspbian/ rsync://raspbian.cnssuestc.org/raspbian unresolvable as of 2019-04-19
Asia China Unique Studio of Huazhong University of Science and Technology (http|rsync) : //mirrors.hustunique.com/raspbian/raspbian
Asia China University of Science and Technology of China (http|rsync) : //mirrors.ustc.edu.cn/raspbian/raspbian/
Asia China SUN YAT-SEN University http://mirror.sysu.edu.cn/raspbian/ unresolvable as of 2019-05-25
Asia* China Zhejiang University http://mirrors.zju.edu.cn/raspbian/raspbian/
Asia* China Open Source Software Association of Chinese Academy of Sciences http://mirrors.opencas.cn/raspbian/raspbian/ Currently ipv6 only, unresponive as-of 2019-04-19
Asia China Chongqing University (http|https) : //mirrors.cqu.edu.cn/raspbian/raspbian/
Asia China Shanghai University Open Source Community (http|ftp|rsync) : //mirrors.shu.edu.cn/raspbian/raspbian/
Asia* China Nanjing University (http|https) : //mirrors.nju.edu.cn/raspbian/raspbian/

上面有的源的地址多了空格

我用中科大的
先改软件源:

sudo vim /etc/apt/sources.list

改成这个样子

deb http://mirrors.ustc.edu.cn/raspbian/raspbian/ buster main contrib non-free rpi
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://raspbian.raspberrypi.org/raspbian/ buster main contrib non-free rpi

改系统源:

sudo vim /etc/apt/sources.list.d/raspi.list

改成这样

deb  http://mirrors.ustc.edu.cn/archive.raspberrypi.org/debian/  buster main
# Uncomment line below then 'apt-get update' to enable 'apt-get source'
#deb-src http://archive.raspberrypi.org/debian/ buster main

更新升级

sudo apt-get update && sudo apt-get upgrade

2.2 开启vnc 和ssh

在这里插入图片描述
在这里插入图片描述

3 安装ros

其实我是敲命令的时候联想出来的

在这里插入图片描述

这些是可以安装的,我去到官网看看,详细了解下
respbian 是debian,瞅瞅看
https://www.debian.org/

下面这个地址里面所偶的包你都可以通过软件管理工具安装,例如apt
https://packages.debian.org/stable/allpackages?format=txt.gz

在这里插入图片描述

大概就这个么多

我装个ros-desktop-full

6分钟搞定

测试下
在这里插入图片描述
装了这些包

测试下版本
在这里插入图片描述
启动
在这里插入图片描述
在这里插入图片描述

安装的包
在这里插入图片描述
在这里插入图片描述
命令和包都装在系统的路径下,不用source 也可以执行,rviz 也ok

在这里插入图片描述

4.编包

这个里面没有小乌龟,用个自己的包测试下,或者用官方的talk listen的demo也行

4.1 创建工作空间

mkdir -p ~/catkin_ws/src
cd ~/catkin_ws/
catkin_make

4.1 添加环境变量

 echo "source ~/catkin_ws/devel/setup.bash" >> ~/.bashrc
 source ~/.bashrc

4.2 下载源码, 编译

我用我gihub上uwb aoa 的驱动代码,串口,选择ros1 分支

cd ~/catkin_ws/src/
git clone https://github.com/jinmenglei/aoa_ros.git
cd aoa_ros/
git checkout ros1

下载
ros-kinetic-serial的源码编译下

cd ~/catkin_ws/src/
git clone https://github.com/wjwwood/serial.git

编译

cd ~/catkin_ws
catkin_make

在这里插入图片描述
在这里插入图片描述

出问题了,找不到包,解决环境变量问题

4.3 解决环境变量问题

这个问题耽误的时间最长

source 路径没错,研究下setup.sh,设置的是编译信息

在这里插入图片描述

env 下也没有
看看我的虚拟机
在这里插入图片描述

全乎的
看下装的包
在这里插入图片描述

有个ros-environment
我也去装一下
再source 一下就出来了

在这里插入图片描述

4.4 运行

串口改名

sudo ./creat_aoa_ros_udev.sh

插上家伙什

运行
在这里插入图片描述

在这里插入图片描述

5. 环境变量问题,深究下

请看下篇博客,卸载一个里面字数太多了
传送门https://mengleil.blog.csdn.net/article/details/105039786

发布了75 篇原创文章 · 获赞 22 · 访问量 1万+

猜你喜欢

转载自blog.csdn.net/weixin_36628778/article/details/105031287