# url-kaist/erasor2 architecture

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

- Interactive diagram: https://gitdiagram.com/url-kaist/erasor2
- Repository: https://github.com/url-kaist/erasor2

## Overview

ERASOR2 builds instance-aware static point-cloud maps from LiDAR sequences, with a ROS-free C++ runtime and Python benchmark tooling. The documented workflow prepares ground/instance labels, accumulates a map, runs ERASOR2, then evaluates preservation and dynamic-object rejection. The repository also includes legacy ERASOR v1, sensor preprocessing, trajectory clustering/pose correction, and visualization. Some links below follow explicit README workflow statements; source-level edges use shown entry points or SOURCE INDEX references, so unsampled internals are not inferred.

Main entry points: [`src/erasor2/main.cpp`](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/main.cpp) (ERASOR2 runner), [`scripts/run_pipeline.py`](https://github.com/url-kaist/erasor2/blob/main/scripts/run_pipeline.py) (Benchmark pipeline), [`include/mapgen/mapgen.hpp`](https://github.com/url-kaist/erasor2/blob/main/include/mapgen/mapgen.hpp) (Map accumulation), [`src/erasor2/erasor2.cpp`](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/erasor2.cpp) (Instance-aware filtering)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_prep["Input preparation"]
  node_labels["Label generation"]
  node_sensorprep["Sensor preprocessing"]
end

subgraph group_runtime["Mapping runtime"]
  node_config["YAML configuration<br/>[Config.cpp]"]
  node_loader["Dataset loader<br/>[dataloader.cpp]"]
  node_mapgen["Map accumulation<br/>[mapgen.hpp]"]
  node_mapfile[("Accumulated map")]
  node_erasor2main["ERASOR2 runner<br/>[main.cpp]"]
end

subgraph group_algorithm["Mapping algorithms"]
  node_trajectory["Trajectory clustering"]
  node_erasor2["Instance-aware filtering<br/>[erasor2.cpp]"]
  node_gridmap[("Occupancy grid<br/>[grid_map.cpp]")]
  node_utilities["Point-cloud utilities<br/>[erasor_utils.cpp]"]
  node_erasor1["ERASOR v1<br/>[erasor.cpp]"]
end

subgraph group_results["Outputs and evaluation"]
  node_visualization["Rerun visualization<br/>[RerunLogger.cpp]"]
  node_pipeline["Benchmark pipeline<br/>[run_pipeline.py]"]
  node_benchmark["Benchmark runner<br/>[run_benchmark.py]"]
  node_evaluation["Metric evaluation<br/>[evaluate.py]"]
  node_staticmap[("Static map output")]
end

node_operator(("Sequence operator"))
node_dataset[("LiDAR sequence")]

node_operator -->|"prepares labels"| node_labels
node_dataset -.->|"provides scans"| node_labels
node_operator -->|"runs benchmark"| node_pipeline
node_pipeline -->|"invokes"| node_mapgen
node_mapgen -->|"loads frames"| node_loader
node_dataset -->|"provides sequence"| node_loader
node_mapgen -->|"writes accumulated map"| node_mapfile
node_pipeline -->|"invokes"| node_erasor2main
node_erasor2main -->|"loads YAML"| node_config
node_erasor2main -->|"loads frames"| node_loader
node_erasor2main -->|"clusters trajectories"| node_trajectory
node_erasor2main -->|"runs filtering"| node_erasor2
node_erasor2 -->|"uses grid map"| node_gridmap
node_erasor2 -->|"uses utilities"| node_utilities
node_mapfile -->|"input map"| node_erasor2main
node_erasor2main -->|"produces static map"| node_staticmap
node_pipeline -->|"invokes"| node_evaluation
node_evaluation -->|"scores output"| node_staticmap
node_benchmark -->|"runs per config"| node_pipeline
node_operator -.->|"runs alternative"| node_erasor1
node_sensorprep -.->|"prepares sensor data"| node_dataset
node_erasor2main -->|"logs visualization"| node_visualization

click node_labels "https://github.com/url-kaist/erasor2/blob/main/scripts/kitti_clustering.py"
click node_sensorprep "https://github.com/url-kaist/erasor2/blob/main/include/dataprocessor/PointCloudProcessor.h"
click node_config "https://github.com/url-kaist/erasor2/blob/main/src/erasor2/Config.cpp"
click node_loader "https://github.com/url-kaist/erasor2/blob/main/src/dataloader/dataloader.cpp"
click node_mapgen "https://github.com/url-kaist/erasor2/blob/main/include/mapgen/mapgen.hpp"
click node_trajectory "https://github.com/url-kaist/erasor2/blob/main/include/dataprocessor/TrajectoryClustering.hpp"
click node_erasor2main "https://github.com/url-kaist/erasor2/blob/main/src/erasor2/main.cpp"
click node_erasor2 "https://github.com/url-kaist/erasor2/blob/main/src/erasor2/erasor2.cpp"
click node_gridmap "https://github.com/url-kaist/erasor2/blob/main/src/erasor2/grid_map.cpp"
click node_utilities "https://github.com/url-kaist/erasor2/blob/main/src/erasor2/erasor_utils.cpp"
click node_erasor1 "https://github.com/url-kaist/erasor2/blob/main/src/erasor1/erasor.cpp"
click node_visualization "https://github.com/url-kaist/erasor2/blob/main/src/erasor2/RerunLogger.cpp"
click node_pipeline "https://github.com/url-kaist/erasor2/blob/main/scripts/run_pipeline.py"
click node_benchmark "https://github.com/url-kaist/erasor2/blob/main/scripts/run_benchmark.py"
click node_evaluation "https://github.com/url-kaist/erasor2/blob/main/scripts/evaluate.py"

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_labels,node_sensorprep toneBlue
class node_config,node_loader,node_mapgen,node_mapfile,node_erasor2main,node_dataset toneAmber
class node_trajectory,node_erasor2,node_gridmap,node_utilities,node_erasor1 toneMint
class node_visualization,node_pipeline,node_benchmark,node_evaluation,node_staticmap toneRose
class node_operator toneIndigo
```

## Components

### Input preparation

- [Label generation](https://github.com/url-kaist/erasor2/blob/main/scripts/kitti_clustering.py): `scripts/kitti_clustering.py`
- [Sensor preprocessing](https://github.com/url-kaist/erasor2/blob/main/include/dataprocessor/PointCloudProcessor.h): `include/dataprocessor/PointCloudProcessor.h`

### Mapping runtime

- [YAML configuration](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/Config.cpp): `src/erasor2/Config.cpp`
- [Dataset loader](https://github.com/url-kaist/erasor2/blob/main/src/dataloader/dataloader.cpp): `src/dataloader/dataloader.cpp`
- [Map accumulation](https://github.com/url-kaist/erasor2/blob/main/include/mapgen/mapgen.hpp): `include/mapgen/mapgen.hpp`
- **Accumulated map**
- [ERASOR2 runner](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/main.cpp): `src/erasor2/main.cpp`

### Mapping algorithms

- [Trajectory clustering](https://github.com/url-kaist/erasor2/blob/main/include/dataprocessor/TrajectoryClustering.hpp): `include/dataprocessor/TrajectoryClustering.hpp`
- [Instance-aware filtering](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/erasor2.cpp): `src/erasor2/erasor2.cpp`
- [Occupancy grid](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/grid_map.cpp): `src/erasor2/grid_map.cpp`
- [Point-cloud utilities](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/erasor_utils.cpp): `src/erasor2/erasor_utils.cpp`
- [ERASOR v1](https://github.com/url-kaist/erasor2/blob/main/src/erasor1/erasor.cpp): `src/erasor1/erasor.cpp`

### Outputs and evaluation

- [Rerun visualization](https://github.com/url-kaist/erasor2/blob/main/src/erasor2/RerunLogger.cpp): `src/erasor2/RerunLogger.cpp`
- [Benchmark pipeline](https://github.com/url-kaist/erasor2/blob/main/scripts/run_pipeline.py): `scripts/run_pipeline.py`
- [Benchmark runner](https://github.com/url-kaist/erasor2/blob/main/scripts/run_benchmark.py): `scripts/run_benchmark.py`
- [Metric evaluation](https://github.com/url-kaist/erasor2/blob/main/scripts/evaluate.py): `scripts/evaluate.py`
- **Static map output**

### Other components

- **Sequence operator**
- **LiDAR sequence**

## Connections

- Sequence operator → Label generation: prepares labels (evidence: `README.md`)
- LiDAR sequence → Label generation: provides scans
- Sequence operator → Benchmark pipeline: runs benchmark (evidence: `README.md`)
- Benchmark pipeline → Map accumulation: invokes (evidence: `README.md`)
- Map accumulation → Dataset loader: loads frames
- LiDAR sequence → Dataset loader: provides sequence (evidence: `README.md`)
- Map accumulation → Accumulated map: writes accumulated map
- Benchmark pipeline → ERASOR2 runner: invokes (evidence: `README.md`)
- ERASOR2 runner → YAML configuration: loads YAML (evidence: `src/erasor2/main.cpp`)
- ERASOR2 runner → Dataset loader: loads frames (evidence: `src/erasor2/main.cpp`)
- ERASOR2 runner → Trajectory clustering: clusters trajectories (evidence: `src/erasor2/main.cpp`)
- ERASOR2 runner → Instance-aware filtering: runs filtering (evidence: `src/erasor2/main.cpp`)
- Instance-aware filtering → Occupancy grid: uses grid map (evidence: `src/erasor2/erasor2.cpp`)
- Instance-aware filtering → Point-cloud utilities: uses utilities
- Accumulated map → ERASOR2 runner: input map (evidence: `README.md`)
- ERASOR2 runner → Static map output: produces static map (evidence: `README.md`)
- Benchmark pipeline → Metric evaluation: invokes (evidence: `README.md`)
- Metric evaluation → Static map output: scores output (evidence: `README.md`)
- Benchmark runner → Benchmark pipeline: runs per config (evidence: `README.md`)
- Sequence operator → ERASOR v1: runs alternative
- Sensor preprocessing → LiDAR sequence: prepares sensor data
- ERASOR2 runner → Rerun visualization: logs visualization (evidence: `src/erasor2/main.cpp`)
