mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-02 10:23:25 +08:00
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:
committed by
Randy Mackay
parent
051a0c44c7
commit
d1831bf276
@@ -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)
|
||||
|
||||
@@ -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)) {
|
||||
|
||||
Reference in New Issue
Block a user