Skip to content

Commit

Permalink
Add unit to AGL property name, comment for AGL member, prevent negati…
Browse files Browse the repository at this point in the history
…ve AGL value
  • Loading branch information
seanmcleod committed Jun 30, 2024
1 parent 242650d commit 1f73cf7
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 5 deletions.
8 changes: 5 additions & 3 deletions src/models/FGLGear.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -293,11 +293,13 @@ const FGColumnVector3& FGLGear::GetBodyForces(void)
gearLoc = in.Location.LocalToLocation(vLocalGear);

// Compute the height of the theoretical location of the wheel (if strut is
// not compressed) with respect to the ground level
// not compressed) with respect to the ground level (AGL)
double height = fdmex->GetInertial()->GetContactPoint(gearLoc, contact,
normal, terrainVel, dummy);

AGL = height;
// Don't want strut compression when in contact with the ground to return
// a negative AGL
AGL = max(height, 0.0);

if (isRetractable) gearPos = GetGearUnitPos();

Expand Down Expand Up @@ -788,7 +790,7 @@ void FGLGear::bind(FGPropertyManager* PropertyManager)
return;
}

property_name = base_property_name + "/AGL";
property_name = base_property_name + "/AGL-ft";
PropertyManager->Tie(property_name.c_str(), &AGL);
property_name = base_property_name + "/WOW";
PropertyManager->Tie( property_name.c_str(), &WOW );
Expand Down
4 changes: 2 additions & 2 deletions src/models/FGLGear.h
Original file line number Diff line number Diff line change
Expand Up @@ -355,7 +355,7 @@ class JSBSIM_API FGLGear : public FGForce
double maximumForce = DBL_MAX;
double bumpiness = 0.0;
bool isSolid = true;
bool WOW;
bool WOW; // Weight On Wheel
bool lastWOW;
bool FirstContact;
bool StartedGroundRun;
Expand All @@ -366,7 +366,7 @@ class JSBSIM_API FGLGear : public FGForce
bool Castered;
bool StaticFriction;
std::string name;
double AGL;
double AGL; // Height above ground level

BrakeGroup eBrakeGrp;
ContactType eContactType;
Expand Down

0 comments on commit 1f73cf7

Please sign in to comment.