# ikhyeon-cho/fastdem architecture

> Architecture diagram of the GitHub repository ikhyeon-cho/fastdem, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2026-09-25). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/ikhyeon-cho/fastdem
- Repository: https://github.com/ikhyeon-cho/fastdem

## Overview

FastDEM is a CPU elevation-mapping engine for mobile robots, with C++ and optional ROS1/ROS2 interfaces. The main workflow receives LiDAR or RGB-D point clouds, uses sensor-aware estimation to update a local or global elevation map, and can post-process and publish the result. The README documents the estimator choices and post-processing capabilities; the tree supports the named module paths, but most core implementations were not sampled, so internal call wiring is shown only where supported by the ROS node excerpts.

Main entry points: [`ros1/src/fastdem_ros_node.cpp`](https://github.com/ikhyeon-cho/fastdem/blob/main/ros1/src/fastdem_ros_node.cpp) (ROS1 node), [`ros2/src/fastdem_ros_node.cpp`](https://github.com/ikhyeon-cho/fastdem/blob/main/ros2/src/fastdem_ros_node.cpp) (ROS2 node), [`fastdem/include/fastdem/elevation_map.hpp`](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/elevation_map.hpp) (Elevation map), [`fastdem/include/fastdem/mapping/elevation_mapping.hpp`](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/mapping/elevation_mapping.hpp) (Elevation estimators)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_integration["Robot interfaces"]
  node_ros1["ROS1 node"]
  node_ros2["ROS2 node"]
  node_ros1bridge["ROS1 adapters<br/>[ros1.hpp]"]
  node_ros2bridge["ROS2 adapters<br/>[ros2.hpp]"]
  node_tf["Transform provider"]
  node_visualization["ROS visualization"]
end

subgraph group_mapping["Mapping core"]
  node_config["Pipeline configuration<br/>[fastdem.hpp]"]
  node_fastdem["FastDEM mapper<br/>[fastdem.hpp]"]
  node_sensor["Sensor models<br/>[sensor_model.hpp]"]
  node_lidar["LiDAR model<br/>[lidar_model.hpp]"]
  node_rgbd["RGB-D model<br/>[rgbd_model.hpp]"]
  node_estimation["Elevation estimators"]
  node_kalman["Kalman estimator"]
  node_quantile["P² quantile estimator"]
end

subgraph group_postprocessing["Terrain processing"]
  node_postconfig["Post-process settings<br/>[postprocess.hpp]"]
  node_raycast["Raycasting<br/>[raycasting.hpp]"]
  node_uncertainty["Uncertainty fusion"]
  node_inpainting["Inpainting<br/>[inpainting.hpp]"]
  node_features["Feature extraction"]
  node_smoothing["Spatial smoothing"]
end

subgraph group_data["Map data and I/O"]
  node_map[("Elevation map<br/>[elevation_map.hpp]")]
  node_npz["NPZ map I/O<br/>[npz.hpp]"]
  node_png["PNG export<br/>[png.hpp]"]
  node_pcd["PCD conversion<br/>[pcd_convert.hpp]"]
end

node_robot(("Robot sensors"))
node_tfservice["ROS transform service"]

node_robot -->|"sends scans"| node_ros1
node_robot -->|"sends scans"| node_ros2
node_ros1 -->|"converts messages"| node_ros1bridge
node_ros2 -->|"converts messages"| node_ros2bridge
node_ros1 -->|"sets provider"| node_tf
node_ros2 -->|"sets provider"| node_tf
node_tf -.->|"requests transforms"| node_tfservice
node_ros1 -->|"loads settings"| node_config
node_ros2 -->|"loads settings"| node_config
node_ros1 -->|"constructs mapper"| node_fastdem
node_ros2 -->|"constructs mapper"| node_fastdem
node_fastdem -->|"models measurements"| node_sensor
node_sensor -->|"selects model"| node_lidar
node_sensor -->|"selects model"| node_rgbd
node_fastdem -->|"integrates scans"| node_estimation
node_estimation -->|"uses estimator"| node_kalman
node_estimation -->|"uses estimator"| node_quantile
node_estimation -->|"updates layers"| node_map
node_ros1 -->|"reads settings"| node_postconfig
node_ros2 -->|"reads settings"| node_postconfig
node_ros1 -->|"runs post-processing"| node_raycast
node_ros2 -->|"runs post-processing"| node_raycast
node_ros1 -->|"runs service"| node_uncertainty
node_ros2 -->|"runs service"| node_uncertainty
node_ros1 -->|"runs service"| node_inpainting
node_ros2 -->|"runs service"| node_inpainting
node_ros1 -->|"runs service"| node_features
node_ros2 -->|"runs service"| node_features
node_ros1 -.->|"applies configured"| node_smoothing
node_ros2 -.->|"applies configured"| node_smoothing
node_raycast -->|"processes map"| node_map
node_uncertainty -->|"processes map"| node_map
node_inpainting -->|"processes map"| node_map
node_features -->|"extracts from"| node_map
node_smoothing -.->|"processes map"| node_map
node_ros1 -->|"converts map"| node_visualization
node_ros2 -->|"converts map"| node_visualization
node_visualization -->|"publishes outputs"| node_robot
node_map -->|"reads or writes"| node_npz
node_map -->|"exports image"| node_png
node_map -->|"converts cloud"| node_pcd

click node_ros1 "https://github.com/ikhyeon-cho/fastdem/blob/main/ros1/src/fastdem_ros_node.cpp"
click node_ros2 "https://github.com/ikhyeon-cho/fastdem/blob/main/ros2/src/fastdem_ros_node.cpp"
click node_ros1bridge "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/bridge/ros1.hpp"
click node_ros2bridge "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/bridge/ros2.hpp"
click node_tf "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/transform_interface.hpp"
click node_config "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/config/fastdem.hpp"
click node_fastdem "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/fastdem.hpp"
click node_sensor "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/sensors/sensor_model.hpp"
click node_lidar "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/sensors/lidar_model.hpp"
click node_rgbd "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/sensors/rgbd_model.hpp"
click node_estimation "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/mapping/elevation_mapping.hpp"
click node_kalman "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/mapping/kalman_estimation.hpp"
click node_quantile "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/mapping/quantile_estimation.hpp"
click node_map "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/elevation_map.hpp"
click node_postconfig "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/config/postprocess.hpp"
click node_raycast "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/raycasting.hpp"
click node_uncertainty "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/uncertainty_fusion.hpp"
click node_inpainting "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/inpainting.hpp"
click node_features "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/feature_extraction.hpp"
click node_smoothing "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/spatial_smoothing.hpp"
click node_npz "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/io/npz.hpp"
click node_png "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/io/png.hpp"
click node_pcd "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/io/pcd_convert.hpp"
click node_visualization "https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/bridge/ros/impl_visualization.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_ros1,node_ros2,node_ros1bridge,node_ros2bridge,node_tf,node_visualization toneBlue
class node_config,node_fastdem,node_sensor,node_lidar,node_rgbd,node_estimation,node_kalman,node_quantile toneAmber
class node_postconfig,node_raycast,node_uncertainty,node_inpainting,node_features,node_smoothing toneMint
class node_map,node_npz,node_png,node_pcd toneRose
class node_robot,node_tfservice toneIndigo
```

## Components

### Robot interfaces

- [ROS1 node](https://github.com/ikhyeon-cho/fastdem/blob/main/ros1/src/fastdem_ros_node.cpp): `ros1/src/fastdem_ros_node.cpp`
- [ROS2 node](https://github.com/ikhyeon-cho/fastdem/blob/main/ros2/src/fastdem_ros_node.cpp): `ros2/src/fastdem_ros_node.cpp`
- [ROS1 adapters](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/bridge/ros1.hpp): `fastdem/include/fastdem/bridge/ros1.hpp`
- [ROS2 adapters](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/bridge/ros2.hpp): `fastdem/include/fastdem/bridge/ros2.hpp`
- [Transform provider](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/transform_interface.hpp): `fastdem/include/fastdem/transform_interface.hpp`
- [ROS visualization](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/bridge/ros/impl_visualization.hpp): `fastdem/include/fastdem/bridge/ros/impl_visualization.hpp`

### Mapping core

- [Pipeline configuration](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/config/fastdem.hpp): `fastdem/include/fastdem/config/fastdem.hpp`
- [FastDEM mapper](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/fastdem.hpp): `fastdem/include/fastdem/fastdem.hpp`
- [Sensor models](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/sensors/sensor_model.hpp): `fastdem/include/fastdem/sensors/sensor_model.hpp`
- [LiDAR model](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/sensors/lidar_model.hpp): `fastdem/include/fastdem/sensors/lidar_model.hpp`
- [RGB-D model](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/sensors/rgbd_model.hpp): `fastdem/include/fastdem/sensors/rgbd_model.hpp`
- [Elevation estimators](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/mapping/elevation_mapping.hpp): `fastdem/include/fastdem/mapping/elevation_mapping.hpp`
- [Kalman estimator](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/mapping/kalman_estimation.hpp): `fastdem/include/fastdem/mapping/kalman_estimation.hpp`
- [P² quantile estimator](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/mapping/quantile_estimation.hpp): `fastdem/include/fastdem/mapping/quantile_estimation.hpp`

### Terrain processing

- [Post-process settings](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/config/postprocess.hpp): `fastdem/include/fastdem/config/postprocess.hpp`
- [Raycasting](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/raycasting.hpp): `fastdem/include/fastdem/postprocess/raycasting.hpp`
- [Uncertainty fusion](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/uncertainty_fusion.hpp): `fastdem/include/fastdem/postprocess/uncertainty_fusion.hpp`
- [Inpainting](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/inpainting.hpp): `fastdem/include/fastdem/postprocess/inpainting.hpp`
- [Feature extraction](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/feature_extraction.hpp): `fastdem/include/fastdem/postprocess/feature_extraction.hpp`
- [Spatial smoothing](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/postprocess/spatial_smoothing.hpp): `fastdem/include/fastdem/postprocess/spatial_smoothing.hpp`

### Map data and I/O

- [Elevation map](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/elevation_map.hpp): `fastdem/include/fastdem/elevation_map.hpp`
- [NPZ map I/O](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/io/npz.hpp): `fastdem/include/fastdem/io/npz.hpp`
- [PNG export](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/io/png.hpp): `fastdem/include/fastdem/io/png.hpp`
- [PCD conversion](https://github.com/ikhyeon-cho/fastdem/blob/main/fastdem/include/fastdem/io/pcd_convert.hpp): `fastdem/include/fastdem/io/pcd_convert.hpp`

### Other components

- **Robot sensors**
- **ROS transform service**

## Connections

- Robot sensors → ROS1 node: sends scans
- Robot sensors → ROS2 node: sends scans
- ROS1 node → ROS1 adapters: converts messages
- ROS2 node → ROS2 adapters: converts messages
- ROS1 node → Transform provider: sets provider
- ROS2 node → Transform provider: sets provider
- Transform provider → ROS transform service: requests transforms
- ROS1 node → Pipeline configuration: loads settings
- ROS2 node → Pipeline configuration: loads settings
- ROS1 node → FastDEM mapper: constructs mapper
- ROS2 node → FastDEM mapper: constructs mapper
- FastDEM mapper → Sensor models: models measurements
- Sensor models → LiDAR model: selects model
- Sensor models → RGB-D model: selects model
- FastDEM mapper → Elevation estimators: integrates scans
- Elevation estimators → Kalman estimator: uses estimator
- Elevation estimators → P² quantile estimator: uses estimator
- Elevation estimators → Elevation map: updates layers
- ROS1 node → Post-process settings: reads settings
- ROS2 node → Post-process settings: reads settings
- ROS1 node → Raycasting: runs post-processing
- ROS2 node → Raycasting: runs post-processing
- ROS1 node → Uncertainty fusion: runs service
- ROS2 node → Uncertainty fusion: runs service
- ROS1 node → Inpainting: runs service
- ROS2 node → Inpainting: runs service
- ROS1 node → Feature extraction: runs service
- ROS2 node → Feature extraction: runs service
- ROS1 node → Spatial smoothing: applies configured
- ROS2 node → Spatial smoothing: applies configured
- Raycasting → Elevation map: processes map
- Uncertainty fusion → Elevation map: processes map
- Inpainting → Elevation map: processes map
- Feature extraction → Elevation map: extracts from
- Spatial smoothing → Elevation map: processes map
- ROS1 node → ROS visualization: converts map
- ROS2 node → ROS visualization: converts map
- ROS visualization → Robot sensors: publishes outputs
- Elevation map → NPZ map I/O: reads or writes
- Elevation map → PNG export: exports image
- Elevation map → PCD conversion: converts cloud
