GLIM 3D Mapping Framework

repository·master·Indexed 23 days ago

https://github.com/koide3/glim

A versatile, range-based 3D mapping framework using factor graph-based error minimization for high-accuracy mapping. It supports various sensors including spinning LiDAR (Velodyne, Ouster), non-repetitive scan LiDAR (Livox), solid-state LiDAR (Intel Realsense), and RGB-D cameras (Azure Kinect). Key features include GPU acceleration, an interactive map correction interface, and a global callback slot mechanism for extensibility via the glim_ext package.

Tokens
8.8K
Snippets
18
Records
51
Agent score
83%

What's inside GLIM

  1. Overview of GLIM 3D Mapping Framework

    master

    GLIM is a versatile and extensible range-based 3D mapping framework designed for high accuracy and ease of use.

    Key features include:

    • Accuracy: Uses direct multi-scan registration error minimization on factor graphs to maintain mapping consistency. Supports GPU acceleration for speed and quality.
    • Ease-of-use: Includes an interactive map correction interface for manual correction of mapping failures and refinement.
    • Versatility: Sensor-agnostic; works with spinning LiDAR (Velodyne, Ouster), non-repetitive scan LiDAR (Livox), solid-state LiDAR (Intel Realsense), and RGB-D cameras (Azure Kinect).
    • Extensibility: Features a global callback slot mechanism to access internal mapping states and insert additional constraints into the factor graph. The glim_ext package provides example implementations for loop detection and LiDAR-Visual-Inertial odometry.
  2. Overview of GLIM mapping framework

    master

    GLIM is a versatile and extensible range-based 3D mapping framework designed for high accuracy and speed. It uses direct multi-scan registration error minimization on factor graphs to maintain mapping consistency and supports GPU acceleration.

    Key features include:

    • Versatility: Compatible with various range sensors including spinning-type LiDAR (Velodyne, Ouster), non-repetitive scan LiDAR (Livox Avia, MID360), solid-state LiDAR (Intel Realsense L515), and RGB-D cameras (Microsoft Azure Kinect).
    • Interactive Correction: Provides an interface for manual map correction and refinement of mapping failures.
    • Extensibility: Features a global callback slot mechanism to access internal states and insert additional constraints into the factor graph.
  3. Explore GLIM related repositories and extensions

    master

    GLIM is part of an ecosystem of tools for SLAM and localization. Depending on your integration needs, you may want to use these related projects:

    • glim_ros2: ROS 2 integration for GLIM.
    • glim_ext: Extensions for GLIM.
    • gtsam_points: GTSAM factors specifically for range-based SLAM, which can be used in conjunction with GLIM.
  4. Extend GLIM using the global callback slot mechanism

    master

    GLIM is designed to be extensible via a global callback slot mechanism. This allows developers to:

    1. Access the internal states of the mapping process.
    2. Insert additional constraints into the factor graph.

    For example implementations of extension functions, such as explicit loop detection or LiDAR-Visual-Inertial odometry estimation, are provided in the glim_ext repository.

  5. Important note on submap poses during editing

    master
    While using the interactive map editor, the submap poses (the factor graph) are frozen and will not be updated. If you require updated submap poses after performing manual removals, you must use the offline viewer.
  6. How the Global Callback Slot mechanism works

    master

    The Global Callback Slot is a mechanism used to hook into various processing steps of the GLIM mapping system. It allows developers to access internal states (like estimated poses or velocities) and insert additional factors (constraints) into the factor graphs to improve accuracy, stability, or robustness.

    Callbacks are available for three main modules:

    1. Odometry Estimation
    2. Submapping
    3. Global Mapping

    Important Thread-Safety Warning: Each of these modules runs in a different thread. If your extension module subscribes to events from multiple modules, you are responsible for ensuring thread-safety within your implementation.

    #include <glim/odometry/callback.hpp>
    
    using namespace glim;
    
    void on_new_frame(const EstimationFrame::ConstPtr& new_frame) {
      const long id = new_frame->id;                                    // Frame ID
      const double stamp = new_frame->stamp;                            // Timestamp
      const Eigen::Isometry3d& T_world_imu = new_frame->T_world_imu;    // IMU pose
    }
    
    void setup_callback() {
      using std::placeholders::_1;
      OdometryEstimationCallback::on_new_frame.add(std::bind(&on_new_frame, _1));
    }
  7. How GLIM's extensibility works

    master

    GLIM is designed to be extended via a global callback slot mechanism. This mechanism allows developers to:

    1. Access the internal states of the mapping process.
    2. Insert additional constraints directly into the factor graph.

    For practical implementations, the glim_ext repository provides reference examples, such as explicit loop detection and LiDAR-Visual-Inertial odometry estimation.

  8. Quickstart: Install and prepare GLIM

    master

    To get started with GLIM, follow these steps:

    1. Install GLIM: Follow the installation guide or use prebuilt docker images.
    2. Download Test Data: Download datasets from Zenodo for testing.
      • ROS1: os1_128_01_downsampled.bag or os1_128_01.bag.
      • ROS2: os1_128_01_downsampled.tar.gz or os1_128_01.tar.gz.
    3. Verify Configuration: Ensure your sensor configuration and ROS topic parameters match the expected structure in your config files (e.g., glim/config/config_ros.json should define imu_topic and points_topic).
  9. Remove noise using Radius outlier removal

    master

    To remove outlier points (noise) that fall outside a specific radius:

    1. Right-click a point on the map to open the context menu.
    2. Navigate to Radius tools.
    3. Adjust the Radius so that the area covers the outlier points.
    4. Click Select points outside radius.
    5. Click Remove selected points to delete them from the map.
  10. Install GLIM for ROS2 via PPA

    master

    If you are using ROS2, you can install the glim-ros packages directly from the PPA. Choose the package that matches your ROS2 distribution and CUDA version.

    ROS2 Jazzy (Ubuntu 24.04)

    sudo apt install -y ros-jazzy-glim-ros             # Without CUDA
    sudo apt install -y ros-jazzy-glim-ros-cuda12.6    # With CUDA 12.6
    sudo apt install -y ros-jazzy-glim-ros-cuda13.1    # With CUDA 13.1

    ROS2 Humble (Ubuntu 22.04)

    sudo apt install -y ros-humble-glim-ros            # Without CUDA
    sudo apt install -y ros-humble-glim-ros-cuda12.2   # With CUDA 12.2
    sudo apt install -y ros-humble-glim-ros-cuda12.6   # With CUDA 12.6
    sudo apt install -y ros-humble-glim-ros-cuda13.1   # With CUDA 13.1

    Note: Always run sudo ldconfig after installation to ensure shared libraries are visible.

    sudo apt install -y ros-jazzy-glim-ros-cuda12.6