Skip to content

Commit

Permalink
Allow disarming in-flight
Browse files Browse the repository at this point in the history
This commit introduces the ability to disarm the drone mid-flight without triggering an emergency stop or crash state. However, disarming should not be used as a substitute for an emergency stop, as the disarm signal could be lost or delayed in critical situations. The emergency stop command is specifically designed for higher reliability and should continue to be used when immediate and secure halting of the drone is necessary.
  • Loading branch information
gemenerik committed Oct 21, 2024
1 parent 13f16ff commit 6e1dc30
Show file tree
Hide file tree
Showing 2 changed files with 10 additions and 1 deletion.
2 changes: 1 addition & 1 deletion src/modules/src/supervisor.c
Original file line number Diff line number Diff line change
Expand Up @@ -264,7 +264,7 @@ static void postTransitionActions(SupervisorMem_t* this, const supervisorState_t
supervisorSetLatestLandingTime(this, currentTick);
}

if ((previousState == supervisorStateLanded) && (newState == supervisorStateReset)) {
if ((previousState == supervisorStateFlying || previousState == supervisorStateLanded) && (newState == supervisorStateReset)) {
DEBUG_PRINT("Disarming\n");
}

Expand Down
9 changes: 9 additions & 0 deletions src/modules/src/supervisor_state_machine.c
Original file line number Diff line number Diff line change
Expand Up @@ -174,6 +174,15 @@ static SupervisorStateTransition_t transitionsFlying[] = {

.blockerCombiner = supervisorNever,
},
{
.newState = supervisorStateReset,

.triggers = SUPERVISOR_CB_NONE,
.negatedTriggers = SUPERVISOR_CB_ARMED,
.triggerCombiner = supervisorAll,

.blockerCombiner = supervisorNever,
},
{
.newState = supervisorStateWarningLevelOut,

Expand Down

0 comments on commit 6e1dc30

Please sign in to comment.