This repository contains a two-part Python MVP for AEAC 2026 Task 1:
transmitter.pyruns on the drone-side computer, reads MAVLink downward range and attitude data, captures aligned RGB and depth from an OAK-D Pro, and serves both over TCP.receiver.pyruns on the operator laptop, requests an image plus depth map, displays telemetry, and uses clicked points in the image to derive metric offsets from OAK-D depth.
transmitter.py: TCP RGB/depth server, OAK-D Pro capture, MAVLink readerreceiver.py: Tkinter desktop client for capture, depth-aware measurement, and output generationrequirements.txt: Python dependencies for both scripts
- Python 3.10 or newer
- An OAK-D Pro connected to the transmitter machine
- MAVLink telemetry available over UDP from the flight controller
- Tk support for Python on the receiver machine
Install Python packages with:
python -m venv .venv
source .venv/bin/activate
pip install -r requirements.txtThe project uses these third-party Python packages:
depthainumpyopencv-pythonPillowpymavlink
tkinter is also required by receiver.py, but it normally ships with the system Python rather than being installed from requirements.txt.
- The receiver opens a TCP connection to the transmitter and sends a 1-byte capture command:
b"C". - The transmitter waits until the latest MAVLink pitch is close to level.
- The transmitter captures an RGB frame and an aligned depth frame from the OAK-D Pro.
- The transmitter sends a binary header containing:
- downward rangefinder distance
- center-pixel depth estimate
- pitch in radians
- roll in radians
- JPEG byte length
- depth PNG byte length
- The receiver downloads the JPEG and 16-bit depth map, displays the RGB image, and uses depth sampled at clicked points for aided or manual measurement workflows.
Both scripts are currently configured with constants near the top of each file.
Important settings:
HOST/PORT: TCP server bind address and portFRAME_WIDTH/FRAME_HEIGHT: capture resolutionJPEG_QUALITY: transmitted JPEG qualityDEPTH_PNG_COMPRESSION: PNG compression level used for the transmitted depth mapFC_ADDR: MAVLink UDP endpoint, for exampleudpout:192.168.144.14:14550PITCH_LEVEL_TOLERANCE_RAD: pitch tolerance before an image is captured
Important settings:
TRANSMITTER_HOST/TRANSMITTER_PORT: address of the transmitter machineSOCKET_TIMEOUT: network timeout in secondsCAMERA_HFOV_RAD/CAMERA_VFOV_RAD: camera field-of-view values used for geometric calculationsFISHEYE_EDGE_FACTOR: optional edge correction factor for lens distortion
Adjust these constants before running on real hardware.
Run this on the drone-side computer:
python transmitter.pyBehavior:
- starts a TCP server on port
5000 - connects to the configured MAVLink UDP endpoint
- requests
RANGEFINDER,DISTANCE_SENSOR, andATTITUDEstreams - waits for capture requests from the receiver
Run this on the operator computer:
python receiver.pyBehavior:
- opens a Tkinter GUI
- requests a frame from the transmitter when
Capture imageis pressed - displays downward range and center depth plus pitch and roll
- supports:
Aidedmode for generating an output sentence after selecting a target and reference pointFull manualmode for measuring vertical and sideways offsets between two selected points
- The transmitter currently handles one TCP client at a time.
- If pitch data is not available, the transmitter will wait indefinitely for a level state before capturing.
receiver.pyassumes the first transmitted float is downward distance and the second is the center depth estimate.- The receiver de-rotates both the image and depth map using the reported roll before performing measurements.
- Start
transmitter.pyon the drone-side device. - Confirm camera access and MAVLink telemetry are working.
- Update
TRANSMITTER_HOSTinreceiver.pyto point to the transmitter machine. - Start
receiver.pyon the operator machine. - Press
Capture image. - Use the GUI to select points and read or generate the required output.