mirror of
https://github.com/swift-project/pilotclient.git
synced 2026-04-01 05:26:45 +08:00
Use onGround flag only when ground speed is low
OnGround flag is not synchronized with positions and causes jumps during right before takeoff and after landing. By adding a threshold currently being 20 kts, we move the jump into an area when the aircraft is still leveled.
This commit is contained in:
committed by
Mathew Sutcliffe
parent
d46318be5e
commit
58c816197e
@@ -846,7 +846,13 @@ namespace BlackSimPlugin
|
||||
if (partsStatus.isSupportingParts() && !parts.isEmpty())
|
||||
{
|
||||
// we have parts, and use the closest ground
|
||||
isOnGround = parts.front().isOnGround();
|
||||
|
||||
// \fixme onGround flag is not synchronized with positions and causes jumps during takeoff/landing.
|
||||
// We need to find a better way to synchronize both. Until then, use it for a very small speed range only.
|
||||
// This covers taxiing aircraft as well as a hovering helicopter.
|
||||
double groundSpeedKnots = interpolatedSituation.getGroundSpeed().value(CSpeedUnit::kts());
|
||||
if (groundSpeedKnots < 50) { isOnGround = parts.front().isOnGround(); }
|
||||
else { isOnGround = interpolatedSituation.isOnGroundGuessed(); }
|
||||
}
|
||||
else
|
||||
{
|
||||
|
||||
Reference in New Issue
Block a user