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.
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
- 3D Simulation: All position logic, RSSI, and visualization now operate in full 3D (X, Y, Z).
- Configurable Base Position:
config.yamldefines 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.pylaunches 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.
-
Clone the repository:
git clone <repository-url> cd takeoff_echoring_simulation
-
Install dependencies:
pip install -r requirements.txt
-
(Optional) Install system dependencies for Grafana/InfluxDB/Telegraf if you want monitoring.
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.
To launch the full simulation (nodes + UI):
python scripts/main.py- This starts the base station, drone, and Flask 3D web UI.
- Open http://localhost:5000 in your browser.
To run headless (no web UI, e.g. for CI):
python scripts/main.py --headlessTo 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- 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.
To visualize MQTT telemetry in Grafana:
- Install Grafana, InfluxDB, and Telegraf (see their docs).
- Configure Telegraf to subscribe to your MQTT topics (e.g.
drone/telemetry,rover/telemetry) and write to InfluxDB. - Add InfluxDB as a data source in Grafana.
- Build dashboards to visualize position, RSSI, and more.
No code changes are needed—just configure the bridge and dashboards!
| 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 |
paho-mqttnumpyflask,flask-socketiopyyamlthree.js(via CDN in the web UI)matplotlib(for offline plots, optional)
This project is licensed under the MIT License - see the LICENSE file for details.