Skip to content

WICON-RPTU/takeoff_echoring_simulation

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 

Repository files navigation

Takeoff Echo-Ring Simulation

Overview

The Takeoff Echo-Ring Simulation project simulates and visualizes the communication between a base station, drone, and rover using MQTT messaging and RSSI-based logic in 3D space. The system features a modern web-based 3D GUI, real-time telemetry, and is ready for integration with monitoring tools like Grafana.


Project Structure

takeoff_echoring_simulation/
├── scripts/
│   ├── main.py                # Unified launcher for all nodes and UI
│   ├── config/
│   │   └── config.yaml        # Central YAML config (3D base position, etc.)
│   ├── app/
│   │   ├── app.py             # Flask web UI (3D visualization)
│   │   ├── ui_utils.py        # MQTT bridge for Flask
│   │   └── templates/
│   │       └── index.html     # 3D Three.js GUI (Z-up, tick marks, labels)
│   ├── core/
│   │   ├── mqtt_client.py     # MQTT client wrapper
│   │   └── process_data.py    # RSSI matrix & drone placement logic (3D)
│   ├── nodes/
│   │   ├── base_station_node.py
│   │   ├── drone_node.py
│   │   └── rover_node.py
│   └── utils/
│       ├── network_sim.py     # Core RF/RSSI simulation logic (3D)
│       └── message_formats.py # Standardized MQTT message builder
├── requirements.txt
└── README.md

Features & Updates

  • 3D Simulation: All position logic, RSSI, and visualization now operate in full 3D (X, Y, Z).
  • Configurable Base Position: config.yaml defines the base station's position in 3D; this is reflected everywhere, including the web UI.
  • Modern 3D Web GUI:
    • Built with Three.js, Z-up (blue axis up), Y into the screen, X right.
    • Numeric tick marks every 10 m on the grid.
    • Name labels for all markers (Base, Drone, Rover).
    • Dark mode grid/label colors auto-adjust with system theme.
    • Click or drag to place the rover on the ground plane.
  • Unified Launcher: scripts/main.py launches all nodes and the UI in one command, with colored log prefixes.
  • MQTT-Driven: All telemetry and commands flow via MQTT topics.
  • Flask-SocketIO Bridge: Real-time updates between backend and frontend.
  • Grafana-Ready: Designed for easy integration with Grafana dashboards via MQTT→Telegraf→InfluxDB pipeline (see below).
  • Extensible: Add new nodes, topics, or visualization features with minimal changes.

Installation

  1. Clone the repository:

    git clone <repository-url>
    cd takeoff_echoring_simulation
  2. Install dependencies:

    pip install -r requirements.txt
  3. (Optional) Install system dependencies for Grafana/InfluxDB/Telegraf if you want monitoring.


Configuration

Edit scripts/config/config.yaml to set:

  • Base station position (base_position: x, y, z)
  • Drone constraints (drone_max_distance, drone_min_ground_clearance)
  • RF parameters (rssi_threshold, path_loss_exponent, etc.)

All nodes and the web UI will use these values automatically.


Usage

To launch the full simulation (nodes + UI):

python scripts/main.py

To run headless (no web UI, e.g. for CI):

python scripts/main.py --headless

To run nodes individually (advanced):

python scripts/nodes/base_station_node.py
python scripts/nodes/drone_node.py
python scripts/nodes/rover_node.py
python scripts/app/app.py

3D Web Visualization

  • Click on the ground grid to place the rover.
  • Drag the rover with the gizmo (locked to ground).
  • Live telemetry for drone and rover is shown in real time.
  • Base station position is always synced with config.
  • Grid and labels adapt to dark/light mode automatically.

Grafana Integration (Monitoring/Analytics)

To visualize MQTT telemetry in Grafana:

  1. Install Grafana, InfluxDB, and Telegraf (see their docs).
  2. Configure Telegraf to subscribe to your MQTT topics (e.g. drone/telemetry, rover/telemetry) and write to InfluxDB.
  3. Add InfluxDB as a data source in Grafana.
  4. Build dashboards to visualize position, RSSI, and more.

No code changes are needed—just configure the bridge and dashboards!


MQTT Topics

Topic Payload Example Description
drone/telemetry { "position": {"x": 1, "y": 2, "z": 3}, ... } Drone telemetry
rover/telemetry { "position": {"x": 4, "y": 5, "z": 0}, ... } Rover telemetry
drone/new_position { "x": 7, "y": 8, "z": 9 } Command to reposition drone

Dependencies

  • paho-mqtt
  • numpy
  • flask, flask-socketio
  • pyyaml
  • three.js (via CDN in the web UI)
  • matplotlib (for offline plots, optional)

License

This project is licensed under the MIT License - see the LICENSE file for details.


Contributors

About

TakeOff Echoring Simulation

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Contributors 2

  •  
  •