# kennethyangle/guidance_ws architecture

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

- Interactive diagram: https://gitdiagram.com/kennethyangle/guidance_ws
- Repository: https://github.com/kennethyangle/guidance_ws

## Overview

This repository implements monocular-vision velocity estimation for multicopters, with AirSim simulation and ROS flight-experiment support. The principal workflow is to provide camera and sensor data to an optical-flow estimator, then use velocity-estimation nodes to produce motion estimates; users can run the simulation, record and replay data, or launch the flight setup. The graph includes the documented simulation and flight branches and the sampled estimator variants. Several simulation helpers and launch configurations are represented by their enclosing directories because their source was not sampled.

Main entry points: [`src/airsim_environment/shell`](https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment/shell) (Record and replay), [`src/airsim_environment`](https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment) (AirSim environment), [`src/rfly_navigation/main.cpp`](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_navigation/main.cpp) (Velocity fusion), [`src/airsim_keyboard_controller/src/keyboard_controller.py`](https://github.com/kennethyangle/guidance_ws/blob/master/src/airsim_keyboard_controller/src/keyboard_controller.py) (Keyboard interface)

## Diagram (Mermaid)

```mermaid
flowchart TD

subgraph group_sim["Simulation and data"]
  node_sim_env["AirSim environment"]
  node_sim_helper["Simulation helpers"]
  node_sim_scripts["Record and replay"]
  node_visualization["Result visualization<br/>[result.py]"]
end

subgraph group_control["Vehicle control"]
  node_keyboard_ui["Keyboard interface"]
  node_drone_ctrl["Drone command node"]
end

subgraph group_flow["Optical flow"]
  node_phase_flow["Phase correlation flow<br/>[main.cpp]"]
  node_orb_flow["ORB feature flow<br/>[main.cpp]"]
  node_pyramid_flow["Pyramid flow<br/>[main.cpp]"]
  node_orb_pyramid["ORB pyramid flow<br/>[main.cpp]"]
  node_orb_pyramid_full["Combined pyramid variant<br/>[main.cpp]"]
  node_orb_only["ORB-only variant<br/>[main.cpp]"]
  node_pyramid_only["Pyramid-only variant<br/>[main.cpp]"]
end

subgraph group_estimate["Velocity estimation"]
  node_nav["Velocity fusion<br/>[main.cpp]"]
  node_nav2["Navigation estimator<br/>[main.cpp]"]
  node_nav_guidance["Guidance estimator<br/>[main_guidance.cpp]"]
  node_est_helpers["Estimation utilities"]
end

subgraph group_flight["Flight setup"]
  node_flight_launch["Flight launch profiles"]
end

node_user(("Operator"))
node_airsim["AirSim simulator"]
node_guidance["Guidance ROS sensors"]

node_user -->|"starts simulation"| node_sim_env
node_sim_env -->|"runs with"| node_airsim
node_user -->|"controls drone"| node_keyboard_ui
node_keyboard_ui -->|"sends commands"| node_drone_ctrl
node_drone_ctrl -.->|"publishes commands"| node_airsim
node_user -->|"records or replays"| node_sim_scripts
node_sim_scripts -.->|"runs utilities"| node_sim_helper
node_sim_scripts -->|"views results"| node_visualization
node_airsim -.->|"provides simulation"| node_sim_env
node_guidance -.->|"provides images"| node_phase_flow
node_guidance -->|"provides images"| node_orb_flow
node_guidance -->|"provides images"| node_pyramid_flow
node_guidance -->|"provides images"| node_orb_pyramid
node_guidance -->|"provides images"| node_orb_pyramid_full
node_guidance -->|"provides images"| node_orb_only
node_guidance -->|"provides images"| node_pyramid_only
node_guidance -->|"provides sensor data"| node_nav
node_phase_flow -.->|"publishes flow input"| node_nav
node_user -->|"starts flight setup"| node_flight_launch
node_flight_launch -.->|"launches estimator"| node_nav_guidance
node_nav -.->|"publishes velocity estimate"| node_user
node_nav2 -.->|"produces estimates"| node_user
node_nav_guidance -.->|"produces estimates"| node_user

click node_sim_env "https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment"
click node_sim_helper "https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment/src"
click node_sim_scripts "https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment/shell"
click node_keyboard_ui "https://github.com/kennethyangle/guidance_ws/blob/master/src/airsim_keyboard_controller/src/keyboard_controller.py"
click node_drone_ctrl "https://github.com/kennethyangle/guidance_ws/blob/master/src/airsim_keyboard_controller/src/drone_controller.py"
click node_phase_flow "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_phase/main.cpp"
click node_orb_flow "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb/main.cpp"
click node_pyramid_flow "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_pyramids/main.cpp"
click node_orb_pyramid "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/main.cpp"
click node_orb_pyramid_full "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/complete%20code/main.cpp"
click node_orb_only "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/orb%20only/main.cpp"
click node_pyramid_only "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/pyramids%20only/main.cpp"
click node_nav "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_navigation/main.cpp"
click node_nav2 "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_navigation2/main.cpp"
click node_nav_guidance "https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_navigation2/main_guidance.cpp"
click node_est_helpers "https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment/src"
click node_flight_launch "https://github.com/kennethyangle/guidance_ws/tree/master/src/rfly_launch/launch"
click node_visualization "https://github.com/kennethyangle/guidance_ws/blob/master/src/airsim_environment/src/result.py"

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_sim_env,node_sim_helper,node_sim_scripts,node_visualization toneBlue
class node_keyboard_ui,node_drone_ctrl toneAmber
class node_phase_flow,node_orb_flow,node_pyramid_flow,node_orb_pyramid,node_orb_pyramid_full,node_orb_only,node_pyramid_only toneMint
class node_nav,node_nav2,node_nav_guidance,node_est_helpers toneRose
class node_flight_launch,node_user,node_airsim,node_guidance toneIndigo
```

## Components

### Simulation and data

- [AirSim environment](https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment): `src/airsim_environment`
- [Simulation helpers](https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment/src): `src/airsim_environment/src`
- [Record and replay](https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment/shell): `src/airsim_environment/shell`
- [Result visualization](https://github.com/kennethyangle/guidance_ws/blob/master/src/airsim_environment/src/result.py): `src/airsim_environment/src/result.py`

### Vehicle control

- [Keyboard interface](https://github.com/kennethyangle/guidance_ws/blob/master/src/airsim_keyboard_controller/src/keyboard_controller.py): `src/airsim_keyboard_controller/src/keyboard_controller.py`
- [Drone command node](https://github.com/kennethyangle/guidance_ws/blob/master/src/airsim_keyboard_controller/src/drone_controller.py): `src/airsim_keyboard_controller/src/drone_controller.py`

### Optical flow

- [Phase correlation flow](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_phase/main.cpp): `src/rfly_phase/main.cpp`
- [ORB feature flow](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb/main.cpp): `src/rfly_orb/main.cpp`
- [Pyramid flow](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_pyramids/main.cpp): `src/rfly_pyramids/main.cpp`
- [ORB pyramid flow](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/main.cpp): `src/rfly_orb_pyramids/main.cpp`
- [Combined pyramid variant](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/complete%20code/main.cpp): `src/rfly_orb_pyramids/complete code/main.cpp`
- [ORB-only variant](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/orb%20only/main.cpp): `src/rfly_orb_pyramids/orb only/main.cpp`
- [Pyramid-only variant](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_orb_pyramids/pyramids%20only/main.cpp): `src/rfly_orb_pyramids/pyramids only/main.cpp`

### Velocity estimation

- [Velocity fusion](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_navigation/main.cpp): `src/rfly_navigation/main.cpp`
- [Navigation estimator](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_navigation2/main.cpp): `src/rfly_navigation2/main.cpp`
- [Guidance estimator](https://github.com/kennethyangle/guidance_ws/blob/master/src/rfly_navigation2/main_guidance.cpp): `src/rfly_navigation2/main_guidance.cpp`
- [Estimation utilities](https://github.com/kennethyangle/guidance_ws/tree/master/src/airsim_environment/src): `src/airsim_environment/src`

### Flight setup

- [Flight launch profiles](https://github.com/kennethyangle/guidance_ws/tree/master/src/rfly_launch/launch): `src/rfly_launch/launch`

### Other components

- **Operator**
- **AirSim simulator**
- **Guidance ROS sensors**

## Connections

- Operator → AirSim environment: starts simulation (evidence: `README.md`)
- AirSim environment → AirSim simulator: runs with (evidence: `README.md`)
- Operator → Keyboard interface: controls drone (evidence: `README.md`)
- Keyboard interface → Drone command node: sends commands (evidence: `src/airsim_keyboard_controller/src/keyboard_controller.py`)
- Drone command node → AirSim simulator: publishes commands
- Operator → Record and replay: records or replays (evidence: `README.md`)
- Record and replay → Simulation helpers: runs utilities
- Record and replay → Result visualization: views results (evidence: `README.md`)
- AirSim simulator → AirSim environment: provides simulation
- Guidance ROS sensors → Phase correlation flow: provides images
- Guidance ROS sensors → ORB feature flow: provides images (evidence: `src/rfly_orb/main.cpp`)
- Guidance ROS sensors → Pyramid flow: provides images (evidence: `src/rfly_pyramids/main.cpp`)
- Guidance ROS sensors → ORB pyramid flow: provides images (evidence: `src/rfly_orb_pyramids/main.cpp`)
- Guidance ROS sensors → Combined pyramid variant: provides images (evidence: `src/rfly_orb_pyramids/complete code/main.cpp`)
- Guidance ROS sensors → ORB-only variant: provides images (evidence: `src/rfly_orb_pyramids/orb only/main.cpp`)
- Guidance ROS sensors → Pyramid-only variant: provides images (evidence: `src/rfly_orb_pyramids/pyramids only/main.cpp`)
- Guidance ROS sensors → Velocity fusion: provides sensor data (evidence: `src/rfly_navigation/main.cpp`)
- Phase correlation flow → Velocity fusion: publishes flow input
- Operator → Flight launch profiles: starts flight setup (evidence: `README.md`)
- Flight launch profiles → Guidance estimator: launches estimator
- Velocity fusion → Operator: publishes velocity estimate
- Navigation estimator → Operator: produces estimates
- Guidance estimator → Operator: produces estimates
