Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
33 changes: 33 additions & 0 deletions ExtLibs/ArduPilot/CurrentState.cs
Original file line number Diff line number Diff line change
Expand Up @@ -503,6 +503,8 @@ public float airspeed
public float targetairspeed { get; private set; }

public bool lowairspeed { get; set; }
private float _cachedAirspeedMin = 0;
private DateTime _lastAirspeedMinCheck = DateTime.MinValue;

[DisplayFieldName("asratio.Field")]
[DisplayText("Airspeed Ratio")]
Expand Down Expand Up @@ -3835,6 +3837,37 @@ private void Parent_OnPacketReceived(object sender, MAVLink.MAVLinkMessage mavLi
//This comes from the EKF, so it supposed to be correct
climbrate = vfr.climb;
gotVFR = true; // we have a vfr packet

if ((timeSinceArmInAir > 0) && (DateTime.Now - _lastAirspeedMinCheck).TotalSeconds > 5)
{
try
{
if (parent?.param != null)
{
if (parent.param.ContainsKey("AIRSPEED_MIN"))
{
_cachedAirspeedMin = (float)parent.param["AIRSPEED_MIN"].Value;
}
else if (parent.param.ContainsKey("ARSPD_FBW_MIN"))
{
_cachedAirspeedMin = (float)parent.param["ARSPD_FBW_MIN"].Value;
}
}
}
catch (Exception ex)
{
log.Debug("Error getting AIRSPEED_MIN or ARSPD_FBW_MIN from param for lowairspeed handling", ex);
}

_lastAirspeedMinCheck = DateTime.Now;
Comment thread
ArthurPatriot marked this conversation as resolved.
}

lowairspeed = armed
&& (timeSinceArmInAir > 0)
&& (_cachedAirspeedMin > 0)
&& sensors_enabled.differential_pressure
&& sensors_health.differential_pressure
&& (vfr.airspeed < _cachedAirspeedMin);
}

break;
Expand Down
1 change: 1 addition & 0 deletions GCSViews/FlightData.Designer.cs

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

Loading