rsasaki0109/lidar_localization_ros2

3D LIDAR Localization using pointcloud map in ROS 2 (Not SLAM)

What it solves

Robots need to know where they are on a map to navigate. This package takes a LiDAR point cloud stream and a pre-built 3D map (in .pcd or .ply format) and outputs the robot's pose in that map. It handles the tricky startup problem of finding the initial pose, and can recover if tracking is lost. It works alone or as the localization module for Nav2 navigation.

How it works

On startup, it searches the whole map to find the robot's position, using a global search with 2D candidates and NDT scoring. If ambiguous, it asks the user to set a 2D pose estimate in RViz. After that, each scan is preprocessed (range crop, voxel filter, deskew), then matched against the map cropped around a predicted pose using NDT or GICP. The predicted pose comes from the last pose moved by external odometry (e.g., wheel odometry, IMU, or RKO-LIO from lidar_slam_ros2) if available. If matching fails, it keeps the predicted pose (odometry bridge) for a while; if failure continues, it reinitializes. It publishes pose, path, and status topics.

Who it's for

Developers and researchers working with ROS 2 robots that have a 3D LiDAR and a prior point cloud map. It's tested on handheld Livox MID-360 sensors and Unitree Go2 legged robots, and integrates with Nav2. It requires some ROS 2 knowledge to set up, but the quickstart script tries to auto-discover topics and frames.

Highlights

  • Automatic global localization: finds the starting pose without manual input, or asks for a 2D pose estimate if needed.
  • Robust to tracking loss: recovers by re-searching the map.
  • Optional external odometry (wheel, leg, or LiDAR-inertial) improves motion prediction and carries the pose where map matching fails.
  • Supports NDT and GICP (including small_gicp) backends.
  • Works with Nav2 by publishing map->odom.
  • Runtime map switching via /map_switch topic.
  • Benchmark results on public datasets: median errors 0.02-0.12 m, with all runs starting correctly without an initial pose.

Related

  • Project
  • Project
  • Project
  • Project
  • Project