Every segment gets a score.
The planner splits each water edge into segments and ranks them, so the next patrol flies where the risk has grown.
Each segment has a side, a length, the views it needs and the items it should hold: fence runs, covers, gratings, gates, ring buoys and signs. From the camera footprint and overlap, the planner derives offset flight lines and camera stations for every selected segment.
priority = 0.25 × expiry + 0.35 × reviewed flag + 0.25 × rain + 0.15 × water level
| Part | Weight | What it reads |
|---|---|---|
| Expiry | 0.25 | The segment's pass expiry |
| Reviewed flag | 0.35 | The highest human-reviewed open flag on the segment |
| Rain | 0.25 | Recent rain, in the JPS one-hour categories: light 1–10 mm, moderate 11–30 mm, heavy 31–60 mm, very heavy above 60 mm |
| Water level | 0.15 | The latest water level reading |
Each part runs from 0 to 1, and the screen shows every part. A missing or stale input shows “unknown” and asks for review; it never scores zero. The weights are a product hypothesis, to tune with SDP.
A route the battery can fly.
The route grows one segment at a time, taking the best priority per watt-hour, until the battery says stop.
- Each step adds the feasible task with the highest added priority per added watt-hour.
- The drone always keeps a return path to its dock, with a battery reserve.
- Geofences are hard constraints: no-fly areas, and homes and playgrounds as no-capture zones.
- Segments left out are listed, each with its reason.
The battery model in the simulation is a stated assumption until an aircraft is chosen.
When the plan changes
The planner re-plans the part of the route not yet flown, and re-orders only uncommitted stops, when:
- a JPS heavy-rain reading or a data.gov.my weather warning comes in;
- a manager confirms a new flag;
- a pass comes within 30 days of expiry;
- someone reports damage;
- a repair is completed, which queues a re-test patrol.
Fly when the park is empty.
Every plan fits an agreed flight window, and holds when the weather or the airspace says no.
| Window or hold | What the plan does |
|---|---|
| First light | The default window, while the park is empty. |
| Next dry window | No launch above the dock's 2 mm/h rain limit. After heavy rain, the next dry morning comes first. |
| Lightning hold | No launch during a lightning warning. |
| Altitude cap | The plan carries the altitude cap that air traffic control sets. |
Subang averaged 211.8 rain days a year from 2020 to 2024 and logged 289 lightning days in 2024, so patrols fly the next dry window, usually the next morning.
50 m from people. A pilot who can always intervene.
Flights are automated, never fully autonomous. CAAM does not allow operations where the remote pilot cannot intervene.
A plan becomes a flight only after a user with the pilot role approves it. A patrol from an unapproved
plan cannot start: the API refuses it and names the rule, plan_not_approved.
The whole flight keeps the distances of CAR 2016 regulation 143:
| Distance | From | When |
|---|---|---|
| 50 m | People, vehicles and structures not under the pilot's control | At camera stations, along flight lines and on transits |
| 30 m | People | During the climb from the dock and the descent onto it |
| 150 m | An open-air assembly of more than 1,000 persons | The whole flight |
A camera station with people near it waits for a clear pass or moves to a longer zoom stand-off. A stop whose transit passes people waits for them, and the dock holds take-off while its climb or transits are not clear. The pilot or observer confirms the path is clear.
Missions export, marked not flight-ready.
A planned route exports as a DJI WPML KMZ and a QGroundControl .plan, both stamped “not
flight-ready”.
| Format | Files | For |
|---|---|---|
| DJI WPML KMZ | wpmz/template.kml, wpmz/waylines.wpml |
DJI Pilot 2 |
| QGroundControl plan | .plan JSON |
QGroundControl |
Every file says NOT FLIGHT-READY: a format sample generated from a Safe Edge patrol plan, not validated on any aircraft or ground station. Neither format holds a time window or a hold, so the notice carries the plan's window and the places that wait for a person to confirm the path clear. A remote pilot reviews and approves every live flight.
# Plan a demo patrol over the real Elmina water edges; write the KMZ and the .plan
bun run export:mission ./missions
# Open the .plan with MAVSDK's QGroundControl importer, as CI does
bun run check:qgc-plan
From simulation to docked patrols.
Today the drone is a labelled simulation. Real flights wait for their approvals.
| Phase | When | How it flies | What it needs |
|---|---|---|---|
| 0. Hackathon simulation | By 23 Oct 2026 | No real flight. A CAAM Standard ATF needs at least 14 working days. | Labelled simulation on real Elmina map data, plus one real phone patrol at a permitted site |
| 0.5. Phone patrol | From the start, and wherever a drone cannot fly | The walk crew photographs the fixed viewpoints each week on a phone | SDP permission and a photo protocol; no aviation approval |
| 1. Pilot, one water asset | About 2 months of approvals, then 8 weeks of flying | Visual-line-of-sight patrols by a licensed hired operator, bundling several assets per sortie, plus the next dry window after heavy rain | Standard ATF (RM250 per aircraft per location area, up to 90 days), SDP landowner letter, JUPEM imagery approval where required, MBSA's drone request, a data protection impact assessment, Subang air-traffic coordination and a remote-pilot SOP |
| 2. Docked patrols | Only if CAAM accepts a safety case for a residential control zone | A dock on a facility roof (a management office or Elmina Lakeside Mall, not the open park) launches supervised BVLOS patrols | A CAAM Special UAS Project with a SORA or PDRA safety case and liability insurance |
No drone? The phone patrol.
The protocol, not the aircraft, is the product. Where a drone cannot fly, the walk crew captures the same fixed viewpoints on a phone.
A phone screen walks the crew to each fixed viewpoint, ghosts the baseline photo over the camera, and sends the new photo into Edge Watch exactly like a drone image. The Inbox, Fix Lens and the proof stay the same. It runs today with no aviation approval, so a pilot can start before the first flight.
The proposed thresholds to stop or scale back the drone layer: false flags stay above 10 per patrol by week 4, less than 80% of the planned edge length is inspected, or an approval is refused. The phone patrol then carries the loop.
Elmina sits on the Subang approach.
A mapped point in Elmina Central Park is about 6.5 km from Subang airport, inside its Class C control zone.
In August 2023 an aircraft crashed in Elmina two minutes before its scheduled landing at Subang. Expect altitude caps, per-flight calls to air traffic control and refused windows. None of CAAM's published dock approvals is in a residential control zone.
Docks already fly in Malaysia: CAAM has published dock-based BVLOS approvals at a Rawang warehouse (2025) and at Bintulu Port and Samalaju (2026). Each is site-specific, so Elmina needs its own case.
The core stays vendor-neutral: the same core drives a simulator, a DJI dock through the Cloud API or an open autopilot through MAVLink. See the provider adapters.
Crash report: New Straits Times, August 2023.