Capabilities
Risk levels are on Permissions.
Reading the mission
ctx.mission.read takes a mission id argument but ignores it, and returns the planner’s current state:
Writing the mission
ctx.mission.write replaces the mission. The payload is { waypoints: [...] } and must hold at least one waypoint:
id and finite lat, lon and alt. Optional fields:
The host rebuilds every waypoint from these fields, so unknown fields are dropped and a malformed waypoint rejects the whole write with the first problem it found.
The write targets the plugin’s own drone, is refused unless the drone is disarmed with a live FC link, shows the operator a confirmation dialog, and rejects with code
refused if denied. In order, the host:
- Validates the waypoints.
- Refuses if the plugin is not bound to a connected drone, or the drone is armed, its arm state is unknown, or its flight controller link is down.
- Runs the planner’s own mission validator (geofence, zones, rally and the default altitude frame). An invalid mission is rejected with its errors.
- Shows the operator a dialog naming the drone, the waypoint count, the altitude frame and any advisory issues.
- After approval, reads the drone’s state again and refuses if the arm state, link or flight controller changed while the dialog was open. The operator is notified of an approved write that was not uploaded.
- Replaces the planner’s waypoints (undoable) and uploads them to that drone.
mission.write.
Contributing a mission template
A template is a GCS bundle that mounts in themission.template slot, inside the planner’s pattern editor. It renders its own form, generates waypoints from the operator’s input and writes them with ctx.mission.write, which shows the same confirmation dialog.
Declare the template under gcs.contributes.missionTemplates (mission_templates is accepted too) along with the capabilities:
Testing
Run the mission path against the harness from@altnautica/plugin-sdk/harness. It applies the granted-capability check and records every RPC the plugin sends:
Next steps
GCS plugin deep dive
The iframe sandbox, RPC and UI slots.
Contribution points
Every
contributes key and its fields.Safety
Pre-flight checks before flying a plugin-generated mission.