43 #include "models/propulsion/FGForce.h"
44 #include "math/FGColumnVector3.h"
45 #include "math/LagrangeMultiplier.h"
46 #include "FGSurface.h"
56 class FGPropertyManager;
195 double VcalibratedKts;
200 bool TakeoffThrottle;
209 std::vector <double> BrakePos;
215 enum BrakeGroup {bgNone=0, bgLeft, bgRight, bgCenter, bgNose, bgTail, bgNumBrakeGroups };
242 return Ts2b * (vXYZn - in.vXYZcg);
246 return vWhlBodyVec(idx);
249 const FGColumnVector3& GetLocalGear(
void)
const {
return vLocalGear; }
250 double GetLocalGear(
int idx)
const {
return vLocalGear(idx); }
253 const std::string&
GetName(
void)
const {
return name; }
272 double GetSteerNorm(
void)
const {
273 return maxSteerAngle == 0.0 ? 0.0 : radtodeg/maxSteerAngle*SteerAngle;
275 void SetSteerCmd(
double cmd) { SetSteerAngleDeg(cmd * maxSteerAngle); }
276 double GetstaticFCoeff(
void)
const {
return staticFCoeff; }
278 int GetBrakeGroup(
void)
const {
return (
int)eBrakeGrp; }
279 int GetSteerType(
void)
const {
return (
int)eSteerType; }
281 bool GetSteerable(
void)
const {
return eSteerType != stFixed; }
282 bool GetRetractable(
void)
const {
return isRetractable; }
283 bool GetGearUnitUp(
void)
const {
return isRetractable ? (GetGearUnitPos() < 0.01) : false; }
284 bool GetGearUnitDown(
void)
const {
return isRetractable ? (GetGearUnitPos() > 0.99) : true; }
286 double GetWheelRollForce(
void) {
288 FGColumnVector3 vForce = mTGear.
Transposed() * FGForce::GetBodyForces();
289 return vForce(eX)*cos(SteerAngle) + vForce(eY)*sin(SteerAngle); }
290 double GetWheelSideForce(
void) {
292 FGColumnVector3 vForce = mTGear.
Transposed() * FGForce::GetBodyForces();
293 return vForce(eY)*cos(SteerAngle) - vForce(eX)*sin(SteerAngle); }
294 double GetBodyXForce(
void) {
296 return FGForce::GetBodyForces()(eX);
298 double GetBodyYForce(
void) {
300 return FGForce::GetBodyForces()(eY);
302 double GetBodyZForce(
void) {
304 return FGForce::GetBodyForces()(eZ);
306 double GetWheelRollVel(
void)
const {
return vWhlVelVec(eX)*cos(SteerAngle)
307 + vWhlVelVec(eY)*sin(SteerAngle); }
308 double GetWheelSideVel(
void)
const {
return vWhlVelVec(eY)*cos(SteerAngle)
309 - vWhlVelVec(eX)*sin(SteerAngle); }
310 double GetWheelSlipAngle(
void)
const {
return WheelSlip; }
311 double GetWheelVel(
int axis)
const {
return vWhlVelVec(axis);}
312 bool IsBogey(
void)
const {
return (eContactType == ctBOGEY);}
313 double GetGearUnitPos(
void)
const;
314 double GetSteerAngleDeg(
void)
const {
return radtodeg*SteerAngle; }
315 void SetSteerAngleDeg(
double angle) {
316 if (eSteerType != stFixed && !Castered)
317 SteerAngle = degtorad * angle;
320 const struct Inputs& in;
322 void ResetToIC(
void);
327 static const FGMatrix33 Tb2s, Ts2b;
329 FGColumnVector3 vLocalGear;
330 FGColumnVector3 vWhlVelVec, vGroundWhlVel;
331 FGColumnVector3 vGroundNormal;
332 FGTable *ForceY_Table;
333 FGFunction *fStrutForce;
338 double compressLength;
339 double compressSpeed;
340 double rollingFCoeff;
341 double Stiffness, Shape, Peak, Curvature;
346 double TakeoffDistanceTraveled;
347 double TakeoffDistanceTraveled50ft;
348 double LandingDistanceTraveled;
349 double MaximumStrutForce, StrutForce;
350 double MaximumStrutTravel;
357 bool StartedGroundRun;
358 bool LandingReported;
359 bool TakeoffReported;
371 double maxSteerAngle;
373 LagrangeMultiplier LMultiplier[3];
375 FGGroundReactions* GroundReactions;
376 FGPropertyManager* PropertyManager;
378 mutable bool useFCSGearPos;
380 void ComputeBrakeForceCoefficient(
void);
381 void ComputeSteeringAngle(
void);
382 void ComputeSlipAngle(
void);
383 void ComputeSideForceCoefficient(
void);
384 void ComputeVerticalStrutForce(
void);
385 void ComputeGroundFrame(
void);
386 void ComputeJacobian(
const FGColumnVector3& vWhlContactVec);
387 void UpdateForces(
void);
388 void SetstaticFCoeff(
double coeff);
389 void CrashDetect(
void);
390 void InitializeReporting(
void);
391 void ResetReporting(
void);
392 void ReportTakeoffOrLanding(
void);
394 void Debug(
int from);