# hmcl-unist/3doffroad_navigation architecture

> Architecture diagram of the GitHub repository hmcl-unist/3doffroad_navigation, 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/hmcl-unist/3doffroad_navigation
- Repository: https://github.com/hmcl-unist/3doffroad_navigation

## Overview

This repository implements learning-based, uncertainty-aware off-road vehicle navigation. The principal workflow is to record driving data for terrain-uncertainty learning, build elevation and traversability maps, evaluate candidate trajectories with a GP-based planner, track the selected path with MPPI, and send commands through a low-level controller to the simulated vehicle. The graph preserves the documented workflow and major subsystems; some internal links are supported only by the source index or README, as indicated by evidence paths.

Main entry points: [`Planner/gptrajpredict/src/main_node.py`](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/src/main_node.py) (Trajectory prediction node), [`Controller/mppi_ctrl/src/main_node.py`](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/src/main_node.py) (MPPI controller node), [`simulation_env/autorally_gazebo/nodes/autorally_controller.py`](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/simulation_env/autorally_gazebo/nodes/autorally_controller.py) (AutoRally simulation), [`tools/gplogger/src/main_node.py`](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/tools/gplogger/src/main_node.py) (Driving-data logger)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_mapping["Terrain mapping"]
  node_elevation_inputs["Sensor input manager"]
  node_elevation["Elevation mapping"]
  node_postprocess["Map postprocessing"]
  node_traversability["Traversability estimation"]
end

subgraph group_learning["Learning and prediction"]
  node_logger["Driving-data logger<br/>[main_node.py]"]
  node_logger_gp["Logger GP grid map<br/>[gpgridmap.py]"]
  node_planner_node["Trajectory prediction node<br/>[main_node.py]"]
  node_gp_model["GP uncertainty model<br/>[gp_model.py]"]
  node_gp_grid["Batch GP grid map<br/>[gpgridmap_batch.py]"]
  node_vehicle_model["Batch vehicle model"]
end

subgraph group_control["Vehicle control"]
  node_mppi_node["MPPI controller node<br/>[main_node.py]"]
  node_mppi["MPPI optimizer<br/>[mppi.py]"]
  node_mppi_grid["Controller GP grid map<br/>[gpgridmap.py]"]
  node_mppi_vehicle["Controller vehicle model<br/>[vehicle_model.py]"]
  node_lowlevel["Low-level controller<br/>[lowlevel_ctrl.cpp]"]
end

subgraph group_simulation["Simulation environment"]
  node_sim["AutoRally simulation"]
end

subgraph group_support["Visualization and tools"]
  node_rviz["Trajectory visualization"]
end

node_operator(("Operator / joystick"))
node_vehicle(("Vehicle state and sensors"))

node_operator -->|"drives manually"| node_sim
node_sim -->|"records driving data"| node_logger
node_sim -.->|"provides sensor data"| node_elevation_inputs
node_elevation_inputs -->|"registers inputs"| node_elevation
node_elevation -.->|"filters elevation map"| node_postprocess
node_postprocess -.->|"provides elevation map"| node_traversability
node_traversability -->|"provides traversability map"| node_planner_node
node_logger -->|"uses GP mapping"| node_logger_gp
node_logger -.->|"trains uncertainty model"| node_gp_model
node_planner_node -->|"uses GP model"| node_gp_model
node_planner_node -->|"uses batch grid map"| node_gp_grid
node_planner_node -->|"predicts trajectories"| node_vehicle_model
node_planner_node -->|"publishes local path"| node_mppi_node
node_mppi_node -->|"optimizes controls"| node_mppi
node_mppi_node -->|"uses cost map"| node_mppi_grid
node_mppi_node -->|"uses vehicle model"| node_mppi_vehicle
node_mppi_node -->|"sends vehicle commands"| node_lowlevel
node_lowlevel -.->|"controls vehicle"| node_sim
node_sim -.->|"produces state"| node_vehicle
node_planner_node -.->|"publishes trajectories"| node_rviz

