# cocel-postech/genz-lio architecture

> Architecture diagram of the GitHub repository cocel-postech/genz-lio, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-10-14). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/cocel-postech/genz-lio
- Repository: https://github.com/cocel-postech/genz-lio

## Overview

GenZ-LIO estimates LiDAR-inertial odometry from recorded sequences or live ROS streams. In Python, the CLI selects configuration and a dataset reader; the pipeline feeds scan/IMU frames to the compiled estimator and can write trajectories or visualize results. The C++ estimator performs preprocessing, IMU propagation and deskewing, adaptive voxelization, hybrid-metric filtering, and map updates. ROS wraps the same estimator for live input and output. Some internal calls and ROS wiring are unsampled, so only documented or indexed relationships are shown.

Main entry points: [`ros/src/OdometryServer.hpp`](https://github.com/cocel-postech/genz-lio/blob/master/ros/src/OdometryServer.hpp) (Odometry server), [`python/genz_lio/pipeline.py`](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/pipeline.py) (Replay pipeline), [`cpp/genz_lio/core/GenZLIO.hpp`](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/GenZLIO.hpp) (Odometry pipeline), [`python/genz_lio/cli.py`](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/cli.py) (CLI and config)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_python["Python replay"]
  node_cli["CLI and config<br/>[cli.py]"]
  node_readers["Dataset readers"]
  node_replay["Replay pipeline<br/>[pipeline.py]"]
  node_binding["Python bindings"]
  node_writers["Pose writers<br/>[pose_writers.py]"]
  node_visualizer["Visualizer<br/>[visualizer.py]"]
  node_camera["Camera panel<br/>[camera_panel.py]"]
end

subgraph group_estimation["Odometry estimation"]
  node_estimator["Odometry pipeline<br/>[GenZLIO.hpp]"]
  node_config["Configuration IO<br/>[ConfigIo.cpp]"]
  node_preprocess["Scan preprocessing<br/>[Preprocessor.hpp]"]
  node_imu["IMU propagation<br/>[ImuProcessor.hpp]"]
  node_voxelize["Adaptive voxelization"]
  node_metric["Hybrid metric update"]
  node_map[("Voxel map<br/>[VoxelMap.hpp]")]
  node_search["Voxel correspondence search"]
end

subgraph group_ros["ROS interface"]
  node_rosnode["ROS node"]
  node_server["Odometry server<br/>[OdometryServer.hpp]"]
  node_conversion["Cloud conversion"]
  node_mapviz["Map visualizer"]
  node_compat["ROS compatibility<br/>[RosCompat.hpp]"]
end

subgraph group_filter["Filter foundations"]
  node_ekf["Iterated error-state filter<br/>[esekfom.hpp]"]
  node_manifolds["Manifold state math<br/>[vect.hpp]"]
end

node_user(("Operator"))
node_recording["Recorded data"]
node_rosbag["ROS bag source"]
node_live(("Live sensor streams"))
node_trajectory["Trajectory output"]

node_user -->|"runs"| node_cli
node_recording -->|"reads"| node_readers
node_cli -->|"starts"| node_replay
node_cli -->|"loads config"| node_config
node_replay -->|"consumes frames"| node_readers
node_replay -->|"registers scans"| node_binding
node_replay -->|"writes poses"| node_writers
node_replay -->|"updates display"| node_visualizer
node_visualizer -->|"uses"| node_camera
node_rosbag -->|"provides recordings"| node_readers
node_live -->|"publishes streams"| node_rosnode
node_rosnode -->|"starts"| node_server
node_server -->|"converts clouds"| node_conversion
node_server -->|"loads config"| node_config
node_server -->|"registers scans"| node_estimator
node_server -->|"publishes map"| node_mapviz
node_server -->|"uses ROS API"| node_compat
node_estimator -->|"preprocesses scans"| node_preprocess
node_estimator -->|"propagates IMU"| node_imu
node_estimator -->|"voxelizes scan"| node_voxelize
node_estimator -->|"updates state"| node_metric
node_estimator -->|"updates map"| node_map
node_metric -.->|"builds residuals"| node_search
node_metric -.->|"filters measurements"| node_ekf
node_ekf -->|"uses state math"| node_manifolds
node_replay -->|"produces"| node_trajectory
node_server -->|"publishes poses"| node_trajectory

click node_cli "https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/cli.py"
click node_readers "https://github.com/cocel-postech/genz-lio/tree/master/python/genz_lio/datasets"
click node_replay "https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/pipeline.py"
click node_binding "https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/pybind/genz_lio_pybind.cpp"
click node_writers "https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/tools/pose_writers.py"
click node_visualizer "https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/tools/visualizer.py"
click node_camera "https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/tools/camera_panel.py"
click node_estimator "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/GenZLIO.hpp"
click node_config "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/config/ConfigIo.cpp"
click node_preprocess "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/Preprocessor.hpp"
click node_imu "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/ImuProcessor.hpp"
click node_voxelize "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/ScaleAwareVoxelizer.hpp"
click node_metric "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/HybridMetricUpdate.hpp"
click node_map "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/VoxelMap.hpp"
click node_search "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/VoxelPrunedSearch.hpp"
click node_rosnode "https://github.com/cocel-postech/genz-lio/blob/master/ros/src/genz_lio_node_ros2.cpp"
click node_server "https://github.com/cocel-postech/genz-lio/blob/master/ros/src/OdometryServer.hpp"
click node_conversion "https://github.com/cocel-postech/genz-lio/blob/master/ros/src/CloudConversion.hpp"
click node_mapviz "https://github.com/cocel-postech/genz-lio/blob/master/ros/src/VoxelMapVisualizer.hpp"
click node_compat "https://github.com/cocel-postech/genz-lio/blob/master/ros/src/RosCompat.hpp"
click node_ekf "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/3rdparty/IKFoM_toolkit/esekfom/esekfom.hpp"
click node_manifolds "https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/3rdparty/IKFoM_toolkit/mtk/types/vect.hpp"

classDef toneNeutral fill:#f8fafc,stroke:#334155,stroke-width:1.5px,color:#0f172a
classDef toneBlue fill:#dbeafe,stroke:#2563eb,stroke-width:1.5px,color:#172554
classDef toneAmber fill:#fef3c7,stroke:#d97706,stroke-width:1.5px,color:#78350f
classDef toneMint fill:#dcfce7,stroke:#16a34a,stroke-width:1.5px,color:#14532d
classDef toneRose fill:#ffe4e6,stroke:#e11d48,stroke-width:1.5px,color:#881337
classDef toneIndigo fill:#e0e7ff,stroke:#4f46e5,stroke-width:1.5px,color:#312e81
classDef toneTeal fill:#ccfbf1,stroke:#0f766e,stroke-width:1.5px,color:#134e4a
class node_cli,node_readers,node_replay,node_binding,node_writers,node_visualizer,node_camera toneBlue
class node_estimator,node_config,node_preprocess,node_imu,node_voxelize,node_metric,node_map,node_search toneAmber
class node_rosnode,node_server,node_conversion,node_mapviz,node_compat toneMint
class node_ekf,node_manifolds toneRose
class node_user,node_recording,node_rosbag,node_live,node_trajectory toneIndigo
```

## Components

### Python replay

- [CLI and config](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/cli.py): `python/genz_lio/cli.py`
- [Dataset readers](https://github.com/cocel-postech/genz-lio/tree/master/python/genz_lio/datasets): `python/genz_lio/datasets`
- [Replay pipeline](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/pipeline.py): `python/genz_lio/pipeline.py`
- [Python bindings](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/pybind/genz_lio_pybind.cpp): `python/genz_lio/pybind/genz_lio_pybind.cpp`
- [Pose writers](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/tools/pose_writers.py): `python/genz_lio/tools/pose_writers.py`
- [Visualizer](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/tools/visualizer.py): `python/genz_lio/tools/visualizer.py`
- [Camera panel](https://github.com/cocel-postech/genz-lio/blob/master/python/genz_lio/tools/camera_panel.py): `python/genz_lio/tools/camera_panel.py`

### Odometry estimation

- [Odometry pipeline](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/GenZLIO.hpp): `cpp/genz_lio/core/GenZLIO.hpp`
- [Configuration IO](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/config/ConfigIo.cpp): `cpp/genz_lio/config/ConfigIo.cpp`
- [Scan preprocessing](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/Preprocessor.hpp): `cpp/genz_lio/core/Preprocessor.hpp`
- [IMU propagation](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/ImuProcessor.hpp): `cpp/genz_lio/core/ImuProcessor.hpp`
- [Adaptive voxelization](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/ScaleAwareVoxelizer.hpp): `cpp/genz_lio/core/ScaleAwareVoxelizer.hpp`
- [Hybrid metric update](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/HybridMetricUpdate.hpp): `cpp/genz_lio/core/HybridMetricUpdate.hpp`
- [Voxel map](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/VoxelMap.hpp): `cpp/genz_lio/core/VoxelMap.hpp`
- [Voxel correspondence search](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/core/VoxelPrunedSearch.hpp): `cpp/genz_lio/core/VoxelPrunedSearch.hpp`

### ROS interface

- [ROS node](https://github.com/cocel-postech/genz-lio/blob/master/ros/src/genz_lio_node_ros2.cpp): `ros/src/genz_lio_node_ros2.cpp`
- [Odometry server](https://github.com/cocel-postech/genz-lio/blob/master/ros/src/OdometryServer.hpp): `ros/src/OdometryServer.hpp`
- [Cloud conversion](https://github.com/cocel-postech/genz-lio/blob/master/ros/src/CloudConversion.hpp): `ros/src/CloudConversion.hpp`
- [Map visualizer](https://github.com/cocel-postech/genz-lio/blob/master/ros/src/VoxelMapVisualizer.hpp): `ros/src/VoxelMapVisualizer.hpp`
- [ROS compatibility](https://github.com/cocel-postech/genz-lio/blob/master/ros/src/RosCompat.hpp): `ros/src/RosCompat.hpp`

### Filter foundations

- [Iterated error-state filter](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/3rdparty/IKFoM_toolkit/esekfom/esekfom.hpp): `cpp/genz_lio/3rdparty/IKFoM_toolkit/esekfom/esekfom.hpp`
- [Manifold state math](https://github.com/cocel-postech/genz-lio/blob/master/cpp/genz_lio/3rdparty/IKFoM_toolkit/mtk/types/vect.hpp): `cpp/genz_lio/3rdparty/IKFoM_toolkit/mtk/types/vect.hpp`

### Other components

- **Operator**
- **Recorded data**
- **ROS bag source**
- **Live sensor streams**
- **Trajectory output**

## Connections

- Operator → CLI and config: runs (evidence: `README.md`)
- Recorded data → Dataset readers: reads (evidence: `README.md`)
- CLI and config → Replay pipeline: starts (evidence: `python/genz_lio/cli.py`)
- CLI and config → Configuration IO: loads config (evidence: `python/genz_lio/cli.py`)
- Replay pipeline → Dataset readers: consumes frames (evidence: `python/genz_lio/pipeline.py`)
- Replay pipeline → Python bindings: registers scans (evidence: `python/genz_lio/pipeline.py`)
- Replay pipeline → Pose writers: writes poses (evidence: `python/genz_lio/pipeline.py`)
- Replay pipeline → Visualizer: updates display (evidence: `python/genz_lio/pipeline.py`)
- Visualizer → Camera panel: uses (evidence: `python/genz_lio/tools/visualizer.py`)
- ROS bag source → Dataset readers: provides recordings (evidence: `README.md`)
- Live sensor streams → ROS node: publishes streams
- ROS node → Odometry server: starts (evidence: `ros/src/genz_lio_node_ros2.cpp`)
- Odometry server → Cloud conversion: converts clouds (evidence: `ros/src/OdometryServer.cpp`)
- Odometry server → Configuration IO: loads config
- Odometry server → Odometry pipeline: registers scans (evidence: `ros/src/OdometryServer.hpp`)
- Odometry server → Map visualizer: publishes map (evidence: `ros/src/OdometryServer.cpp`)
- Odometry server → ROS compatibility: uses ROS API (evidence: `ros/src/OdometryServer.hpp`)
- Odometry pipeline → Scan preprocessing: preprocesses scans (evidence: `cpp/genz_lio/core/GenZLIO.hpp`)
- Odometry pipeline → IMU propagation: propagates IMU (evidence: `cpp/genz_lio/core/GenZLIO.hpp`)
- Odometry pipeline → Adaptive voxelization: voxelizes scan (evidence: `cpp/genz_lio/core/GenZLIO.hpp`)
- Odometry pipeline → Hybrid metric update: updates state (evidence: `cpp/genz_lio/core/GenZLIO.hpp`)
- Odometry pipeline → Voxel map: updates map (evidence: `cpp/genz_lio/core/GenZLIO.hpp`)
- Hybrid metric update → Voxel correspondence search: builds residuals
- Hybrid metric update → Iterated error-state filter: filters measurements
- Iterated error-state filter → Manifold state math: uses state math (evidence: `cpp/genz_lio/3rdparty/IKFoM_toolkit/esekfom/esekfom.hpp`)
- Replay pipeline → Trajectory output: produces (evidence: `python/genz_lio/pipeline.py`)
- Odometry server → Trajectory output: publishes poses (evidence: `ros/src/OdometryServer.hpp`)
