Skip to content

Commit

Permalink
Add option to allow force arming with the rudder stick
Browse files Browse the repository at this point in the history
  • Loading branch information
shellixyz committed Mar 5, 2025
1 parent 217b900 commit 969e989
Show file tree
Hide file tree
Showing 3 changed files with 10 additions and 1 deletion.
6 changes: 5 additions & 1 deletion ArduPlane/AP_Arming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -296,7 +296,7 @@ void AP_Arming_Plane::change_arm_state(void)
#endif
}

bool AP_Arming_Plane::arm(const AP_Arming::Method method, const bool do_arming_checks)
bool AP_Arming_Plane::arm(const AP_Arming::Method method, bool do_arming_checks)
{
if (throttle_cut) {
if (throttle_cut_prev_mode && plane.control_mode == &plane.mode_fbwa) {
Expand All @@ -308,6 +308,10 @@ bool AP_Arming_Plane::arm(const AP_Arming::Method method, const bool do_arming_c
return true;
}

if (method == AP_Arming::Method::AUXSWITCH && plane.g2.rc_channels.allow_force_arming() && fabsf(plane.channel_rudder->norm_input()) > 0.5f) {
do_arming_checks = false;
}

if (!AP_Arming::arm(method, do_arming_checks)) {
return false;
}
Expand Down
4 changes: 4 additions & 0 deletions ArduPlane/RC_Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -62,6 +62,10 @@ class RC_Channels_Plane : public RC_Channels
return get_singleton() != nullptr && (_options & uint32_t(Option::PLANE_SWITCH_TO_MANUAL_AFTER_DISARMING));
}

bool allow_force_arming(void) const {
return get_singleton() != nullptr && (_options & uint32_t(Option::ALLOW_FORCE_ARMING));
}

RC_Channel *get_arming_channel(void) const override;

protected:
Expand Down
1 change: 1 addition & 0 deletions libraries/RC_Channel/RC_Channel.h
Original file line number Diff line number Diff line change
Expand Up @@ -624,6 +624,7 @@ class RC_Channels {
USE_CRSF_LQ_AS_RSSI = (1U << 11), // returns CRSF link quality as RSSI value, instead of RSSI
CRSF_FM_DISARM_STAR = (1U << 12), // when disarmed, add a star at the end of the flight mode in CRSF telemetry
ELRS_420KBAUD = (1U << 13), // use 420kbaud for ELRS protocol
ALLOW_FORCE_ARMING = (1U << 19), // plane only: allow bypassing arming checks with yaw stick
AUTO_SWITCH_TO_FBWA_WITH_STICKS = (1U << 20), // plane only: switch to FBWA when in AUTO and moving sticks more than 10%
PLANE_SWITCH_TO_MANUAL_AFTER_DISARMING = (1U << 21), // plane only: switch to manual after disarming and re-read mode switch when arming
PLANE_DISABLE_MAN_BAT_COMP = (1U << 22), // plane only: disable throttle battery voltage compensation in manual mode
Expand Down

0 comments on commit 969e989

Please sign in to comment.