Depth, altitude and location triggers combined with AND in mission rules - #308
Draft
jp-pino wants to merge 2 commits into
Draft
Depth, altitude and location triggers combined with AND in mission rules#308jp-pino wants to merge 2 commits into
jp-pino wants to merge 2 commits into
Conversation
Add DepthTrigger, AltitudeTrigger and LocationTrigger next to DetectionTrigger and wrap the four in a Trigger message with a oneof. MissionRule now carries a repeated list of triggers that must all be satisfied at once, and hold_ms, release_ms and cooldown_ms move from DetectionTrigger to the rule, where they apply to the combination. MissionRuleStatus gains a TriggerStatus per trigger so a client can show which condition is holding a rule back and whether the sensor for it is missing. SetMultibeamConfigCommand and MultibeamDriverCommand carry the GuestPortDeviceID the configuration was made for, and the drone skips the configuration with NOTIFICATION_TYPE_MULTIBEAM_SONAR_MISMATCH when the multibeam driver reports a different sonar. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
Say what the drone actually does with a trigger band and with a multibeam configuration: - DepthTrigger and AltitudeTrigger: neither bound may be negative and a maximum that is set has to be above the minimum, so a band with no width is refused rather than accepted as a rule that never fires. A depth trigger reports sensor_unavailable while no depth has reached the mission at all, rather than never. - MissionRule: a rule needs at least one instruction in one of its lists. - SetMultibeamConfigCommand and MultibeamDriverCommand: the configuration is also measured against the range, frequency modes and beam count of the sonar, and a configuration outside them skips the instruction rather than being clamped. For the driver command that means the driver is not started. Co-Authored-By: Claude Fable 5.1 <noreply@anthropic.com>
jp-pino
added this pull request to stack #304
September 10, 2026 17:45
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Adds three more mission rule triggers and lets a rule require several at once.
DepthTrigger { min_depth, max_depth }— satisfied between two depths below the surface.max_depthzero means no upper bound.AltitudeTrigger { min_altitude, max_altitude }— satisfied between two heights above the seabed, from a DVL or an altimeter.max_altitudezero means no upper bound.LocationTrigger { position, circle_of_acceptance }— satisfied inside a circle around a position.Triggerwraps the four kinds in aoneof condition(detection_trigger1,depth_trigger2,altitude_trigger3,location_trigger4), with aTriggerKindenum whose values are those field numbers.MissionRuletakesrepeated Trigger triggers = 7, all of which must be satisfied at once. The singledetection_triggerfield 4 is reserved.hold_ms(8),release_ms(9) andcooldown_ms(10) move fromDetectionTriggertoMissionRule, where they apply to the combination;DetectionTriggerreserves 6, 7 and 8.MissionRuleStatustakesrepeated TriggerStatus triggers = 7.TriggerStatus { kind, satisfied, sensor_unavailable }says which condition is holding a rule back, and whether the reading it needs is missing. A trigger whose sensor is unavailable is simply not satisfied.SetMultibeamConfigCommandandMultibeamDriverCommandtake aGuestPortDeviceID expected_device_id— the sonar the configuration was made for. The comments describe the contract: the drone compares it with the sonar the multibeam driver reports and skips the configuration when they differ.NOTIFICATION_TYPE_MULTIBEAM_SONAR_MISMATCH(40) for that skip.Review follow-ups
Comments that did not match the behaviour they describe:
DepthTriggerandAltitudeTrigger: neither bound may be negative, and a maximum that is set has to be above the minimum. A band whose bounds are equal is only ever satisfied by an exact float match, so it is refused rather than accepted as a condition that never holds. A depth trigger reportssensor_unavailablewhile no depth has arrived at all, not never.MissionRule: a rule needs at least one instruction in one of its lists.SetMultibeamConfigCommandandMultibeamDriverCommand: the configuration is also measured against the range, the frequency modes and the beam count of the sonar, and one outside them skips the instruction with a reason instead of being clamped. For the driver command that means the driver is not started.Depends on #307.
🤖 Generated with Claude Code