ArduSub: clear RC overrides on forward/lateral/yaw/vertical input

Override has_pilot_input_for_override_clear() to use Sub's joystick
axes (forward, lateral, yaw, plus throttle mapped to vertical thrust)
instead of the Copter-style roll/pitch/yaw/throttle set.
This commit is contained in:
Tatsuya Yamaguchi
2026-06-03 08:54:09 +09:00
committed by Randy Mackay
parent 051a0c44c7
commit d1831bf276
2 changed files with 17 additions and 0 deletions
+14
View File
@@ -52,6 +52,20 @@ bool RC_Channels_Sub::has_valid_input() const
return RC_Channels::has_valid_input();
}
bool RC_Channels_Sub::has_pilot_input_for_override_clear()
{
if (channel_outside_trim_dz(get_forward_channel()) ||
channel_outside_trim_dz(get_lateral_channel()) ||
channel_outside_trim_dz(get_yaw_channel())) {
return true;
}
// Sub throttle (=vertical) is biased away from trim by the GCS, so use movement-since-override-start
if (throttle_moved_since_override_start()) {
return true;
}
return false;
}
// do_aux_function - implement the function invoked by auxiliary switches
bool RC_Channel_Sub::do_aux_function(const AuxFuncTrigger &trigger)
+3
View File
@@ -26,6 +26,9 @@ public:
bool in_rc_failsafe() const override;
// returns true if throttle arming checks should be run
bool arming_check_throttle() const override;
bool has_pilot_input_for_override_clear() override;
RC_Channel_Sub obj_channels[NUM_RC_CHANNELS];
RC_Channel_Sub *channel(const uint8_t chan) override {
if (chan >= ARRAY_SIZE(obj_channels)) {