Edit on GitHub

Navigation2

WARNING: Be careful when running the robot on the table as the robot might fall.

NOTE:

  • This instructions were tested on Ubuntu 18.04 and ROS2 Dashing Diademata.
  • Make sure to run the ROS2 Bringup instructions before running this instructions.
  • The navigation uses the a data created in ROS2 SLAM. Please make sure to have a map data.

Use Navigation2 to send your robot to a designated destination in a given environment.

Run Navigation2 Nodes

  1. Open a terminal on TurtleBot3.

  2. Bring up basic packages to start TurtleBot3 applications
    $ export TURTLEBOT3_MODEL=${TB3_MODEL}
    $ ros2 launch turtlebot3_bringup robot.launch.py
    

    NOTE: Specify ${TB3_MODEL}: burger, waffle, waffle_pi before excuting the command. Set the permanent export setting by following Export TURTLEBOT3_MODEL instruction.

  3. Open a terminal on Remote PC
  4. Launch the navigation file.
    $ export TURTLEBOT3_MODEL=${TB3_MODEL}
    $ ros2 launch turtlebot3_navigation2 navigation2.launch.py map:=$HOME/map.yaml
    

    NOTE: Specify ${TB3_MODEL}: burger, waffle, waffle_pi before excuting the command. Set the permanent export setting by following Export TURTLEBOT3_MODEL instruction.

    Running the command above, RViz2 is executed together. In order to run RViz2 separately, use the following command.

     $ rviz2 -d `ros2 pkg prefix turtlebot3_navigation2`/share/turtlebot3_navigation2/rviz/tb3_navigation2.rviz
    

Estimate Initial Pose

CAUTION: Do not apply this instruction to SBC. Use Remote PC.

First, the initial pose estimation of the robot should be performed. When you press 2D Pose Estimate in the menu of RViz2, a very large green arrow appears. Move it to the pose where the actual robot is located in the given map, and while holding down the left mouse button, drag the green arrow to the direction where the robot’s front is facing, follow the instruction below.

  1. Click on 2D Pose Estimate.
  2. Click on a approximate point on the screen and drag a cursur to indicate a direction where TurtleBot3 heads to.
  3. Run Teleoperation to recognize where TurtleBot3 is currently located on the map.
      $ export TURTLEBOT3_MODEL=${TB3_MODEL}
      $ ros2 run turtlebot3_teleop teleop_keyboard
    

    Executing turtlebot3_teleop_keyboard node of Teleoperation

    NOTE: Specify ${TB3_MODEL}: burger, waffle, waffle_pi before excuting the command. Set the permanent export setting by following Export TURTLEBOT3_MODEL instruction.

  4. Move TurtleBot3 back and forth.

After then, TurtleBot3 estimates its acutal position and orientation, which is specified by the green arrow. If the drawing is specified worng, repeat localizing by clicking on 2D Pose Estimate

2D Pose Estimate

Send Navigation Goal

CAUTION: Do not apply this instruction to SBC. Use Remote PC.

Use Navigation2 Goal to send TurtleBot3 to a designated destination. Pressing this button, large green arrow will appears, which is a marker indicating the destination of the robot. The roots of the arrow are x and y parameters. An orientation pointed by the arrow is theta direction of the robot.

Follow the instruction below.

  1. Click on Navigation2 Goal.
  2. Click on a specific point in the map to set a goal position.
  3. While holding it down, drag the cursor to the direction where TurtleBot should be facing at the end.
  4. A path to the designated destination will be created based on information of the map.
    • TurtleBot3 follows the path and arrive at the destination.
    • If unexpected obstacles blocks the path, the robot can detect them to avoid.

Navigation2 Goal

The contents in e-Manual may differ from contents of a provided video in e-Manaul as e-Manual is updated on a regular basis.

WARNING:

  • Goal position may not be set when a path is failed to be created.
  • If you want to stop moving the robot before reaching to the goal position, set a current position of TurtleBot3 as a goal position.

Tuning Guide

Navigation2 stack has many parameters to change performances for different robots. It’s similar with ROS1 navigation. You can get an information about it in ROS Navigation Wiki or refer to chapter 11 in ROS Robot Programming book.

This tuning guide gives some tips for you to configue important parameters. If you want to change performances depends on your environments, this tips might be help you and save your time.

local_costmap(global_cost_map)

inflation_layer.inflation_radius

inflation_layer.cost_scaling_factor

The best path is for the robot to pass through a center of between obstacles. Set this factor to be smaller in order to far from obstacles.

dwb_controller

max_vel_x

min_vel_x

max_vel_y

min_vel_y

max_vel_theta

min_speed_theta

max_speed_xy

min_speed_xy

acc_lim_x

acc_lim_y

acc_lim_theta

decel_lim_x

decel_lim_y

decel_lim_theta

xy_goal_tolerance

yaw_goal_tolerance

transform_tolerance

sim_time

References