# cocel-postech/genz-icp architecture

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

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

## Overview

##### Project type and purpose
- This is a robotics middleware project—a C++ LiDAR-based odometry library (“GenZ-ICP”) with ROS1/ROS2 wrappers.
- The core provides a pipeline for adaptive, degeneracy-robust LiDAR odometry; the ROS layer exposes it as nodes, with YAML configs, launch files, and rviz setups.

##### File structure
- Top-level directories:
- cpp/genz_icp – the core C++ library
- ros – ROS integration (ros1 & ros2 sub-packages, config, launch, rviz)
- pictures, root config files (clang, cmake, gitignore, etc.)
- Inside cpp/genz_icp:
- 3rdparty – Eigen, Sophus, TBB, tsl::robin hash map
- core – modules (Deskew, Preprocessing, Threshold, Registration, VoxelHashMap)
- metrics – runtime metrics collection
- pipeline – GenZICP pipeline entry point (GenZICP.cpp/.hpp)
- Inside ros:
- ros1 & ros2 – OdometryServer nodes + Utils
- config – YAML parameter sets, tuning guide
- launch – .launch/.launch.py files
- rviz – visualization configs

##### Key README insights
- Build with catkin (ROS1) or colcon (ROS2).
- Two runtime modes: supply topic + config YAML, or topic only (uses defaults).
- Uses standard ROS topics (sensor_msgs/PointCloud2 → nav_msgs/Odometry + TF).

[LiDAR Sensor] → publishes → [ROS Topic: /points]
→ [OdometryServer Node (ros/ros1 & ros/ros2) ■] → loads → [YAML Config ◇]
→ invokes → [GenZICP Pipeline ●]
→ [Preprocessing Module ■] → [Deskew Module ■] → [Threshold Module ■]
→ [VoxelHashMap Module ■] → [Registration Module ■]
→ reports to → [Metrics Module ■]
→ returns ΔPose → [OdometryServer] publishes → [nav_msgs/Odometry & TF ■]
→ external → [RViz Visualization ■]
- Underneath, show the build toolchain: [CMake] → [catkin/colcon build].
- Off to the side, group 3rd-party libs as shared dependencies on the core modules.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Subgraph for ROS Ecosystem
    subgraph "ROS Ecosystem"
        direction TB
        LiDAR["LiDAR Sensor"]:::external
        Topic["ROS Topic: /points"]:::data
        subgraph "Odometry Server Nodes"
            direction TB
            Odo1["OdometryServer Node (ROS1)"]:::node
            Odo2["OdometryServer Node (ROS2)"]:::node
        end
        Config["YAML Config Store"]:::config
        Pipeline["GenZICP Pipeline"]:::core
        subgraph "Core Processing Modules"
            direction TB
            Preproc["Preprocessing Module"]:::core
            Deskew["Deskew Module"]:::core
            Threshold["Threshold Module"]:::core
            Voxel["VoxelHashMap Module"]:::core
            Reg["Registration Module"]:::core
        end
        Metrics["Metrics Module"]:::core
        OdometryOut["nav_msgs/Odometry & TF"]:::data
        RViz["RViz Visualization"]:::node
    end

    %% Build Layer
    subgraph "Build & Deployment"
        direction TB
        CMake["CMake"]:::build
        Build["catkin/colcon Build"]:::build
    end

    %% Third-party Libraries
    subgraph "3rd-Party Libraries"
        direction TB
        Eigen["Eigen"]:::third
        Sophus["Sophus"]:::third
        TBB["Intel TBB"]:::third
        Robin["tsl::robin_map"]:::third
    end

    %% Connections
    LiDAR -->|"publishes PointCloud2"| Topic
    Topic -->|"subscribes"| Odo1
    Topic -->|"subscribes"| Odo2
    Odo1 -->|"loads parameters from"| Config
    Odo2 -->|"loads parameters from"| Config
    Odo1 -->|"invokes"| Pipeline
    Odo2 -->|"invokes"| Pipeline
    Pipeline --> Preproc
    Preproc --> Deskew
    Deskew --> Threshold
    Threshold --> Voxel
    Voxel --> Reg
    Reg -->|"outputs pose"| Metrics
    Metrics -->|"reports to"| Pipeline
    Pipeline -->|"returns ΔPose"| Odo1
    Pipeline -->|"returns ΔPose"| Odo2
    Odo1 -->|"publishes"| OdometryOut
    Odo2 -->|"publishes"| OdometryOut
    OdometryOut -->|"visualized by"| RViz

    %% Build connections
    CMake --> Build
    Build --> Odo1
    Build --> Odo2
    Build --> Pipeline

    %% Dependencies
    Eigen --> Preproc
    Sophus --> Preproc
    TBB --> Preproc
    Robin --> Voxel

    %% Click Events
    click Odo1 "https://github.com/cocel-postech/genz-icp/blob/master/ros/ros1/OdometryServer.cpp"
    click Odo1 "https://github.com/cocel-postech/genz-icp/blob/master/ros/ros1/OdometryServer.hpp"
    click Odo2 "https://github.com/cocel-postech/genz-icp/blob/master/ros/ros2/OdometryServer.cpp"
    click Odo2 "https://github.com/cocel-postech/genz-icp/blob/master/ros/ros2/OdometryServer.hpp"
    click Pipeline "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/pipeline/GenZICP.cpp"
    click Pipeline "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/pipeline/GenZICP.hpp"
    click Preproc "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Preprocessing.cpp"
    click Preproc "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Preprocessing.hpp"
    click Deskew "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Deskew.cpp"
    click Deskew "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Deskew.hpp"
    click Threshold "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Threshold.cpp"
    click Threshold "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Threshold.hpp"
    click Reg "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Registration.cpp"
    click Reg "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/Registration.hpp"
    click Voxel "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/VoxelHashMap.cpp"
    click Voxel "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/core/VoxelHashMap.hpp"
    click Metrics "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/metrics/Metrics.cpp"
    click Metrics "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/metrics/Metrics.hpp"
    click Eigen "https://github.com/cocel-postech/genz-icp/tree/master/cpp/genz_icp/3rdparty/eigen/"
    click Sophus "https://github.com/cocel-postech/genz-icp/tree/master/cpp/genz_icp/3rdparty/sophus/"
    click TBB "https://github.com/cocel-postech/genz-icp/tree/master/cpp/genz_icp/3rdparty/tbb/"
    click Robin "https://github.com/cocel-postech/genz-icp/tree/master/cpp/genz_icp/3rdparty/tsl_robin/"
    click Config "https://github.com/cocel-postech/genz-icp/blob/master/ros/config/corridor.yaml"
    click CMake "https://github.com/cocel-postech/genz-icp/blob/master/cpp/genz_icp/CMakeLists.txt"
    click Build "https://github.com/cocel-postech/genz-icp/blob/master/ros/CMakeLists.txt"

    %% Styles
    classDef node fill:#7f8c8d,stroke:#2c3e50,color:white;
    classDef core fill:#3498db,stroke:#2980b9,color:white;
    classDef config fill:#f1c40f,stroke:#f39c12,color:black;
    classDef data fill:#95a5a6,stroke:#7f8c8d,color:black,shape:parallelogram;
    classDef build fill:#2ecc71,stroke:#27ae60,color:white;
    classDef external fill:#ecf0f1,stroke:#bdc3c7,color:black;
    classDef third fill:#e67e22,stroke:#d35400,color:white;
```
