admin管理员组

文章数量:1578661

树莓派装ros1

      • 0.起因
      • 1.装系统
        • 1.1 下载镜像
        • 1.2 烧录系统
          • 1.2.1. 格式化sd卡
          • 1.2.2 烧录镜像到sd卡
      • 2.环境配置
        • 2.1修改软件源,原来的太慢了
        • 2.2 开启vnc 和ssh
      • 3 安装ros
      • 4.编包
        • 4.1 创建工作空间
        • 4.1 添加环境变量
        • 4.2 下载源码, 编译
        • 4.3 解决环境变量问题
        • 4.4 运行
      • 5. 环境变量问题,深究下

0.起因

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

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

下面过程记录

1.装系统


这个卖家买的16G的内存卡里自带的ubuntuMATE,不是raspbian,先不格式化,换张卡

1.1 下载镜像

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

1.2 烧录系统
1.2.1. 格式化sd卡

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

选是

搞定

1.2.2 烧录镜像到sd卡

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

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


flash

成了,插上树莓派,启动

2.环境配置

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

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

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

CONTINENTCOUNTRYMIRRORDEB/DEB-SRC ADDRESSISSUES
AsiaChinaTsinghua University Network Administratorshttp://mirrors.tuna.tsinghua.edu/raspbian/raspbian/
AsiaChinaDalian Neusoft University of Informationhttp://mirrors.neusoft.edu/raspbian/raspbian
AsiaChinaCohesion Network Security Studio (CNSS)http://raspbianssuestc/raspbian/ rsync://raspbianssuestc/raspbianunresolvable as of 2019-04-19
AsiaChinaUnique Studio of Huazhong University of Science and Technology(http|rsync) : //mirrors.hustunique/raspbian/raspbian
AsiaChinaUniversity of Science and Technology of China(http|rsync) : //mirrors.ustc.edu/raspbian/raspbian/
AsiaChinaSUN YAT-SEN Universityhttp://mirror.sysu.edu/raspbian/unresolvable as of 2019-05-25
Asia*ChinaZhejiang Universityhttp://mirrors.zju.edu/raspbian/raspbian/
Asia*ChinaOpen Source Software Association of Chinese Academy of Scienceshttp://mirrors.opencas/raspbian/raspbian/Currently ipv6 only, unresponive as-of 2019-04-19
AsiaChinaChongqing University(http|https) : //mirrors.cqu.edu/raspbian/raspbian/
AsiaChinaShanghai University Open Source Community(http|ftp|rsync) : //mirrors.shu.edu/raspbian/raspbian/
Asia*ChinaNanjing University(http|https) : //mirrors.nju.edu/raspbian/raspbian/

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

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

sudo vim /etc/apt/sources.list

改成这个样子

deb http://mirrors.ustc.edu/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/raspbian/ buster main contrib non-free rpi

改系统源:

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

改成这样

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

更新升级

sudo apt-get update && sudo apt-get upgrade
2.2 开启vnc 和ssh


3 安装ros

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

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

下面这个地址里面所偶的包你都可以通过软件管理工具安装,例如apt
https://packages.debian/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/jinmenglei/aoa_ros.git
cd aoa_ros/
git checkout ros1

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

cd ~/catkin_ws/src/
git clone https://github/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/article/details/105039786

本文标签: 镜像极速官方树莓派