LoginSignup
3
0

More than 1 year has passed since last update.

Turtlebot3 でSlamしながらNavigation2する方法

Posted at

はじめに

Navigation2では、Slam_toolboxが標準のSlamのPackageとなっていますが、Turtlebot3のマニュアル内では、Slamのツールとして、Cartographerが利用されており、Navigation2を勉強するにあたっての、混乱の原因になっているのではないかと感じましたので、記事にさせていただきます。

CartographerとSlamToolBoxの違い

大きくは、Odometoryが必須かどうかが大きく違います。
CatographerはOdometryが任意(もちろんあったほうが性能は良いですが)に対して、
SlamToolBoxはOdometryが必須となりますので、Cartographerから乗り換える際にお気をつけください。
ただ、SlamToolboxを利用すると、SlamしながらNavigation2を利用できますので、できればSlamtoolboxを利用したほうが、良いかと思います。

Demo

ubuntu20.04
ros2 galactic

  1. Navigation2をBuildします。
mkdir -p ~/turtlebot3_ws/src
cd ~/turtlebot3_ws/src
git clone -b galactic https://github.com/ros-planning/navigation2.git
git clone -b galactic-devel https://github.com/ROBOTIS-GIT/turtlebot3_simulations.git
cd ~/turtlebot3_ws
rosdep install --from-paths src -i 
colcon build --symlink-install
  1. DEMOの実行(LAUNCHファイルを4つ起動します。)
source install/setup.bash
ros2 launch turtlebot3_gazebo turtlebot3_world.launch.py 
source install/setup.bash
ros2 launch slam_toolbox online_async_launch.py 
source install/setup.bash
ros2 launch nav2_bringup navigation_launch.py
source install/setup.bash
ros2 launch nav2_bringup rviz_launch.py

動画

Peek 2022-05-09 00-08.gif

navigation2で動きつつ、Mapの作成を行うことが可能です。これで未知の空間に対するNavigationが可能となります。

3
0
0

Register as a new user and use Qiita more conveniently

  1. You get articles that match your needs
  2. You can efficiently read back useful information
  3. You can use dark theme
What you can do with signing up
3
0