Localization with a particle filter and a reference map

To localize with a particle filter (PF) you will need:

  1. A metric map (the .mm file) of the environment. Built as described in: Build a map.

  2. To publish that map using mrpt_map_server.

  3. Launch mrpt_pf_localization and configure it to read from wheels odometry (if they exist), the input sensors (e.g. LiDAR), GPS (GNSS) if present. This node will subscribe to the published metric map and use the sensors to publish updates on the robot pose in the map frame.

Note

Do NOT set the raw LiDAR pointcloud as input for the PF. It is just too large and it must be subsampled first. We can use mrpt_pointcloud_pipeline for such task, as can be seen in the tutorial below.

Tutorial

A complete demonstration has been put together on: https://github.com/MOLAorg/mola_warehouse_pf_tutorial

Key points of this tutorial:

How to run the tutorial

Clone the tutorial package (which already includes a prebuilt .mm), make sure of having all dependencies, build and run it:

cd ~/ros2_ws/src
git clone https://github.com/MOLAorg/mola_warehouse_pf_tutorial.git

cd ~/ros2_ws
rosdep install --from-paths src --ignore-src -r -y

colcon build --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=RelWithDebInfo
. install/setup.bash

ros2 launch mola_warehouse_pf_tutorial tutorial_launch.py