Skip to content

Localization

Emiliano Borghi edited this page Apr 2, 2021 · 14 revisions

The following page covers how to run localization algorithms with both the simulator (Gazebo) and the real robot:


amcl needs a map to localize in the environment.

Gazebo

# Define amcl as localization algorithm
export LOCALIZATION=amcl
# Open RViz
export RVIZ=true
# Select the sensor
export LASER=rplidar
# Run the simulation in the specified environment
roslaunch ca_gazebo create_sweet_house_5.launch

Real robot

# TODO

Gazebo

# Run cartographer in pure localization mode
export LOCALIZATION=pure_localization
# If you want to see RViz set this to true
export RVIZ=true
# Run gazebo in any environment (like a House)
roslaunch ca_gazebo create_house.launch
# Move around the robot using keyboard teleop
roslaunch ca_tools keyboard_teleop.launch

Real robot

# TODO

Extra notes

If you are going to use cartographer with pure localization, you don't need a PGM. cartographer will load the state of the pbstream and will do the localization based on that.


Gazebo

export LOCALIZATION=lama
export RVIZ=true
export LASER=rplidar
roslaunch ca_gazebo create_house.launch

Real robot

# TODO

This package uses an Extended Kalman Filter (EKF) to improve the local estimate of the robot pose.

Gazebo

# Don't use a global localization algorithm (optional)
export LOCALIZATION=
# Open RViz
export RVIZ=true
# Select any sensor
export LASER=rplidar
# Run the simulation in an empty environment
roslaunch ca_gazebo create_empty_world.launch
# Move the robot with the keyboard
roslaunch ca_tools keyboard_teleop.launch

To visualize the data correctly in RViz, set the reference frame to odom:

RViz

Also, enable the wheel and fused odometries:

Odometries

You should see something like this:

Sensor Fusion

Real robot

# TODO