FGLGear::FGLGear(FGConfigFile* AC_cfg, FGFDMExec* fdmex, int number) : Exec(fdmex)
{
- string tmp;
-
GearNumber = number;
- *AC_cfg >> tmp >> name >> vXYZ(1) >> vXYZ(2) >> vXYZ(3)
+ *AC_cfg >> name >> vXYZ(1) >> vXYZ(2) >> vXYZ(3)
>> kSpring >> bDamp>> dynamicFCoeff >> staticFCoeff
>> rollingFCoeff >> sSteerType >> sBrakeGroup
>> maxSteerAngle >> sRetractable;
FGColumnVector3& FGLGear::Force(void)
{
double SinWheel, CosWheel;
- double deltaT = State->Getdt()*Aircraft->GetRate();
+ double deltaT = State->Getdt()*Exec->GetGroundReactions()->GetRate();
vForce.InitMatrix();
vMoment.InitMatrix();
}
if (GearDown) {
+ double t = Exec->GetState()->Getsim_time();
vWhlBodyVec = MassBalance->StructuralToBody(vXYZ);
// vLocalGear now stores the vector from the cg to the wheel in local coords.
- compressLength = vLocalGear(eZ) - Propagate->GetDistanceAGL();
+ FGColumnVector3 normal, cvel;
+ FGLocation contact;
+ FGLocation gearLoc = Propagate->GetLocation().LocalToLocation(vLocalGear);
+ compressLength = - Exec->GetGroundCallback()->GetAGLevel(t, gearLoc, contact, normal, cvel);
// The compression length is currently measured in the Z-axis, only, at this time.
// It should be measured along the strut axis. If the local-frame gear position
// wheel velocity.
vWhlVelVec = Propagate->GetTb2l() * (Propagate->GetPQR() * vWhlBodyVec);
- vWhlVelVec += Propagate->GetVel();
+ vWhlVelVec += Propagate->GetVel() - cvel;
compressSpeed = vWhlVelVec(eZ);
// If this is the first time the wheel has made contact, remember some values
RollingForce = 0;
if (fabs(RollingWhlVel) > 1E-3) {
- RollingForce = (1.0 - TirePressureNorm) * 30
- + vLocalForce(eZ) * BrakeFCoeff
- * fabs(RollingWhlVel)/RollingWhlVel;
+ double badPresResis = (1.0 - TirePressureNorm) * 30;
+ RollingForce = (badPresResis * min(fabs(RollingWhlVel), 1.0)
+ + vLocalForce(eZ) * BrakeFCoeff)
+ * fabs(RollingWhlVel)/RollingWhlVel;
}
SideForce = vLocalForce(eZ) * FCoeff;