qpython3安装turtle_Turtlebot3-ROS2入门教程-SBC安装

说明

介绍如何进行Turtlebot3-ROS2入门教程中的SBC安装

测试环境:树莓派 3B+ + Ubuntu Server 18.04.3

镜像安装

注意: 请勿安装最新的Ubuntu Server 18.04.4,其可能在使用过程中出现故障,请依照以下链接下载Ubuntu Server 18.04.3

网络配置

[TurtleBot] ubuntu 18.04 使用的是netplan方式配置网络

$ sudo touch /etc/netplan/01-netcfg.yaml

$ sudo vim /etc/netplan/01-netcfg.yaml

network:

version: 2

renderer: networkd

ethernets:

eth0:

dhcp4: yes

dhcp6: yes

optional: true

wifis:

wlan0:

dhcp4: yes

dhcp6: yes

access-points:

"wifi名称":

password: "wifi密码"

[TurtleBot] 固定IP设置示例

network:

version: 2

renderer: networkd

ethernets:

eth0:

dhcp4: no

dhcp6: no

addresses: [192.168.0.25/24]

gateway4: 192.168.0.1

nameservers:

addresses: [223.5.5.5, 8.8.8.8]

wifis:

wlan0:

dhcp4: no

dhcp6: no

addresses: [192.168.0.25/24]

gateway4: 192.168.0.1

nameservers:

addresses: [223.5.5.5, 8.8.8.8]

access-points:

ChuangKeZhiZao:

password: ChuangKeZhiZao

[TurtleBot] 应用修改好的设置后重启树莓派

$ sudo netplan apply

[TurtleBot] 避免网络延迟,禁止systemd进程

$ systemctl mask systemd-networkd-wait-online.service

[Remote PC] 测试使用ssh是否能连接上树莓派(在树莓派上执行ifconfig命令查看ip地址)

$ ssh ubuntu@

增加交换空间

[TurtleBot] 创建一个交换空间且赋予权限

$ sudo fallocate -l 1G /swapfile

$ sudo chmod 600 /swapfile

[TurtleBot] 使用mkswap命令设置Linux的交换空间

$ sudo mkswap /swapfile

[TurtleBot] 启用该交换空间

$ sudo swapon /swapfile

[TurtleBot] 设置开机挂载

$ sudo vim /etc/fstab

//将下面这句话添加到文件末

/swapfile swap swap defaults 0 0

[TurtleBot] 查看是否分配交换空间

$ sudo free -h

total used free shared buff/cache available

Mem: 912M 75M 254M 3.0M 582M 819M

Swap: 1.0G 35M 988M

安装ROS2 Dashing Diademata

[TurtleBot] 更新和升级软件

$ sudo apt update && sudo apt upgrade

[TurtleBot] 设置区域

$ sudo locale-gen en_US en_US.UTF-8

$ sudo update-locale LC_ALL = en_US.UTF-8 LANG = en_US.UTF-8

$ export LANG = en_US.UTF-8

[TurtleBot] 设置源

$ sudo apt update && sudo apt install curl gnupg2 lsb-release

$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -

$ sudo sh -c 'echo "deb [arch=amd64,arm64] http://packages.ros.org/ros2/ubuntu `lsb_release -cs` main" > /etc/apt/sources.list.d/ros2-latest.list'

[TurtleBot] 安装ROS2包

$ sudo apt update

$ sudo apt install ros-dashing-ros-base

[TurtleBot] 安装TurtleBot3包

$ sudo apt install python3-argcomplete python3-colcon-common-extensions libboost-system-dev

$ mkdir -p ~/turtlebot3_ws/src && cd ~/turtlebot3_ws/src

$ git clone -b ros2 https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git

$ git clone -b ros2 https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git

$ git clone -b ros2 https://github.com/ROBOTIS-GIT/turtlebot3.git

$ git clone -b ros2 https://github.com/ROBOTIS-GIT/DynamixelSDK.git

$ cd ~/turtlebot3_ws/src/turtlebot3

$ rm -r turtlebot3_cartographer turtlebot3_navigation2

$ cd ~/turtlebot3_ws/

$ source /opt/ros/dashing/setup.bash

$ colcon build --symlink-install --parallel-workers 1

[TurtleBot] 环境设置

$ echo 'source ~/turtlebot3_ws/install/setup.bash' >> ~/.bashrc

$ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc

$ source ~/.bashrc

在DDS通信中,远程PC和TurtleBot3之间的ROS_DOMAIN_ID必须要匹配上且需要两者都需要处于同一个网段下

[TurtleBot] 由于测试使用的是TurtleBot3-Buger,故配置模型的环境变量为burger

$ echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论

“相关推荐”对你有帮助么?

  • 非常没帮助
  • 没帮助
  • 一般
  • 有帮助
  • 非常有帮助
提交
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值