# henryburon/terra-flight architecture

> Architecture diagram of the GitHub repository henryburon/terra-flight, generated by GitDiagram from its file tree, README and a sample of source files (last updated 2025-03-31). It is an AI-made overview: check details against the source.

- Interactive diagram: https://gitdiagram.com/henryburon/terra-flight
- Repository: https://github.com/henryburon/terra-flight

## Overview

##### Project Type and Purpose
- This is a full-stack robotic control application with both hardware and simulation aspects. It manages a mobile rover (with on-board sensors like LiDAR and cameras) and a deployable drone (DJI Tello) that can autonomously re-land on the rover.
- The system is controlled via ROS 2 Iron running on both a base station (laptop) and a Raspberry Pi on the robot, with WiFi networks connecting the components.

##### File Structure
- The top-level files (e.g., .gitignore, citations.txt, README.md) give you context.
- Two major directories are visible: "terraflight_control" and "terraflight_description". The former contains configuration files, launch files (for the base station, drone, and robot), Python modules (e.g., drone.py, robot_control.py, odom_node.py), and tests. The latter contains the URDF (in the urdf directory), RViz config, meshes for the robot’s parts, and its own launch files.
- Key configuration files include YAML for parameters and XML/py launch files that indicate how different subsystems are started.
- The presence of scripts like base_station.py, drone.py, and specialized nodes (robot_camera.py, robot_control.py) hints at distinct processes playing different roles in the system.

## Diagram (Mermaid)

```mermaid
flowchart TD
    %% Hardware/Field Layer
    subgraph "Hardware/Field Layer"
        AA["Rover Platform (Raspberry Pi)"]:::hardware
        AB["Drone (DJI Tello)"]:::hardware
        AC["WiFi Connectivity"]:::hardware
    end

    %% Software/Application Layer
    subgraph "Software/Application Layer"
        BA["Base Station"]:::software
        subgraph "Rover Control Nodes"
            BB["Robot Control"]:::software
            BC["Odometry Node"]:::software
            BD["Robot Camera"]:::software
        end
        BE["Drone Control Node"]:::software
        BF["ROS2 Middleware (ROS 2 Iron)"]:::middleware
    end

    %% Simulation/Visualization Layer
    subgraph "Simulation/Visualization Layer"
        CA["URDF/RViz Setup"]:::simulation
    end

    %% Connections between layers
    BA -->|"launch_commands"| BF
    BB -->|"publishes_data"| BF
    BC -->|"publishes_data"| BF
    BD -->|"publishes_data"| BF
    BE -->|"publishes_data"| BF

    BF -->|"control_signals"| AA
    BF -->|"drone_commands"| AB
    AA -->|"sensor_data"| BA
    AB -->|"telemetry_video"| BA

    %% WiFi connectivity supports communication
    AC --- BA
    AC --- AA
    AC --- AB

    %% Visualization data flow
    BF -->|"visualization_stream"| CA

    %% Click Events for Base Station
    click BA "https://github.com/henryburon/terra-flight/blob/main/terraflight_control/launch/base_station.launch.xml"
    click BA "https://github.com/henryburon/terra-flight/blob/main/terraflight_control/terraflight_control/base_station.py"

    %% Click Events for Robot Control Node Components
    click BB "https://github.com/henryburon/terra-flight/blob/main/terraflight_control/terraflight_control/robot_control.py"
    click BC "https://github.com/henryburon/terra-flight/blob/main/terraflight_control/terraflight_control/odom_node.py"
    click BD "https://github.com/henryburon/terra-flight/blob/main/terraflight_control/terraflight_control/robot_camera.py"

    %% Click Events for Drone Control Node
    click BE "https://github.com/henryburon/terra-flight/blob/main/terraflight_control/terraflight_control/drone.py"
    click BE "https://github.com/henryburon/terra-flight/blob/main/terraflight_control/launch/drone.launch.xml"

    %% Click Events for URDF/RViz Setup
    click CA "https://github.com/henryburon/terra-flight/blob/main/terraflight_description/urdf/terraflight.urdf.xacro"
    click CA "https://github.com/henryburon/terra-flight/blob/main/terraflight_description/config/view_terraflight.rviz"
    click CA "https://github.com/henryburon/terra-flight/blob/main/terraflight_description/launch/show_terraflight.launch.py"

    %% Styles
    classDef hardware fill:#f9f,stroke:#333,stroke-width:2px;
    classDef software fill:#ccf,stroke:#333,stroke-width:2px;
    classDef simulation fill:#cfc,stroke:#333,stroke-width:2px;
    classDef middleware fill:#fc9,stroke:#333,stroke-width:2px;
```
