Skip to content

Mission rules: detection triggers with enter and exit instructions - #306

Draft
jp-pino wants to merge 1 commit into
jp-pino/mission-updatesfrom
jp-pino/mission-rules
Draft

Mission rules: detection triggers with enter and exit instructions#306
jp-pino wants to merge 1 commit into
jp-pino/mission-updatesfrom
jp-pino/mission-rules

Conversation

@jp-pino

@jp-pino jp-pino commented Sep 9, 2026

Copy link
Copy Markdown
Contributor

Rules that run instructions on their own, independently of a mission, when something is detected.

  • DetectionTrigger { class_names, model_name, camera, min_confidence, min_area_fraction, hold_ms, release_ms, cooldown_ms }.
  • MissionRule { id, name, enabled, trigger, enter_instructions, exit_instructions }: the enter instructions run when the trigger has matched for hold_ms, the exit instructions when it has been unmatched for release_ms; cooldown_ms then passes before the rule can fire again. Instructions that move the drone are refused.
  • MissionRuleStatus (MissionRuleState IDLE / ACTIVE / COOLDOWN / DISABLED, episodes, last fired, last result) in MissionRulesTel.
  • SetMissionRulesReq / Rep (accepted, reason), GetMissionRulesReq / Rep, ClearMissionRulesCtrl.
  • NOTIFICATION_TYPE_MISSION_RULE_FIRED (38) and NOTIFICATION_TYPE_MISSION_RULE_RELEASED (39).

Depends on #305.

@jp-pino jp-pino self-assigned this Sep 9, 2026
@jp-pino
jp-pino force-pushed the jp-pino/mission-rules branch from e557c85 to a26e722 Compare September 9, 2026 20:45
@jp-pino
jp-pino added this pull request to stack #304 September 9, 2026 20:59
@jp-pino jp-pino added this to the Blunux v5.2 milestone Sep 9, 2026
… telemetry

Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
@jp-pino
jp-pino force-pushed the jp-pino/mission-rules branch from a26e722 to 0fe0fdd Compare September 9, 2026 21:16
Comment on lines +117 to +127
// MissionRule runs instructions when its trigger fires and when it releases.
message MissionRule {
uint32 id = 1; // Rule id, defined by the client.
string name = 2; // Rule name, for the log and the app.
bool enabled = 3; // A disabled rule never fires.
oneof trigger {
DetectionTrigger detection_trigger = 4; // Fire on detections.
}
repeated Instruction enter_instructions = 5; // Run when the rule fires. Instructions that move the drone are refused.
repeated Instruction exit_instructions = 6; // Run when the rule releases.
}

Copy link
Copy Markdown
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@follesoe protocol-wise I think this is a good design. The trigger can then be extended to be a DepthTrigger, AltitudeTrigger, LocationTrigger, among other ideas. What do you think?

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

Comment on lines +117 to +127
// MissionRule runs instructions when its trigger fires and when it releases.
message MissionRule {
uint32 id = 1; // Rule id, defined by the client.
string name = 2; // Rule name, for the log and the app.
bool enabled = 3; // A disabled rule never fires.
oneof trigger {
DetectionTrigger detection_trigger = 4; // Fire on detections.
}
repeated Instruction enter_instructions = 5; // Run when the rule fires. Instructions that move the drone are refused.
repeated Instruction exit_instructions = 6; // Run when the rule releases.
}

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Looks good!

uint32 id = 1; // Rule id, defined by the client.
string name = 2; // Rule name, for the log and the app.
bool enabled = 3; // A disabled rule never fires.
oneof trigger {

Copy link
Copy Markdown
Member

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Consider making this a list of triggers that are AND evaluated, so we have a repeated list of oneof triggers.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants