< >
Home » Dashing版Turtlebot3-burger入门教程 » Turtlebot3-ROS2入门教程-PC安装(ubuntu20.04+foxy)

Turtlebot3-ROS2入门教程-PC安装(ubuntu20.04+foxy)

Turtlebot3-ROS2入门教程-PC安装(ubuntu20.04+foxy)

说明:

  • 介绍如何在ubuntu20.04上安装turtlebot3
  • 环境:ubuntu20.04 + ros2 foxy + turtlebot3

相关设备:

步骤:

  • 安装依赖
# Install Colcon
$ sudo apt install python3-colcon-common-extensions
# Install Cartographer dependencies
$ sudo apt install -y \
    google-mock \
    libceres-dev \
    liblua5.3-dev \
    libboost-dev \
    libboost-iostreams-dev \
    libprotobuf-dev \
    protobuf-compiler \
    libcairo2-dev \
    libpcl-dev \
    python3-sphinx
# Install Gazebo9
$ curl -sSL http://get.gazebosim.org | sh
$ sudo apt install ros-foxy-gazebo-*
# Install Cartographer
$ sudo apt install ros-foxy-cartographer
$ sudo apt install ros-foxy-cartographer-ros
# Install Navigation2
$ sudo apt install ros-foxy-navigation2
$ sudo apt install ros-foxy-nav2-bringup
# Install vcstool
$ sudo apt install python3-vcstool
  • 安装TurtleBot3 ROS2包
#加载apt包环境
$ . /opt/ros/foxy/setup.bash          
#加载ros2源码安装环境
$ . ~/ros2/install/local_setup.bash       
$ mkdir -p ~/tb3_ws2/src
$ cd ~/tb3_ws2
$ wget https://raw.githubusercontent.com/ROBOTIS-GIT/turtlebot3/ros2/turtlebot3.repos
$ vcs import src < turtlebot3.repos
$ colcon build --symlink-install --merge-install #合并工作空间
  • 配置环境
$ echo 'source ~/tb3_ws2/install/setup.bash' >> ~/.bashrc
$ echo 'export ROS_DOMAIN_ID=30 #TURTLEBOT3' >> ~/.bashrc
$ source ~/.bashrc
  • 配置机器人类型
$ echo 'export TURTLEBOT3_MODEL=burger' >> ~/.bashrc
  • 设置udev规则
$ cd ~/tb3_ws2/src/turtlebot3/turtlebot3_bringup 
$ sudo cp ./99-turtlebot3-cdc.rules /etc/udev/rules.d/ 
$ sudo udevadm control --reload-rules 
$ sudo udevadm trigger

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

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


标签: turtlebot3-ros2入门教程