Back to Serial Studio

Dual Drone Telemetry

examples/Dual Drone Telemetry/README.md

3.2.74.0 KB
Original Source

Dual Drone Telemetry

Multi-source drone telemetry simulator demonstrating Serial Studio's ability to receive and visualize data from two independent devices simultaneously, each with its own camera feed, GPS coordinates, flight dynamics, and battery monitoring.

Overview

Two simulated drones fly completely different flight profiles over the Nevada desert, each transmitting telemetry and synthetic camera imagery on separate UDP ports:

DronePortFlight PatternAltitudeCamera Style
Alpha9001Circular patrol (~330 m radius)120 mTop-down terrain (green/brown palette)
Bravo9002Figure-8 survey (~550 m radius)200 mThermal/IR (iron-bow palette)

Camera Feeds

Alpha Terrain — top-down patrol camera view:

  • Procedural green/brown terrain with position-based parallax
  • Roads rendered as grid lines based on GPS position
  • Targeting reticle circle with crosshair lines and heading arrow
  • Green HUD overlay with altitude, heading, and GPS coordinates

Bravo Thermal — synthetic thermal/infrared view:

  • Iron-bow color palette (black → purple → orange → yellow)
  • Moving thermal hot spots simulating heat signatures
  • Scanning line and grid overlay
  • Amber HUD overlay with FLIR label, altitude, and GPS coordinates
  • Simple crosshair at center

Telemetry per drone (11 fields)

FieldUnitsDescription
LatitudedegGPS latitude
LongitudedegGPS longitude
HeadingdegCompass heading (0-360)
AltitudemAltitude above ground
Airspeedm/sForward speed
Vertical Speedm/sClimb/descent rate
RolldegBank angle
PitchdegNose up/down angle
Battery VoltageV6S LiPo (18-25.2 V)
Current DrawAMotor + avionics current
Battery %%Remaining charge (drains over time)

Quick Start

  1. Open Dual Drone Telemetry.ssproj in Serial Studio
  2. Connect both UDP sources (ports 9001 and 9002)
  3. Run the simulator:
bash
pip install opencv-python numpy   # for camera imagery
python3 dual_drone_telemetry.py

The simulator works without opencv -- you just won't get camera images.

Command-Line Options

FlagDefaultDescription
--fps10Update rate in Hz (telemetry + camera)
--host127.0.0.1UDP destination host

Protocol Details

Both drones use hexadecimal frame delimiters with JPEG images interleaved in the same byte stream:

  • Alpha: AB CD EF (start) / FE ED (end)
  • Bravo: DE AD (start) / FE ED (end)

Each cycle sends a raw JPEG frame first, then a delimited CSV telemetry frame. The Image View widget auto-detects JPEG frames by scanning for FF D8 FF magic bytes, independent of the CSV telemetry path.

Dashboard Widgets

Each drone has six widget groups on the dashboard:

WidgetTypeDescription
CameraImage ViewLive terrain (Alpha) or thermal/IR (Bravo) camera feed
PositionMapGPS track on interactive map
HeadingCompassCompass heading indicator
AttitudeGyroscopeRoll, pitch, and yaw (heading) visualization
FlightGauges + BarsAirspeed, altitude, and vertical speed
PowerGauges + BarsBattery voltage, current draw, and charge level

Flight Models

Drone Alpha flies a steady circular patrol:

  • Constant mild bank angle (~12 deg)
  • Slow altitude oscillation (+/- 8 m)
  • Battery drain: ~0.15%/sec

Drone Bravo flies an aggressive figure-8 survey:

  • Dynamic banking (up to +/- 40 deg)
  • Higher altitude variation (+/- 15 m)
  • Faster speed, higher current draw
  • Battery drain: ~0.18%/sec

Both drones have low-battery alarms configured at 20% charge and 21V.

Requirements

  • Python 3.6+
  • opencv-python and numpy (optional, for camera imagery)
  • Serial Studio Pro (multi-source + Image View features)
<!-- SPDX-License-Identifier: GPL-3.0-only OR LicenseRef-SerialStudio-Commercial -->