# acsl-tcu/common_matlab architecture

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

- Interactive diagram: https://gitdiagram.com/acsl-tcu/common_matlab
- Repository: https://github.com/acsl-tcu/common_matlab

## Overview

This repository is a MATLAB drone and multi-agent control framework, with simulation/experiment modes, configurable agent components, and PX4 embedded artifacts. The README describes an agent configured with plant/model, sensors, estimator, reference, controller, input transform, connector, and parameters; estimator, reference, and controller can be cascaded. The tree shows additional estimation, environment, and analysis capabilities, but their runtime wiring is not established by the sampled material. Generated-code modules are represented compactly; unsampled relationships are omitted.

Main entry points: [`DRONE.m`](https://github.com/acsl-tcu/common_matlab/blob/main/DRONE.m) (Configured agent), [`reference`](https://github.com/acsl-tcu/common_matlab/tree/main/reference) (Reference generation), [`controller`](https://github.com/acsl-tcu/common_matlab/tree/main/controller) (Flight controllers), [`estimator`](https://github.com/acsl-tcu/common_matlab/tree/main/estimator) (State estimation)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_workflow["Agent workflow"]
  node_agent["Configured agent<br/>[DRONE.m]"]
  node_modes["Simulation / experiment modes"]
end

subgraph group_domain["Flight domains"]
  node_model["Plant and models"]
  node_reference["Reference generation"]
  node_controller["Flight controllers"]
  node_estimator["State estimation"]
end

subgraph group_support["Runtime support"]
  node_sensor["Sensors"]
  node_environment["Environment maps"]
  node_transform["Input transforms"]
  node_connector["Device connectors"]
  node_logger["Logging and replay"]
  node_analysis["Data analysis"]
end

subgraph group_embedded["PX4 artifacts"]
  node_px4pid["PX4 PID runtime<br/>[PX4_PID.cpp]"]
  node_directinput["PX4 direct input"]
end

node_user(("Engineer / operator"))

node_user -->|"configures"| node_agent
node_agent -->|"sets plant/model"| node_model
node_agent -->|"sets sensors"| node_sensor
node_agent -->|"sets estimator"| node_estimator
node_agent -->|"sets reference"| node_reference
node_agent -->|"sets controller"| node_controller
node_agent -->|"sets transform"| node_transform
node_agent -->|"sets connector"| node_connector
node_estimator -->|"cascades by name"| node_estimator
node_reference -->|"cascades by name"| node_reference
node_controller -->|"cascades by name"| node_controller
node_logger -->|"saves / loads"| node_logger

click node_agent "https://github.com/acsl-tcu/common_matlab/blob/main/DRONE.m"
click node_modes "https://github.com/acsl-tcu/common_matlab/tree/main/mode"
click node_model "https://github.com/acsl-tcu/common_matlab/tree/main/model"
click node_reference "https://github.com/acsl-tcu/common_matlab/tree/main/reference"
click node_controller "https://github.com/acsl-tcu/common_matlab/tree/main/controller"
click node_estimator "https://github.com/acsl-tcu/common_matlab/tree/main/estimator"
click node_sensor "https://github.com/acsl-tcu/common_matlab/tree/main/sensor"
click node_environment "https://github.com/acsl-tcu/common_matlab/tree/main/environment"
click node_transform "https://github.com/acsl-tcu/common_matlab/tree/main/input_tranform"
click node_connector "https://github.com/acsl-tcu/common_matlab/tree/main/connector"
click node_logger "https://github.com/acsl-tcu/common_matlab/tree/main/assets/logger"
click node_analysis "https://github.com/acsl-tcu/common_matlab/tree/main/Data/%40DATA_ANALYZER"
click node_px4pid "https://github.com/acsl-tcu/common_matlab/blob/main/PX4_PID_ert_rtw/PX4_PID.cpp"
click node_directinput "https://github.com/acsl-tcu/common_matlab/blob/main/direct_moter_input_ert_rtw/direct_moter_input.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_agent,node_modes toneBlue
class node_model,node_reference,node_controller,node_estimator toneAmber
class node_sensor,node_environment,node_transform,node_connector,node_logger,node_analysis toneMint
class node_px4pid,node_directinput toneRose
class node_user toneIndigo
```

## Components

### Agent workflow

- [Configured agent](https://github.com/acsl-tcu/common_matlab/blob/main/DRONE.m): `DRONE.m`
- [Simulation / experiment modes](https://github.com/acsl-tcu/common_matlab/tree/main/mode): `mode`

### Flight domains

- [Plant and models](https://github.com/acsl-tcu/common_matlab/tree/main/model): `model`
- [Reference generation](https://github.com/acsl-tcu/common_matlab/tree/main/reference): `reference`
- [Flight controllers](https://github.com/acsl-tcu/common_matlab/tree/main/controller): `controller`
- [State estimation](https://github.com/acsl-tcu/common_matlab/tree/main/estimator): `estimator`

### Runtime support

- [Sensors](https://github.com/acsl-tcu/common_matlab/tree/main/sensor): `sensor`
- [Environment maps](https://github.com/acsl-tcu/common_matlab/tree/main/environment): `environment`
- [Input transforms](https://github.com/acsl-tcu/common_matlab/tree/main/input_tranform): `input_tranform`
- [Device connectors](https://github.com/acsl-tcu/common_matlab/tree/main/connector): `connector`
- [Logging and replay](https://github.com/acsl-tcu/common_matlab/tree/main/assets/logger): `assets/logger`
- [Data analysis](https://github.com/acsl-tcu/common_matlab/tree/main/Data/%40DATA_ANALYZER): `Data/@DATA_ANALYZER`

### PX4 artifacts

- [PX4 PID runtime](https://github.com/acsl-tcu/common_matlab/blob/main/PX4_PID_ert_rtw/PX4_PID.cpp): `PX4_PID_ert_rtw/PX4_PID.cpp`
- [PX4 direct input](https://github.com/acsl-tcu/common_matlab/blob/main/direct_moter_input_ert_rtw/direct_moter_input.cpp): `direct_moter_input_ert_rtw/direct_moter_input.cpp`

### Other components

- **Engineer / operator**

## Connections

- Engineer / operator → Configured agent: configures
- Configured agent → Plant and models: sets plant/model
- Configured agent → Sensors: sets sensors
- Configured agent → State estimation: sets estimator
- Configured agent → Reference generation: sets reference
- Configured agent → Flight controllers: sets controller
- Configured agent → Input transforms: sets transform
- Configured agent → Device connectors: sets connector
- State estimation → State estimation: cascades by name
- Reference generation → Reference generation: cascades by name
- Flight controllers → Flight controllers: cascades by name
- Logging and replay → Logging and replay: saves / loads
