开放下载连接
链接:https://pan.baidu.com/s/1jcKFJtuA_TpvbPueiq55Nw
提取码:cang
1.准备工作
1)环境: 树莓派4b 8GB arm64 平台硬件
2)下载官方 2022-04-04-raspios-bullseye-arm64.img.xz 镜像
3)烧录镜像至TF卡32GB上
2.系统构建
1)将烧录完的tf卡中的boot盘中的文件进行修改
windows cmd:
打开TF卡,文件boot 目录下建立文件
G:>type nul>ssh G:>>>wpa_supplicant.conf set /p="country=CN 注意指令前的”G:>“ 系统自带字符 然后用notepad打开wpa_supplicant.conf 查看下文件,注意换行符 然后将TF卡插到树莓派上,开机启动。 后执行 G:>arp -a 接口: 192.168.193.137 — 0x13 192.168.193.239 树莓派 地址 2)ssh树莓派登陆 用户名:pi 密码:raspberry 3.正式动作 $ mkdir -p ~/ros2_rolling/src $ cd ~/ros2_rolling 1)系统信息 pi@raspberrypi:~/ros2_rolling $ uname -a 2)ros2 环境构建 $ locale $ apt-cache policy | grep universe 此处信息不必对照官网 $ vi /etc/apt/sources.list aarch64 用户:编辑 $ sudo apt update $ sudo apt install software-properties-common $ sudo apt update && sudo apt install curl gnupg lsb-release $ echo “deb [arch=$(dpkg --print-architecture) signed-by=/usr/share/keyrings/ros-archive-keyring.gpg] http://mirrors.tuna.tsinghua.edu.cn/ros2/ubuntu/ $ sudo apt update && sudo apt install -y (this command can altenative by below : $ sudo apt update && sudo apt install -y $ pip install -i https://pypi.tuna.tsinghua.edu.cn/simple \ flake8-blind-except \ flake8-builtins \ flake8-class-newline \ flake8-comprehensions \ flake8-deprecated \ flake8-docstrings \ flake8-import-order \ flake8-quotes \ pytest-repeat ) $ sudo rosdep init (please copy pre-downloade rosdistro/ into ~/) $ sudo vi /home/pi/rosdistro/rosdep/sources.list.d/20-default.list { # os-specific listings first yaml file:///home/pi/rosdistro/rosdep/osx-homebrew.yaml osx # generic yaml file:///home/pi/rosdistro/rosdep/base.yaml yaml file:///home/pi/rosdistro/rosdep/python.yaml yaml file:///home/pi/rosdistro/rosdep/ruby.yaml gbpdistro file:///home/pi/rosdistro/releases/fuerte.yaml fuerte # newer distributions (Groovy, Hydro, …) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead } { # os-specific listings first yaml file:///home/pi/rosdistro/rosdep/osx-homebrew.yaml osx # generic yaml file:///home/pi/rosdistro/rosdep/base.yaml yaml file:///home/pi/rosdistro/rosdep/python.yaml yaml file:///home/pi/rosdistro/rosdep/ruby.yaml gbpdistro file:///home/pi/rosdistro/releases/fuerte.yaml fuerte # newer distributions (Groovy, Hydro, …) must not be listed anymore, they are being fetched from the rosdistro index.yaml instead } $ rosdep update $ wget https://raw.githubusercontent.com/ros2/ros2/rolling/ros2.repos {windows shell > vcs import --input ros2.rpos src here, you can pre-download ros2 rolling package into src/ pi@raspberrypi:~/ros2_rolling $ ls src ament eclipse-iceoryx ignition ros ros-perception ros-tooling sllidar_ros2 eclipse-cyclonedds eProsima osrf ros2 ros-planning ros-visualization pi@raspberrypi:~/ros2_rolling $ } rosdep install --from-paths src --ignore-src -y --skip-keys “ignition-cmake2 ignition-math6 fastcdr rti-connext-dds-6.0.1 urdfdom_headers” it will trigger warnning #ignition-cmake2 ignition-math6 can’t support os debian , ok then skip it ) $ rosdep install --from-paths src --ignore-src -y --skip-keys “ignition-cmake2 ignition-math6 fastcdr rti-connext-dds-6.0.1 urdfdom_headers” { it will be trgger some error ,so you install it manuelly, then excute it continue. after a long time … } (please keep connectting net fluently and your patient for a long long time if you can’t , you can donwnload some pakage into build/ souce , bless you ) … { $ colcon build --packages-select sllidar_ros2 (build special package) } first terminal $ . ~/ros2_rolling/install/local_setup.bash second terminal $ . ~/ros2_rolling/install/local_setup.bash ![在这里插入图片描述](https://img-blog.csdnimg.cn/fe4d988bed264bae968f7dde575aba0b.png then you can excute talker on raspberry 4b board and excute listener on a ubuntu host terminal of course you must be in a same real net
G:>>>userconf set /p=“pi: 6 6 6KORC/Q.jy9sfO4dY$Ng2/O021CmodjQ99aPm.kpG4s1ClxvfQN0UylymYN/AYGySUBV6mnPlLDD24YrckXldGR9ZWO3NvOazzNLhBe1”
ctrl_interface=DIR=/var/run/wpa_supplicant GROUP=netdev
update_config=1
"
Internet 地址 物理地址 类型
192.168.193.1 d4-ee-07-62-f5-76 动态
192.168.193.239 e4-5f-01-c2-98-51 动态
192.168.193.255 ff-ff-ff-ff-ff-ff 静态
Linux raspberrypi 5.15.32-v8+ #1538 SMP PREEMPT Thu Mar 31 19:40:39 BST 2022 aarch64 GNU/Linux
pi@raspberrypi:~/ros2_rolling $ lsb_release
No LSB modules are available.
pi@raspberrypi:~/ros2_rolling $ lsb_release -a
No LSB modules are available.
Distributor ID: Debian
Description: Debian GNU/Linux 11 (bullseye)
Release: 11
Codename: bullseye
pi@raspberrypi:~/ros2_rolling $
LANG=en_GB.UTF-8
LANGUAGE=
LC_CTYPE=“en_GB.UTF-8”
LC_NUMERIC=“en_GB.UTF-8”
LC_TIME=“en_GB.UTF-8”
LC_COLLATE=“en_GB.UTF-8”
LC_MONETARY=“en_GB.UTF-8”
LC_MESSAGES=“en_GB.UTF-8”
LC_PAPER=“en_GB.UTF-8”
LC_NAME=“en_GB.UTF-8”
LC_ADDRESS=“en_GB.UTF-8”
LC_TELEPHONE=“en_GB.UTF-8”
LC_MEASUREMENT=“en_GB.UTF-8”
LC_IDENTIFICATION=“en_GB.UTF-8”
LC_ALL=/etc/apt/sources.list
文件,用以下内容取代:
默认注释了源码镜像以提高 apt update 速度,如有需要可自行取消注释
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-updates main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian/ bullseye-backports main contrib non-free
deb https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
deb-src https://mirrors.tuna.tsinghua.edu.cn/debian-security bullseye-security main contrib non-free
$ sudo apt upgrade
$ sudo curl -sSL https://raw.githubusercontent.com/ros/rosdistro/master/ros.key -o /usr/share/keyrings/ros-archive-keyring.gpglsb_release -cs
main” | sudo tee /etc/apt/sources.list.d/ros2.list > /dev/null
build-essential
cmake
git
python3-colcon-common-extensions
python3-flake8
python3-flake8-blind-except
python3-flake8-builtins
python3-flake8-class-newline
python3-flake8-comprehensions
python3-flake8-deprecated
python3-flake8-docstrings
python3-flake8-import-order
python3-flake8-quotes
python3-pip
python3-pytest
python3-pytest-cov
python3-pytest-repeat
python3-pytest-rerunfailures
python3-rosdep
python3-setuptools
python3-vcstool
wget
build-essential
cmake
git
python3-colcon-common-extensions
python3-flake8
python3-pip
python3-pytest
python3-pytest-cov
python3-pytest-rerunfailures
python3-rosdep
python3-setuptools
python3-vcstool
wget
$ sudo vi /etc/ros/rosdep/sources.list.d/20-default.list
$ sudo vi /usr/lib/python3/dist-packages/rosdep2/sources_list.py
DEFAULT_SOURCES_LIST_URL = ‘file:///home/pi/rosdistro/rosdep/sources.list.d/20-default.list’
$ sudo vi /usr/lib/python3/dist-packages/rosdistro/init.py
DEFAULT_INDEX_URL = ‘file:///home/pi/rosdistro/index-v4.yaml’
$ sudo vi /usr/lib/python3/dist-packages/rosdep2/rep3.py
REP3_TARGETS_URL = ‘file:///home/pi/rosdistro/releases/targets.yaml’
$ vcs import src < ros2.repos
(try below command ,
$ cd ~/ros2_rolling/
$ colcon build --symlink-install
test ros2 rolling envirenment
ros2 run demo_nodes_cpp talker
ros2 run demo_nodes_py listener
链接:https://pan.baidu.com/s/1R85CzTHAsiTDbZ4UIW0cnw
提取码:loon