< >
Home » Turtlebot3-waffle-pi入门教程#noetic版# » Turtlebot3-waffle-pi入门教程#noetic版#-树莓派4安装

Turtlebot3-waffle-pi入门教程#noetic版#-树莓派4安装

Turtlebot3-burger入门教程#noetic版#-树莓派4安装

说明:

  • 本教程介绍如何在在树莓派4上安装对应的系统和软件
  • 测试环境: 树莓派4B 2G + Ubuntu MATE 20.04 + ROS Noetic Ninjemys

相关设备

前提说明

  • 对于在创客智造上购买的Noetic版系统的tb3是已经配置好系统,不需要重复安装

系统安装

增加交换空间

  • [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

安装ROS Noetic Ninjemys

  • [TurtleBot] apt 安装
# 设置源
$ sudo sh -c 'echo "deb http://packages.ros.org/ros/ubuntu $(lsb_release -sc) main" > /etc/apt/sources.list.d/ros-latest.list'
# 设置keys
$ sudo apt install curl # if you haven't already installed curl
$ curl -s https://raw.githubusercontent.com/ros/rosdistro/master/ros.asc | sudo apt-key add -
# 安装noetic
$ sudo apt update
$ sudo apt install ros-noetic-desktop-full
# 配置环境
$ echo "source /opt/ros/noetic/setup.bash" >> ~/.bashrc
$ source ~/.bashrc
# 安装相关依赖包
$ sudo apt install python3-rosdep python3-rosinstall python3-rosinstall-generator python3-wstool build-essential
# 初始化rosdep
$ sudo rosdep init
$ rosdep update

安装TurtleBot3及相关依赖包

  • [TurtleBot] 安装相关依赖包
$ sudo apt-get install ros-noetic-joy ros-noetic-teleop-twist-joy \
  ros-noetic-teleop-twist-keyboard ros-noetic-laser-proc \
  ros-noetic-rgbd-launch ros-noetic-rosserial-arduino \
  ros-noetic-rosserial-python ros-noetic-rosserial-client \
  ros-noetic-rosserial-msgs ros-noetic-amcl ros-noetic-map-server \
  ros-noetic-move-base ros-noetic-urdf ros-noetic-xacro \
  ros-noetic-compressed-image-transport ros-noetic-rqt* ros-noetic-rviz \
  ros-noetic-gmapping ros-noetic-navigation ros-noetic-interactive-markers \
  ros-noetic-slam-karto ros-noetic-hector-mapping 
  • [TurtleBot] 安装TurtleBot3包
$ mkdir -p ~/turtlebot3_ws/src
$ cd ~/turtlebot3_ws/src/
$ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/DynamixelSDK.git
$ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3_msgs.git
$ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/turtlebot3.git
$ git clone -b noetic-devel https://github.com/ROBOTIS-GIT/hls_lfcd_lds_driver.git
$ cd ~/turtlebot3_ws && catkin_make
$ echo "source ~/turtlebot3_ws/devel/setup.bash" >> ~/.bashrc
  • [TurtleBot] 安装LDS-02雷达包
$ sudo apt update
$ sudo apt install libudev-dev
$ cd ~/turtlebot3_ws/src
$ git clone -b develop https://github.com/ROBOTIS-GIT/ld08_driver.git
$ cd ~/catkin_ws/src/turtlebot3 && git pull
$ cd ~/turtlebot3_ws && catkin_make
  • USB设置(以下允许将USB端口用于没有root权限的OpenCR板)
$ rosrun turtlebot3_bringup create_udev_rules
  • [TurtleBot] 配置模型的环境变量
$ echo "export TURTLEBOT3_MODEL=burger" >> ~/.bashrc
$ echo 'export LDS_MODEL=LDS-02 #LDS-01 or LDS-02' >> ~/.bashrc
$ source ~/.bashrc

纠错,疑问,交流: 请进入讨论区点击加入Q群

获取最新文章: 扫一扫右上角的二维码加入“创客智造”公众号


标签: none