# ethz-asl/mav_active_3d_planning architecture

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

- Interactive diagram: https://gitdiagram.com/ethz-asl/mav_active_3d_planning
- Repository: https://github.com/ethz-asl/mav_active_3d_planning

## Overview

##### Main components
- Core Planning Engine: Represent the active_3d_planning_core package as the heart of the framework. It encapsulates the planners, trajectory generators, cost/gain evaluators, and modules for sensor and map processing.
- ROS Interface: Include active_3d_planning_ros that adapts the core functionality to the ROS ecosystem. This component will handle message passing, ROS nodes, and topic/service exchanges.
- MAV-Specific Modules: Show active_3d_planning_mav which provides modules tailored to micro aerial vehicles, integrating sensor inputs and specific motion planning (e.g., specialized trajectory generators).
- Voxblox Integration: Include active_3d_planning_voxblox as the mapping component, managing the underlying occupancy or TSDF maps via voxblox, and interfacing with the core planner.
- Application Layer: Represent active_3d_planning_app_reconstruction that configures and launches the planner setups. This layer also provides simulation configurations (via RViz configurations, launch files, and experiment evaluation scripts) and interfaces to external simulators (e.g., Unreal CV).
- External Dependencies: Illustrate connections to external libraries and tools used (e.g., mav_trajectory_generation, catkin_simple, glog_catkin, eigen_catkin, and other simulation modules like rotors_simulator).

##### Architectural patterns and design principles
- The project appears to adopt a modular design pattern. Emphasize the separation of concerns: core logic, interfacing, specialized domain modules, and application orchestration.
- Documentation and configuration files (found in the “cfg” and “launch” directories) indicate a design that is highly configurable at runtime, so highlight the configurability loop (i.e., YAML-driven module instantiation).
- The layered approach permits the core to be used stand-alone (non-ROS) while the ROS-specific package wraps around it to support message passing and node-based execution.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% External Dependencies
    ext["External Simulators & Tools"]:::external

    %% ROS Interface
    ros["ROS Communication Interface"]:::ros

    %% Voxblox Mapping Integration
    vox["Voxblox Mapping Integration"]:::vox

    %% Application Layer
    app["3D Reconstruction App"]:::app

    %% Core Planning Engine Subgraph
    subgraph "Active 3D Planning Core" 
        core["Core Planner"]:::core
        %% Internal Core Components
        tg["Trajectory Generators"]:::internal
        cge["Cost/Gain Evaluators"]:::internal
        sm["Sensor Models"]:::internal
        te["Trajectory Evaluators"]:::internal
        mf["Module Factories"]:::internal

        %% Internal connections within Core
        mf --> tg
        tg --> te
        sm --> te
        cge --> te
    end

    %% MAV-Specific Modules
    mav["MAV-Specific Modules"]:::mav

    %% Data Flows
    ext -->|"provides data"| ros
    ros -->|"sends sensor inputs"| core
    vox -->|"feeds mapping updates"| core
    app -->|"loads configurations"| core
    core -->|"outputs motion plans"| mav
    core -->|"logs results"| app

    %% Styles
    classDef core fill:#ADD8E6,stroke:#000,stroke-width:2px;
    classDef ros fill:#FFFF99,stroke:#000,stroke-width:2px;
    classDef mav fill:#90EE90,stroke:#000,stroke-width:2px;
    classDef vox fill:#D8BFD8,stroke:#000,stroke-width:2px;
    classDef app fill:#FFA500,stroke:#000,stroke-width:2px;
    classDef external fill:#D3D3D3,stroke:#000,stroke-width:2px;
    classDef internal fill:#E6E6FA,stroke:#333,stroke-width:1px;

    %% Click Events
    click core "https://github.com/ethz-asl/mav_active_3d_planning/tree/master/active_3d_planning_core"
    click ros "https://github.com/ethz-asl/mav_active_3d_planning/tree/master/active_3d_planning_ros"
    click mav "https://github.com/ethz-asl/mav_active_3d_planning/tree/master/active_3d_planning_mav"
    click vox "https://github.com/ethz-asl/mav_active_3d_planning/tree/master/active_3d_planning_voxblox"
    click app "https://github.com/ethz-asl/mav_active_3d_planning/tree/master/active_3d_planning_app_reconstruction"
```
