How wisarutlt01-commits/duck-delivery-drone works
This repository implements a DJI payload app for dynamic return-to-home landing, plus a Ground Pi-to-Drone Pi target-location link. The main workflow publishes target coordinates, transfers and validates them, then lets an operator trigger a flight-control state machine that updates the home point and go-home altitude, starts RTH, and monitors landing. The state-machine stages are represented separately to make that domain flow clear. The source excerpts are partial and there is no README content, so link wiring beyond the documented publisher/bridge flow is omitted where uncertain.
Main entry points: main.cpp RTH State Machine · publisher.py Location Publisher · bridge.py Location Bridge · rth_log.cpp RTH Logging
Components 22
RTH Flight App
- RTH State Machine
main.cpp - Widget Trigger
main.cpp - Fetch Target
main.cpp - Set Home
main.cpp - Set Altitude
main.cpp - Start Go-Home
main.cpp - Monitor RTH
main.cpp - Wait Landing
main.cpp - Flight Telemetry
main.cpp
Location Link
- Location Publisher
tools/location_link/publisher.py - Config Loader
tools/location_link/config.py - Packet Codec
tools/location_link/packet.py - Transport Adapters
tools/location_link/transport.py - Location Bridge
tools/location_link/bridge.py
DJI Platform Services
- DJI Pilot Widget
- RTH Logging
rth_log.cpp
Other components
- Pilot
- Ground Location Source
- Target Location File
- DJI Flight Controller
- DJI HMS Alerts
- Pilot Notifications
Connections 28
- Ground Location Source → Location Publisher: provides coordinates
- Location Publisher → Config Loader: loads settings
- Location Publisher → Packet Codec: encodes coordinates
- Location Publisher → Transport Adapters: sends packets
- Transport Adapters → Location Bridge: delivers packets
- Location Bridge → Config Loader: loads settings
- Location Bridge → Packet Codec: decodes packets
- Location Bridge → Target Location File: writes latest location
- Pilot → Widget Trigger: presses
- Widget Trigger → RTH State Machine: signals trigger
- RTH State Machine → Fetch Target: dispatches
- Fetch Target → Target Location File: reads coordinates
- RTH State Machine → Set Home: dispatches
- RTH State Machine → Set Altitude: dispatches
- RTH State Machine → Start Go-Home: dispatches
- RTH State Machine → Monitor RTH: dispatches
- RTH State Machine → Wait Landing: dispatches
- RTH State Machine → Flight Telemetry: subscribes to
- Set Home → DJI Flight Controller: sets home point
- Set Altitude → DJI Flight Controller: sets go-home altitude
- Start Go-Home → DJI Flight Controller: starts RTH
- Monitor RTH → DJI Flight Controller: checks flight state
- Flight Telemetry → DJI Flight Controller: subscribes topics
- RTH State Machine → RTH Logging: reports events
- RTH Logging → DJI Pilot Widget: shows messages
- RTH Logging → DJI HMS Alerts: injects alerts
- DJI HMS Alerts → Pilot Notifications: notifies pilot
- DJI Pilot Widget → Pilot Notifications: displays status