1
0
Fork 0

Fixes assertion failures reported by Julian smith.

These were due to the ground callback instance of FlightGear not setting the ellipse parameters of the 'contact' location. this commit make JSBSim immune to that scenario.
This commit is contained in:
Bertrand Coconnier 2020-10-31 14:11:14 +01:00
parent 388d66b6a6
commit bb0b69bc41
3 changed files with 8 additions and 3 deletions

View file

@ -662,8 +662,11 @@ double FGInitialCondition::GetAltitudeASLFtIC(void) const
double FGInitialCondition::GetTerrainElevationFtIC(void) const
{
FGLocation contact;
FGColumnVector3 normal, v, w;
FGLocation contact;
double a = fdmex->GetInertial()->GetSemimajor();
double b = fdmex->GetInertial()->GetSemiminor();
contact.SetEllipse(a, b);
fdmex->GetInertial()->GetContactPoint(position, contact, normal, v, w);
return contact.GetGeodAltitude();
}

View file

@ -211,8 +211,9 @@ FGColumnVector3 FGInertial::GetGravityJ2(const FGLocation& position) const
void FGInertial::SetAltitudeAGL(FGLocation& location, double altitudeAGL)
{
FGLocation contact;
FGColumnVector3 vDummy;
FGLocation contact;
contact.SetEllipse(a, b);
GroundCallback->GetAGLevel(location, contact, vDummy, vDummy, vDummy);
double groundHeight = contact.GetGeodAltitude();
double longitude = location.GetLongitude();

View file

@ -548,8 +548,9 @@ void FGPropagate::RecomputeLocalTerrainVelocity()
double FGPropagate::GetTerrainElevation(void) const
{
FGLocation contact;
FGColumnVector3 vDummy;
FGLocation contact;
contact.SetEllipse(in.SemiMajor, in.SemiMinor);
Inertial->GetContactPoint(VState.vLocation, contact, vDummy, vDummy, vDummy);
return contact.GetGeodAltitude();
}