# anybotics/elevation_mapping architecture

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

- Interactive diagram: https://gitdiagram.com/anybotics/elevation_mapping
- Repository: https://github.com/anybotics/elevation_mapping

## Overview

This ROS product builds a robot-centric elevation map from distance measurements and robot pose/covariance, then exposes raw and fused maps and map services. Its runtime path is input-source subscription, sensor-specific processing, map updates and fusion. The README documents the user-visible topics and services; the SOURCE INDEX supports several internal module relationships. Postprocessing is a separate configured filter subsystem, but the excerpts do not show how it is invoked by the mapping node.

Main entry points: [`elevation_mapping/src/ElevationMapping.cpp`](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMapping.cpp) (Mapping coordinator), [`elevation_mapping/src/input_sources/Input.cpp`](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/input_sources/Input.cpp) (Input subscriber), [`elevation_mapping/src/ElevationMap.cpp`](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMap.cpp) (Elevation map), [`elevation_mapping/src/sensor_processors/SensorProcessorBase.cpp`](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/SensorProcessorBase.cpp) (Sensor processor base)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_inputs["Input Sources"]
  node_source_manager["Source manager"]
  node_input["Input subscriber<br/>[Input.cpp]"]
end

subgraph group_sensors["Sensor Processing"]
  node_sensor_base["Sensor processor base"]
  node_laser["Laser processor"]
  node_perfect["Perfect processor"]
  node_stereo["Stereo processor"]
  node_structured["Structured-light processor"]
  node_point_type["Confidence point type"]
end

subgraph group_mapping["Mapping Runtime"]
  node_node["ROS node entry"]
  node_coordinator["Mapping coordinator"]
  node_map[("Elevation map<br/>[ElevationMap.cpp]")]
  node_motion["Motion map updater"]
  node_cdf["Weighted distribution"]
  node_thread_data["Thread-safe data"]
end

subgraph group_outputs["Map Output"]
  node_pipeline["Filter pipeline"]
  node_worker["Postprocessing worker"]
  node_pool["Postprocessor pool"]
  node_raw_map[("Raw elevation map")]
  node_fused_map[("Fused elevation map")]
end

node_robot(("Robot pose"))
node_distance(("Distance sensor"))
node_rosuser(("ROS client"))
node_visualizer(("Map visualizer"))

node_node -.->|"starts"| node_coordinator
node_robot -->|"provides pose"| node_coordinator
node_distance -->|"provides measurements"| node_source_manager
node_coordinator -->|"configures sources"| node_source_manager
node_source_manager -->|"configures"| node_input
node_input -->|"registers callbacks"| node_coordinator
node_input -->|"owns processor"| node_sensor_base
node_input -->|"selects processor"| node_laser
node_input -->|"selects processor"| node_perfect
node_input -->|"selects processor"| node_stereo
node_input -->|"selects processor"| node_structured
node_laser -->|"specializes"| node_sensor_base
node_perfect -->|"specializes"| node_sensor_base
node_stereo -->|"specializes"| node_sensor_base
node_structured -->|"specializes"| node_sensor_base
node_sensor_base -->|"uses point type"| node_point_type
node_coordinator -->|"updates and fuses"| node_map
node_coordinator -->|"updates motion"| node_motion
node_motion -->|"updates map"| node_map
node_map -->|"uses point type"| node_point_type
node_map -->|"uses distribution"| node_cdf
node_coordinator -->|"guards parameters"| node_thread_data
node_map -->|"publishes raw"| node_raw_map
node_map -->|"publishes fused"| node_fused_map
node_rosuser -->|"triggers fusion"| node_coordinator
node_rosuser -->|"requests submap"| node_fused_map
node_raw_map -->|"visualizes"| node_visualizer
node_worker -->|"processes buffer"| node_pipeline
node_pool -->|"manages workers"| node_worker
node_pipeline -->|"guards parameters"| node_thread_data

