Skip to content

Commit 3ef25c0

Browse files
committed
Sub:add aux func disarm to pre-arm check for disarm function
1 parent a5d7f03 commit 3ef25c0

File tree

1 file changed

+8
-1
lines changed

1 file changed

+8
-1
lines changed

ArduSub/AP_Arming_Sub.cpp

Lines changed: 8 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -38,6 +38,13 @@ bool AP_Arming_Sub::has_disarm_function() const {
3838
}
3939
}
4040
}
41+
// check if an AUX function that disarms or estops is setup
42+
if (rc().find_channel_for_option(RC_Channel::AUX_FUNC::MOTOR_ESTOP) ||
43+
rc().find_channel_for_option(RC_Channel::AUX_FUNC::DISARM) ||
44+
rc().find_channel_for_option(RC_Channel::AUX_FUNC::ARMDISARM) ||
45+
rc().find_channel_for_option(RC_Channel::AUX_FUNC::ARM_EMERGENCY_STOP)) {
46+
return true;
47+
}
4148
return false;
4249
}
4350

@@ -48,7 +55,7 @@ bool AP_Arming_Sub::pre_arm_checks(bool display_failure)
4855
}
4956
// don't allow arming unless there is a disarm button configured
5057
if (!has_disarm_function()) {
51-
check_failed(display_failure, "Must assign a disarm or arm_toggle button");
58+
check_failed(display_failure, "Must assign a disarm or arm_toggle button or disarm aux function");
5259
return false;
5360
}
5461

0 commit comments

Comments
 (0)