mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-05 23:43:58 -04:00
Plane: added THR_FAILSAFE=2 option
this allows for RC inputs to be ignored at low throttle, but won't trigger failsafe. It is meant for users flying BVLOS missions, where they want GCS failsafe enabled, but don't want RC failsafe, and want to be sure that RC inputs will be ignored at low RC throttle values Thanks to suggestion from Pompecukor
This commit is contained in:
parent
5c4c7b5fd4
commit
3c705d1c60
@ -58,7 +58,7 @@ bool AP_Arming_Plane::pre_arm_checks(bool display_failure)
|
||||
}
|
||||
|
||||
if (plane.channel_throttle->get_reverse() &&
|
||||
plane.g.throttle_fs_enabled &&
|
||||
Plane::ThrFailsafe(plane.g.throttle_fs_enabled.get()) != Plane::ThrFailsafe::Disabled &&
|
||||
plane.g.throttle_fs_value <
|
||||
plane.channel_throttle->get_radio_max()) {
|
||||
check_failed(display_failure, "Invalid THR_FS_VALUE for rev throttle");
|
||||
|
@ -460,10 +460,10 @@ const AP_Param::Info Plane::var_info[] = {
|
||||
|
||||
// @Param: THR_FAILSAFE
|
||||
// @DisplayName: Throttle and RC Failsafe Enable
|
||||
// @Description: This enables failsafe on loss of RC input. How this is detected depends on the type of RC receiver being used. For older radios an input below the THR_FS_VALUE is used to trigger failsafe. For newer radios the failsafe trigger is part of the protocol between the autopilot and receiver.
|
||||
// @Values: 0:Disabled,1:Enabled
|
||||
// @Description: This enables failsafe on loss of RC input. How this is detected depends on the type of RC receiver being used. For older radios an input below the THR_FS_VALUE is used to trigger failsafe. For newer radios the failsafe trigger is part of the protocol between the autopilot and receiver. A value of 2 means that the RC input won't be used when throttle goes below the THR_FS_VALUE, but it won't trigger a failsafe
|
||||
// @Values: 0:Disabled,1:Enabled,2:EnabledNoFailsafe
|
||||
// @User: Standard
|
||||
GSCALAR(throttle_fs_enabled, "THR_FAILSAFE", 1),
|
||||
GSCALAR(throttle_fs_enabled, "THR_FAILSAFE", int(ThrFailsafe::Enabled)),
|
||||
|
||||
|
||||
// @Param: THR_FS_VALUE
|
||||
|
@ -1118,6 +1118,12 @@ private:
|
||||
CROW_DISABLED,
|
||||
};
|
||||
|
||||
enum class ThrFailsafe {
|
||||
Disabled = 0,
|
||||
Enabled = 1,
|
||||
EnabledNoFS = 2
|
||||
};
|
||||
|
||||
CrowMode crow_mode = CrowMode::NORMAL;
|
||||
|
||||
public:
|
||||
|
@ -285,7 +285,7 @@ void Plane::control_failsafe()
|
||||
}
|
||||
}
|
||||
|
||||
if(g.throttle_fs_enabled == 0) {
|
||||
if (ThrFailsafe(g.throttle_fs_enabled.get()) != ThrFailsafe::Enabled) {
|
||||
return;
|
||||
}
|
||||
|
||||
@ -378,7 +378,7 @@ bool Plane::trim_radio()
|
||||
*/
|
||||
bool Plane::rc_throttle_value_ok(void) const
|
||||
{
|
||||
if (!g.throttle_fs_enabled) {
|
||||
if (ThrFailsafe(g.throttle_fs_enabled.get()) == ThrFailsafe::Disabled) {
|
||||
return true;
|
||||
}
|
||||
if (channel_throttle->get_reverse()) {
|
||||
|
Loading…
Reference in New Issue
Block a user