click node_sim "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/simulation_env/autorally_gazebo/nodes/autorally_controller.py"
click node_logger "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/tools/gplogger/src/main_node.py"
click node_logger_gp "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/tools/gplogger/include/gplogger/gpgridmap.py"
click node_elevation_inputs "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/elevation_mapping/elevation_mapping/src/input_sources/InputSourceManager.cpp"
click node_elevation "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/elevation_mapping/elevation_mapping/include/elevation_mapping/ElevationMapping.hpp"
click node_postprocess "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/elevation_mapping/elevation_mapping/src/postprocessing/PostprocessingPipelineFunctor.cpp"
click node_traversability "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/traversability_estimation/traversability_estimation/src/TraversabilityMap.cpp"
click node_planner_node "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/src/main_node.py"
click node_gp_model "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/include/gptrajpredict/gp_model.py"
click node_gp_grid "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/include/gptrajpredict/gpgridmap_batch.py"
click node_vehicle_model "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/include/gptrajpredict/vehicle_model_batch.py"
click node_mppi_node "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/src/main_node.py"
click node_mppi "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/include/mppi_ctrl/mppi.py"
click node_mppi_grid "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/include/mppi_ctrl/gpgridmap.py"
click node_mppi_vehicle "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/include/mppi_ctrl/vehicle_model.py"
click node_lowlevel "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/lowlevel_ctrl/src/lowlevel_ctrl.cpp"
click node_rviz "https://github.com/hmcl-unist/3doffroad_navigation/blob/main/tools/kindr_ros/multi_dof_joint_trajectory_rviz_plugins/src/MultiDOFJointTrajectoryDisplay.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_elevation_inputs,node_elevation,node_postprocess,node_traversability toneBlue
class node_logger,node_logger_gp,node_planner_node,node_gp_model,node_gp_grid,node_vehicle_model toneAmber
class node_mppi_node,node_mppi,node_mppi_grid,node_mppi_vehicle,node_lowlevel toneMint
class node_sim toneRose
class node_rviz,node_operator,node_vehicle toneIndigo
```

## Components

### Terrain mapping

- [Sensor input manager](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/elevation_mapping/elevation_mapping/src/input_sources/InputSourceManager.cpp): `Preprocessing/elevation_mapping/elevation_mapping/src/input_sources/InputSourceManager.cpp`
- [Elevation mapping](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/elevation_mapping/elevation_mapping/include/elevation_mapping/ElevationMapping.hpp): `Preprocessing/elevation_mapping/elevation_mapping/include/elevation_mapping/ElevationMapping.hpp`
- [Map postprocessing](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/elevation_mapping/elevation_mapping/src/postprocessing/PostprocessingPipelineFunctor.cpp): `Preprocessing/elevation_mapping/elevation_mapping/src/postprocessing/PostprocessingPipelineFunctor.cpp`
- [Traversability estimation](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Preprocessing/traversability_estimation/traversability_estimation/src/TraversabilityMap.cpp): `Preprocessing/traversability_estimation/traversability_estimation/src/TraversabilityMap.cpp`

### Learning and prediction

- [Driving-data logger](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/tools/gplogger/src/main_node.py): `tools/gplogger/src/main_node.py`
- [Logger GP grid map](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/tools/gplogger/include/gplogger/gpgridmap.py): `tools/gplogger/include/gplogger/gpgridmap.py`
- [Trajectory prediction node](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/src/main_node.py): `Planner/gptrajpredict/src/main_node.py`
- [GP uncertainty model](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/include/gptrajpredict/gp_model.py): `Planner/gptrajpredict/include/gptrajpredict/gp_model.py`
- [Batch GP grid map](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/include/gptrajpredict/gpgridmap_batch.py): `Planner/gptrajpredict/include/gptrajpredict/gpgridmap_batch.py`
- [Batch vehicle model](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Planner/gptrajpredict/include/gptrajpredict/vehicle_model_batch.py): `Planner/gptrajpredict/include/gptrajpredict/vehicle_model_batch.py`

### Vehicle control

- [MPPI controller node](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/src/main_node.py): `Controller/mppi_ctrl/src/main_node.py`
- [MPPI optimizer](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/include/mppi_ctrl/mppi.py): `Controller/mppi_ctrl/include/mppi_ctrl/mppi.py`
- [Controller GP grid map](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/include/mppi_ctrl/gpgridmap.py): `Controller/mppi_ctrl/include/mppi_ctrl/gpgridmap.py`
- [Controller vehicle model](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/mppi_ctrl/include/mppi_ctrl/vehicle_model.py): `Controller/mppi_ctrl/include/mppi_ctrl/vehicle_model.py`
- [Low-level controller](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/Controller/lowlevel_ctrl/src/lowlevel_ctrl.cpp): `Controller/lowlevel_ctrl/src/lowlevel_ctrl.cpp`

### Simulation environment

- [AutoRally simulation](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/simulation_env/autorally_gazebo/nodes/autorally_controller.py): `simulation_env/autorally_gazebo/nodes/autorally_controller.py`

### Visualization and tools

- [Trajectory visualization](https://github.com/hmcl-unist/3doffroad_navigation/blob/main/tools/kindr_ros/multi_dof_joint_trajectory_rviz_plugins/src/MultiDOFJointTrajectoryDisplay.cpp): `tools/kindr_ros/multi_dof_joint_trajectory_rviz_plugins/src/MultiDOFJointTrajectoryDisplay.cpp`

### Other components

- **Operator / joystick**
- **Vehicle state and sensors**

## Connections

- Operator / joystick → AutoRally simulation: drives manually
- AutoRally simulation → Driving-data logger: records driving data
- AutoRally simulation → Sensor input manager: provides sensor data
- Sensor input manager → Elevation mapping: registers inputs (evidence: `Preprocessing/elevation_mapping/elevation_mapping/src/input_sources/InputSourceManager.cpp`)
- Elevation mapping → Map postprocessing: filters elevation map
- Map postprocessing → Traversability estimation: provides elevation map
- Traversability estimation → Trajectory prediction node: provides traversability map
- Driving-data logger → Logger GP grid map: uses GP mapping (evidence: `tools/gplogger/src/main_node.py`)
- Driving-data logger → GP uncertainty model: trains uncertainty model
- Trajectory prediction node → GP uncertainty model: uses GP model (evidence: `Planner/gptrajpredict/src/main_node.py`)
- Trajectory prediction node → Batch GP grid map: uses batch grid map (evidence: `Planner/gptrajpredict/src/main_node.py`)
- Trajectory prediction node → Batch vehicle model: predicts trajectories (evidence: `Planner/gptrajpredict/src/main_node.py`)
- Trajectory prediction node → MPPI controller node: publishes local path
- MPPI controller node → MPPI optimizer: optimizes controls (evidence: `Controller/mppi_ctrl/src/main_node.py`)
- MPPI controller node → Controller GP grid map: uses cost map (evidence: `Controller/mppi_ctrl/src/main_node.py`)
- MPPI controller node → Controller vehicle model: uses vehicle model (evidence: `Controller/mppi_ctrl/src/main_node.py`)
- MPPI controller node → Low-level controller: sends vehicle commands
- Low-level controller → AutoRally simulation: controls vehicle
- AutoRally simulation → Vehicle state and sensors: produces state
- Trajectory prediction node → Trajectory visualization: publishes trajectories
