Localization
Localization is a method of tracking the robot's location within an existing map. It is generally done using laser scan data from a 2D LIDAR, and the robot's odometry. For this demo we are using the Nav2 package launch localization.
See the sample robot.yaml
for configuration details.
Make sure you have installed the simulator before starting this tutorial. Take a look at the installation guide for details.
Launching Localization
When using the simulation, it is important to add use_sim_time:=true
to the Nav2, SLAM, and
Localization launch files. When using a physical robot, either omit use_sim_time
or set it
to false
.
To start localization using AMCL follow the steps described in the Nav2 startup. When you get to step 4, run
ros2 launch clearpath_nav2_demos localiztion.launch.py use_sim_time:=true
The default map used by localization.launch.py
is a
map of the simulated warehouse world.
If you are using a custom map, pass it in with the map
launch argument:
ros2 launch clearpath_nav2_demos localization.launch.py use_sim_time:=true map:=/path/to/my/map.yaml