MOLA (Modular Optimization framework for Localization and mApping) is a modern C++ and ROS 2 framework for robot localization and SLAM (Simultaneous Localization and Mapping). Key capabilities:
- LiDAR Odometry (LO) and LiDAR-Inertial Odometry (LIO)
- Configurable ICP and SLAM pipelines
- Plug-and-play modules for custom localization systems
- Geo-referenced map manipulation and sensor fusion
- Standalone C++ or ROS 2 integration
Maintainer: Jose Luis Blanco-Claraco License: GPL-3.0 (core) and BSD-3-Clause (utilities, bridge, demos) Current Version: 2.6.0 Official Docs: https://docs.mola-slam.org/latest/
MOLA uses a plugin-based modular architecture:
- All components implement virtual base interfaces defined in
mola_kernel - Modules are dynamically loaded by
mola_launcherfrom YAML configuration files - Data flows:
RawDataSource → Frontend → Filters → Map/Localization backends - Visualization is decoupled (backend-agnostic
VizInterface) - Runtime composition without recompilation via YAML configs
mola/ # Metapackage (version tags, top-level docs)
mola_kernel/ # Core virtual interfaces and data types
mola_yaml/ # YAML parsing library with variable expansion
mola_msgs/ # ROS 2 message/service/action definitions
mola_common/ # External shared utilities (CMake macros)
# Core Libraries
mola_metric_maps/ # Advanced metric map classes (NDT, voxels, occupancy)
mola_relocalization/ # Global localization and loop closure
mola_pose_list/ # Searchable/spatial pose list data structure
mola_viz/ # GUI visualization system (backend-agnostic)
# Data Input Sources (RawDataSource implementations)
mola_input_rosbag2/ # ROS 2 bag file player
mola_input_kitti_dataset/ # KITTI odometry/SLAM dataset reader
mola_input_kitti360_dataset/ # KITTI-360 panoramic dataset reader
mola_input_euroc_dataset/ # EuRoC UAV stereo dataset reader
mola_input_video/ # Live/offline video sources (OpenCV)
mola_input_rawlog/ # MRPT rawlog binary format
mola_input_lidar_bin_dataset/ # Generic binary LiDAR format
mola_input_mulran_dataset/ # MulRan urban SLAM dataset
mola_input_paris_luco_dataset/ # Paris-LUCO dataset
# Integration & Tooling
mola_launcher/ # CLI app (`mola-cli`) for launching MOLA systems
mola_bridge_ros2/ # Bidirectional ROS 2 ↔ MOLA bridge
mola_traj_tools/ # CLI tools for trajectory file manipulation
mola_demos/ # Example YAML launch configurations
# Evaluation
kitti_metrics_eval/ # KITTI benchmark evaluation tools
Location: mola_kernel/include/mola_kernel/interfaces/
All plugin modules derive from these virtual base classes:
ExecutableBase— base for all executable modulesRawDataSourceBase— sensor/dataset data sourcesFrontEndBase— LiDAR/visual frontend algorithmsFilterBase— generic filtersNavStateFilter— navigation state estimatorsLocalizationSourceBase— localization systemsMapSourceBase/MapServer— map sources/serversVizInterface— visualization (backend-agnostic, updated in v2.6)Relocalization— global localization / loop closureOfflineDatasetSource— offline dataset handling
Other key types:
GuiWidgetDescription— descriptor for GUI widget creation (backend-agnostic)MinimalModuleContainer— module loading and lifecycle
Features: variable substitution ($var), file includes (@include), C++17 filesystem.
Tests: mola_yaml/tests/test-yaml-parser.cpp
mola-cli: main executable, takes YAML config, loads and orchestrates modulesmola-yaml-parser: standalone tool for testing YAML parsing/variable expansionmola-dir: directory and environment utilities
- Consumes ROS 2 sensor topics as MOLA
RawDataSource - Publishes MOLA outputs (maps, poses) as ROS 2 topics/TF
- Must have ROS 2 environment sourced before building
OccupancyGridMap(super-resolution)SparseVoxelPointCloudNDTMap(Normal Distribution Transform)KeyframeMap- All support MRPT serialization
- Build tool: CMake 3.5+ / Colcon (for ROS 2)
- C++ standard: C++17
- Config:
colcon_defaults.yaml(symlink install, RelWithDebInfo, compile_commands.json) - CMake macros (from
mola_common):mola_add_library(),find_mola_package() - Platforms: Linux Ubuntu 22.04/24.04, AMD64 and ARM64
Build standalone:
cmake -B build -DCMAKE_BUILD_TYPE=RelWithDebInfo
cmake --build buildBuild with ROS 2 (source workspace first):
colcon build --symlink-install| Dependency | Purpose |
|---|---|
| MRPT (≥2.1.0) | Core robotics toolkit: poses, observations, maps, OpenGL GUI, serialization |
| mp2p_icp | Point cloud ICP registration (used by relocalization and metric maps) |
| TBB | Intel Threading Building Blocks for parallelism |
| OpenCV | Image/video handling (via MRPT) |
| rclcpp | ROS 2 C++ client library (optional, only if ROS 2 present) |
| rosbag2_cpp | ROS 2 bag I/O (mola_input_rosbag2) |
| tf2 | ROS 2 transforms (mola_bridge_ros2) |
- Framework: CMake + GTest
- Each package has
tests/with its ownCMakeLists.txt - CI/CD:
.github/workflows/— builds on ROS 2 Humble, Jazzy, Kilted, Rolling - Style: enforced with
.clang-formatand.clang-tidy
Test coverage exists for: mola_yaml, mola_metric_maps, mola_pose_list, mola_relocalization
- Inherit from appropriate
mola_kernelinterface (e.g.,RawDataSourceBase) - Override virtual methods (
initialize(),spinOnce(), etc.) - Register with
mola_launcherplugin system via CMake macros - Write YAML config for the module
All MOLA systems are described in YAML. See mola_demos/ for examples.
Variable expansion and file includes are supported by mola_yaml.
Use GuiWidgetDescription for backend-agnostic widget creation in VizInterface.
Do not use direct MRPT GUI calls in modules — use the VizInterface abstraction.
- Interface definitions:
mola_kernel/include/mola_kernel/interfaces/ - GUI/widget types:
mola_kernel/include/mola_kernel/(look forGuiWidgetDescription) - Example configs:
mola_demos/mola-cli-launchs/ - Per-package docs: each directory has a
README.md - Main docs source:
docs/(Sphinx + Doxygen)