click node_node "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/elevation_mapping_node.cpp"
click node_coordinator "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMapping.cpp"
click node_source_manager "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/input_sources/InputSourceManager.cpp"
click node_input "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/input_sources/Input.cpp"
click node_sensor_base "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/SensorProcessorBase.cpp"
click node_laser "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/LaserSensorProcessor.cpp"
click node_perfect "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/PerfectSensorProcessor.cpp"
click node_stereo "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/StereoSensorProcessor.cpp"
click node_structured "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/StructuredLightSensorProcessor.cpp"
click node_map "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMap.cpp"
click node_motion "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/RobotMotionMapUpdater.cpp"
click node_point_type "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/PointXYZRGBConfidenceRatio.cpp"
click node_cdf "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/include/elevation_mapping/WeightedEmpiricalCumulativeDistributionFunction.hpp"
click node_thread_data "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/include/elevation_mapping/ThreadSafeDataWrapper.hpp"
click node_pipeline "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/postprocessing/PostprocessingPipelineFunctor.cpp"
click node_worker "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/postprocessing/PostprocessingWorker.cpp"
click node_pool "https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/postprocessing/PostprocessorPool.cpp"

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_source_manager,node_input,node_rosuser toneBlue
class node_sensor_base,node_laser,node_perfect,node_stereo,node_structured,node_point_type toneAmber
class node_node,node_coordinator,node_map,node_motion,node_cdf,node_thread_data toneMint
class node_pipeline,node_worker,node_pool,node_raw_map,node_fused_map toneRose
class node_robot,node_distance,node_visualizer toneIndigo
```

## Components

### Input Sources

- [Source manager](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/input_sources/InputSourceManager.cpp): `elevation_mapping/src/input_sources/InputSourceManager.cpp`
- [Input subscriber](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/input_sources/Input.cpp): `elevation_mapping/src/input_sources/Input.cpp`

### Sensor Processing

- [Sensor processor base](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/SensorProcessorBase.cpp): `elevation_mapping/src/sensor_processors/SensorProcessorBase.cpp`
- [Laser processor](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/LaserSensorProcessor.cpp): `elevation_mapping/src/sensor_processors/LaserSensorProcessor.cpp`
- [Perfect processor](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/PerfectSensorProcessor.cpp): `elevation_mapping/src/sensor_processors/PerfectSensorProcessor.cpp`
- [Stereo processor](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/StereoSensorProcessor.cpp): `elevation_mapping/src/sensor_processors/StereoSensorProcessor.cpp`
- [Structured-light processor](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/sensor_processors/StructuredLightSensorProcessor.cpp): `elevation_mapping/src/sensor_processors/StructuredLightSensorProcessor.cpp`
- [Confidence point type](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/PointXYZRGBConfidenceRatio.cpp): `elevation_mapping/src/PointXYZRGBConfidenceRatio.cpp`

### Mapping Runtime

- [ROS node entry](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/elevation_mapping_node.cpp): `elevation_mapping/src/elevation_mapping_node.cpp`
- [Mapping coordinator](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMapping.cpp): `elevation_mapping/src/ElevationMapping.cpp`
- [Elevation map](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/ElevationMap.cpp): `elevation_mapping/src/ElevationMap.cpp`
- [Motion map updater](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/RobotMotionMapUpdater.cpp): `elevation_mapping/src/RobotMotionMapUpdater.cpp`
- [Weighted distribution](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/include/elevation_mapping/WeightedEmpiricalCumulativeDistributionFunction.hpp): `elevation_mapping/include/elevation_mapping/WeightedEmpiricalCumulativeDistributionFunction.hpp`
- [Thread-safe data](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/include/elevation_mapping/ThreadSafeDataWrapper.hpp): `elevation_mapping/include/elevation_mapping/ThreadSafeDataWrapper.hpp`

### Map Output

- [Filter pipeline](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/postprocessing/PostprocessingPipelineFunctor.cpp): `elevation_mapping/src/postprocessing/PostprocessingPipelineFunctor.cpp`
- [Postprocessing worker](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/postprocessing/PostprocessingWorker.cpp): `elevation_mapping/src/postprocessing/PostprocessingWorker.cpp`
- [Postprocessor pool](https://github.com/anybotics/elevation_mapping/blob/master/elevation_mapping/src/postprocessing/PostprocessorPool.cpp): `elevation_mapping/src/postprocessing/PostprocessorPool.cpp`
- **Raw elevation map**
- **Fused elevation map**

### Other components

- **Robot pose**
- **Distance sensor**
- **ROS client**
- **Map visualizer**

## Connections

- ROS node entry → Mapping coordinator: starts
- Robot pose → Mapping coordinator: provides pose (evidence: `README.md`)
- Distance sensor → Source manager: provides measurements (evidence: `README.md`)
- Mapping coordinator → Source manager: configures sources (evidence: `elevation_mapping/src/ElevationMapping.cpp`)
- Source manager → Input subscriber: configures
- Input subscriber → Mapping coordinator: registers callbacks
- Input subscriber → Sensor processor base: owns processor
- Input subscriber → Laser processor: selects processor (evidence: `elevation_mapping/src/input_sources/Input.cpp`)
- Input subscriber → Perfect processor: selects processor (evidence: `elevation_mapping/src/input_sources/Input.cpp`)
- Input subscriber → Stereo processor: selects processor (evidence: `elevation_mapping/src/input_sources/Input.cpp`)
- Input subscriber → Structured-light processor: selects processor (evidence: `elevation_mapping/src/input_sources/Input.cpp`)
- Laser processor → Sensor processor base: specializes
- Perfect processor → Sensor processor base: specializes
- Stereo processor → Sensor processor base: specializes
- Structured-light processor → Sensor processor base: specializes
- Sensor processor base → Confidence point type: uses point type
- Mapping coordinator → Elevation map: updates and fuses (evidence: `elevation_mapping/src/ElevationMapping.cpp`)
- Mapping coordinator → Motion map updater: updates motion
- Motion map updater → Elevation map: updates map
- Elevation map → Confidence point type: uses point type (evidence: `elevation_mapping/src/ElevationMap.cpp`)
- Elevation map → Weighted distribution: uses distribution (evidence: `elevation_mapping/src/ElevationMap.cpp`)
- Mapping coordinator → Thread-safe data: guards parameters
- Elevation map → Raw elevation map: publishes raw (evidence: `README.md`)
- Elevation map → Fused elevation map: publishes fused (evidence: `README.md`)
- ROS client → Mapping coordinator: triggers fusion (evidence: `README.md`)
- ROS client → Fused elevation map: requests submap (evidence: `README.md`)
- Raw elevation map → Map visualizer: visualizes (evidence: `README.md`)
- Postprocessing worker → Filter pipeline: processes buffer
- Postprocessor pool → Postprocessing worker: manages workers
- Filter pipeline → Thread-safe data: guards parameters
