Case study · National defence agency

Offline location API for unmanned service delivery

I built the API and mission services that let unmanned aircraft carry out precise delivery runs, from take-off to drop point and back, with no dependence on internet connectivity.

  • 1,200+missions completed
  • 98.6%mission success rate
  • 1.5 mdelivery precision
  • 900+flight hours between critical faults, up from 40

Challenge

  • Missions had to run where networks are absent or unreliable, so every location lookup and decision had to work fully offline.
  • Deliveries had to reach exact coordinates and return safely, so reliability mattered more than raw speed.
  • The programme moved from fully autonomous flight to a fibre-optic linked mode, and the software had to support both without a rewrite.

What I built

  • An offline geospatial API serving maps, elevation, waypoints and restricted areas from data packaged and verified before each deployment.
  • Mission lifecycle services: plan, validate, launch, track, deliver and return, with explicit states and safe fallbacks at each step.
  • A link-agnostic communications layer, so the same mission logic runs over autonomous on-board control or a fibre-optic link.
  • Reliability engineering: health checks, watchdogs, retry and failover logic, and full telemetry logs for post-mission review.
  • Intelligent system components for route planning and in-flight decisions, tested in simulation before field trials.

Stack

Go, Python, C++ for on-board components, ROS 2, PX4/MAVLink, PostGIS, SQLite/SpatiaLite and MBTiles for offline data, gRPC and Protocol Buffers, Gazebo simulation, Docker on edge hardware, embedded Linux.

System design

The system has three layers: a ground mission service, an on-board companion computer and the flight controller. Each layer can keep the aircraft safe if the one above it stops responding.

Three layers: a ground mission service, an on-board companion computer and the flight controllerOn the aircraftgRPCautonomous mode orfibre-optic modegRPCMAVLinkPack builderPython, signs the packOffline data packMBTiles, SpatiaLiteGeospatial APIGo, gRPC, never makes anetwork callGround mission serviceGo, rugged edge computerCompanion computerROS 2 nodes, mission statemachinePX4 flight controllerfailsafe: hold, return or landGazebo simulationPX4 software-in-the-loop
  1. Layers: the ground mission service (Go) runs on a rugged edge computer. On the aircraft, a companion computer runs ROS 2 nodes for mission logic. A PX4 flight controller handles low-level flight, and the companion talks to it over MAVLink.
  2. Offline data packs: before deployment, a Python pack builder assembles map tiles (MBTiles), elevation data, restricted areas and safe landing zones (SpatiaLite) for the operating area. It signs the pack and records a checksum, and devices refuse packs that are unsigned, altered or expired.
  3. Geospatial API: a Go service, called over gRPC, answers every location question from the local pack: whether a route is feasible, elevation along a path, restricted-area checks and the nearest safe landing zone. It never makes a network call.
  4. Mission state machine: each mission moves through fixed states (planned, validated, armed, outbound, delivering, returning, landed, closed), plus hold and abort. Every transition has preconditions such as battery level, link health and geofence, so an unsafe transition cannot happen. State is saved, so a restart resumes the mission where it was.
  5. Link abstraction: mission logic talks to one transport interface with two implementations. In autonomous mode the aircraft carries the full mission and completes it without a ground link, sending telemetry back when it can. In fibre-optic mode a physical cable gives a continuous, stable link. Switching modes is configuration, not new code.
  6. Reliability: every process has a watchdog, and the companion and flight controller exchange heartbeats. Failsafe behaviour (hold, return or land at a safe zone) is set in PX4 from the mission plan, so it works even if the companion fails. Telemetry is logged on board and on the ground for review after each mission.
  7. Intelligent components: a route planner searches a cost grid built from elevation and restricted areas. Every change runs through PX4 software-in-the-loop simulation in Gazebo, and continuous integration runs a set of simulated missions, before any field trial.

Results

  • Missions: 1,200+ completed, with a 98.6% success rate
  • Precision: deliveries within 1.5 metres of target
  • Offline operation: 100% of mission functions available with no network
  • Link change: autonomous to fibre-optic mode shipped in 6 weeks on the same codebase
  • Reliability: mean time between critical faults up from 40 to 900+ flight hours
Back to Work & Research