From cc65af274d8a20b566eca67f1eff9033491cff5f Mon Sep 17 00:00:00 2001 From: Juan Pablo Pino Bravo Date: Wed, 9 Sep 2026 21:18:06 +0200 Subject: [PATCH] Add RunInstructionCtrl, CancelInstructionCtrl and InstructionResultTel Lets a client execute one mission Instruction right away, outside any mission, and learn its outcome by request id. Non-motion instructions run in any mission state; motion instructions only while no mission is running. Phase 2 of the MissionSupervisor restructuring: https://claude.ai/code/artifact/951a11c6-e492-436f-90bc-aa61f3b0d05c Co-Authored-By: Claude Fable 5.1 --- protobuf_definitions/control.proto | 17 +++++++++++++++++ protobuf_definitions/mission_planning.proto | 18 ++++++++++++++++++ protobuf_definitions/telemetry.proto | 8 ++++++++ 3 files changed, 43 insertions(+) diff --git a/protobuf_definitions/control.proto b/protobuf_definitions/control.proto index d4da5cd4..9ca0a538 100644 --- a/protobuf_definitions/control.proto +++ b/protobuf_definitions/control.proto @@ -6,6 +6,7 @@ syntax = "proto3"; package blueye.protocol; import "aquatroll.proto"; import "message_formats.proto"; +import "mission_planning.proto"; option csharp_namespace = "Blueye.Protocol.Protobuf"; // Issue a command to move the drone in the surge, sway, heave, or yaw direction. @@ -128,6 +129,22 @@ message PauseMissionCtrl { message ClearMissionCtrl { } +// Run a single instruction right away, outside any mission. +// +// Instructions that do not move the drone (camera, tilt, lights, multibeam) run in any mission +// state, alongside a running mission. Instructions that move the drone run only while no mission +// is running, and are rejected otherwise. The outcome is reported in InstructionResultTel with +// the same request_id. +message RunInstructionCtrl { + Instruction instruction = 1; // Instruction to execute. + uint32 request_id = 2; // Client-chosen id, echoed in InstructionResultTel. +} + +// Cancel an instruction started with RunInstructionCtrl. +message CancelInstructionCtrl { + uint32 request_id = 1; // The request_id given to RunInstructionCtrl. +} + // Issue a command to reset the position estimate. message ResetPositionCtrl { ResetPositionSettings settings = 1; // Reset settings. diff --git a/protobuf_definitions/mission_planning.proto b/protobuf_definitions/mission_planning.proto index ba5a940e..c8b758a6 100644 --- a/protobuf_definitions/mission_planning.proto +++ b/protobuf_definitions/mission_planning.proto @@ -249,3 +249,21 @@ message MissionStatus { uint32 total_number_of_path_segments = 8; // Total number of path segments in the mission. uint32 id = 9; // Mission id of the active mission. } + +// Outcome of an instruction started with RunInstructionCtrl. +enum InstructionResultState { + INSTRUCTION_RESULT_STATE_UNSPECIFIED = 0; // Unspecified. + INSTRUCTION_RESULT_STATE_ACCEPTED = 1; // The instruction was accepted and has started. + INSTRUCTION_RESULT_STATE_REJECTED = 2; // The instruction was not started, see reason. + INSTRUCTION_RESULT_STATE_COMPLETED = 3; // The instruction completed. + INSTRUCTION_RESULT_STATE_FAILED = 4; // The instruction stopped before completing, see reason. + INSTRUCTION_RESULT_STATE_CANCELLED = 5; // The instruction was cancelled by a client or by the drone. +} + +// Result of an instruction started with RunInstructionCtrl. +message InstructionResult { + uint32 request_id = 1; // The request_id given to RunInstructionCtrl. + uint32 instruction_id = 2; // Id of the instruction, as given by the client. + InstructionResultState state = 3; // Outcome so far. + string reason = 4; // Why the instruction was rejected, failed or was cancelled (optional). +} diff --git a/protobuf_definitions/telemetry.proto b/protobuf_definitions/telemetry.proto index afe62869..1e58c289 100644 --- a/protobuf_definitions/telemetry.proto +++ b/protobuf_definitions/telemetry.proto @@ -64,6 +64,14 @@ message NotificationTel { Notification notification = 1; // Notification from the control system. } +// Result of an instruction started with RunInstructionCtrl. +// +// Published when the instruction is accepted or rejected, and again when it completes, fails or +// is cancelled. +message InstructionResultTel { + InstructionResult result = 1; // Result of the instruction. +} + // Control force in all directions. message ControlForceTel { ControlForce control_force = 1; // Control force in all directions.