71 #include "initialization/FGInitialCondition.h" 72 #include "FGPropagate.h" 73 #include "FGGroundReactions.h" 74 #include "FGFDMExec.h" 75 #include "input_output/FGPropertyManager.h" 76 #include "simgear/io/iostreams/sgstream.hxx" 82 IDENT(IdSrc,
"$Id: FGPropagate.cpp,v 1.132 2017/02/25 14:23:19 bcoconni Exp $");
83 IDENT(IdHdr,ID_PROPAGATE);
98 integrator_rotational_rate = eRectEuler;
99 integrator_translational_rate = eAdamsBashforth2;
100 integrator_rotational_position = eRectEuler;
101 integrator_translational_position = eAdamsBashforth3;
123 if (!FGModel::InitModel())
return false;
134 integrator_rotational_rate = eRectEuler;
135 integrator_translational_rate = eAdamsBashforth2;
136 integrator_rotational_position = eRectEuler;
137 integrator_translational_position = eAdamsBashforth3;
154 VState.vInertialPosition = Tec2i * VState.
vLocation;
156 UpdateLocationMatrices();
164 UpdateBodyMatrices();
170 vVel = Tb2l * VState.
vUVW;
173 RecomputeLocalTerrainVelocity();
179 VState.
vPQRi = VState.
vPQR + Ti2b * in.vOmegaPlanet;
181 CalculateInertialVelocity();
188 void FGPropagate::InitializeDerivatives()
190 VState.dqPQRidot.assign(5, in.vPQRidot);
191 VState.dqUVWidot.assign(5, in.vUVWidot);
192 VState.dqInertialVelocity.assign(5, VState.vInertialVelocity);
193 VState.dqQtrndot.assign(5, VState.vQtrndot);
219 if (Holding)
return false;
221 double dt = in.DeltaT * rate;
226 Integrate(VState.
qAttitudeECI, VState.vQtrndot, VState.dqQtrndot, dt, integrator_rotational_position);
227 Integrate(VState.
vPQRi, in.vPQRidot, VState.dqPQRidot, dt, integrator_rotational_rate);
228 Integrate(VState.vInertialPosition, VState.vInertialVelocity, VState.dqInertialVelocity, dt, integrator_translational_position);
229 Integrate(VState.vInertialVelocity, in.vUVWidot, VState.dqUVWidot, dt, integrator_translational_rate);
243 VState.
vLocation = Ti2ec*VState.vInertialPosition;
247 UpdateLocationMatrices();
251 UpdateBodyMatrices();
257 RecomputeLocalTerrainVelocity();
259 VState.
vPQR = VState.
vPQRi - Ti2b * in.vOmegaPlanet;
267 vVel = Tb2l * VState.
vUVW;
278 VState.
vUVW.InitMatrix();
279 CalculateInertialVelocity();
280 VState.
vPQR.InitMatrix();
281 VState.
vPQRi = Ti2b * in.vOmegaPlanet;
283 InitializeDerivatives();
294 void FGPropagate::CalculateQuatdot(
void)
307 void FGPropagate::CalculateInertialVelocity(
void)
309 VState.vInertialVelocity = Tb2i * VState.
vUVW + (in.vOmegaPlanet * VState.vInertialPosition);
317 void FGPropagate::CalculateUVW(
void)
319 VState.
vUVW = Ti2b * (VState.vInertialVelocity - (in.vOmegaPlanet * VState.vInertialPosition));
326 deque <FGColumnVector3>& ValDot,
330 ValDot.push_front(Val);
333 switch(integration_type) {
334 case eRectEuler: Integrand += dt*ValDot[0];
336 case eTrapezoidal: Integrand += 0.5*dt*(ValDot[0] + ValDot[1]);
338 case eAdamsBashforth2: Integrand += dt*(1.5*ValDot[0] - 0.5*ValDot[1]);
340 case eAdamsBashforth3: Integrand += (1/12.0)*dt*(23.0*ValDot[0] - 16.0*ValDot[1] + 5.0*ValDot[2]);
342 case eAdamsBashforth4: Integrand += (1/24.0)*dt*(55.0*ValDot[0] - 59.0*ValDot[1] + 37.0*ValDot[2] - 9.0*ValDot[3]);
344 case eAdamsBashforth5: Integrand += dt*((1901./720.)*ValDot[0] - (1387./360.)*ValDot[1] + (109./30.)*ValDot[2] - (637./360.)*ValDot[3] + (251./720.)*ValDot[4]);
350 case eLocalLinearization:
351 throw(
"Can only use Buss (1 & 2) or local linearization integration methods in for rotational position!");
361 deque <FGQuaternion>& ValDot,
365 ValDot.push_front(Val);
368 switch(integration_type) {
369 case eRectEuler: Integrand += dt*ValDot[0];
371 case eTrapezoidal: Integrand += 0.5*dt*(ValDot[0] + ValDot[1]);
373 case eAdamsBashforth2: Integrand += dt*(1.5*ValDot[0] - 0.5*ValDot[1]);
375 case eAdamsBashforth3: Integrand += (1/12.0)*dt*(23.0*ValDot[0] - 16.0*ValDot[1] + 5.0*ValDot[2]);
377 case eAdamsBashforth4: Integrand += (1/24.0)*dt*(55.0*ValDot[0] - 59.0*ValDot[1] + 37.0*ValDot[2] - 9.0*ValDot[3]);
379 case eAdamsBashforth5: Integrand += dt*((1901./720.)*ValDot[0] - (1387./360.)*ValDot[1] + (109./30.)*ValDot[2] - (637./360.)*ValDot[3] + (251./720.)*ValDot[4]);
387 Integrand = Integrand * QExp(0.5 * dt * VState.
vPQRi);
398 Integrand = Integrand * QExp(0.5 * dt * omega);
401 case eLocalLinearization:
409 double omegak2 = DotProduct(VState.
vPQRi, VState.
vPQRi);
410 double omegak = omegak2 > 1E-6 ? sqrt(omegak2) : 1E-6;
411 double rhok = 0.5 * dt * omegak;
412 double C1 = cos(rhok);
413 double C2 = 2.0 * sin(rhok) / omegak;
414 double C3 = 4.0 * (1.0 - C1) / (omegak*omegak);
415 double C4 = 4.0 * (dt - C2) / (omegak*omegak);
419 q(1) = C1 - C4*DotProduct(wi, wdoti);
424 Integrand = Integrand * q;
463 void FGPropagate::UpdateLocationMatrices(
void)
473 void FGPropagate::UpdateBodyMatrices(
void)
479 Tec2b = Ti2b * Tec2i;
487 void FGPropagate::SetInertialOrientation(
const FGQuaternion& Qi)
491 UpdateBodyMatrices();
499 VState.vInertialVelocity = Vi;
501 vVel = Tb2l * VState.
vUVW;
507 VState.
vPQRi = Ti2b * vRates;
508 VState.
vPQR = VState.
vPQRi - Ti2b * in.vOmegaPlanet;
514 void FGPropagate::RecomputeLocalTerrainVelocity()
519 LocalTerrainAngularVelocity);
524 void FGPropagate::SetTerrainElevation(
double terrainElev)
533 void FGPropagate::SetSeaLevelRadius(
double tt)
547 double FGPropagate::GetDistanceAGL(
void)
const 554 double FGPropagate::GetDistanceAGLKm(
void)
const 561 void FGPropagate::SetDistanceAGL(
double tt)
564 UpdateVehicleState();
569 void FGPropagate::SetDistanceAGLKm(
double tt)
572 UpdateVehicleState();
583 UpdateLocationMatrices();
585 RecomputeLocalTerrainVelocity();
587 vVel = Tb2l * VState.
vUVW;
589 VState.
vPQRi = VState.
vPQR + Ti2b * in.vOmegaPlanet;
590 VState.vInertialPosition = vstate.vInertialPosition;
596 void FGPropagate::UpdateVehicleState(
void)
598 RecomputeLocalTerrainVelocity();
599 VState.vInertialPosition = Tec2i * VState.
vLocation;
600 UpdateLocationMatrices();
601 UpdateBodyMatrices();
602 vVel = Tb2l * VState.
vUVW;
608 void FGPropagate::SetLocation(
const FGLocation& l)
613 UpdateVehicleState();
625 void FGPropagate::DumpState(
void)
629 <<
"------------------------------------------------------------------" <<
reset << endl;
631 <<
"State Report at sim time: " << FDMExec->
GetSimTime() <<
" seconds" <<
reset << endl;
634 cout <<
" ECI: " << VState.vInertialPosition.
Dump(
", ") <<
" (x,y,z, in ft)" << endl;
635 cout <<
" ECEF: " << VState.
vLocation <<
" (x,y,z, in ft)" << endl;
638 <<
", " <<
GetAltitudeASL() <<
" (geodetic lat, lon, alt ASL in deg and ft)" << endl;
641 <<
"Orientation" <<
underoff << endl;
647 cout <<
" ECI: " << VState.vInertialVelocity.
Dump(
", ") <<
" (x,y,z in ft/s)" << endl;
648 cout <<
" ECEF: " << (Tb2ec * VState.
vUVW).Dump(
", ") <<
" (x,y,z in ft/s)" << endl;
649 cout <<
" Local: " <<
GetVel() <<
" (n,e,d in ft/sec)" << endl;
650 cout <<
" Body: " <<
GetUVW() <<
" (u,v,w in ft/sec)" << endl;
653 <<
"Body Rates (relative to given frame, expressed in body frame)" <<
underoff << endl;
654 cout <<
" ECI: " << (VState.
vPQRi*radtodeg).Dump(
", ") <<
" (p,q,r in deg/s)" << endl;
655 cout <<
" ECEF: " << (VState.
vPQR*radtodeg).Dump(
", ") <<
" (p,q,r in deg/s)" << endl;
660 void FGPropagate::WriteStateFile(
int num)
664 if (num == 0)
return;
668 if (path.isNull()) path = SGPath(
"initfile.");
669 else path.append(
"initfile.");
672 path.concat(to_string((
double)FDMExec->
GetSimTime())+
".xml");
677 if (outfile.is_open()) {
678 outfile <<
"<?xml version=\"1.0\"?>" << endl;
679 outfile <<
"<initialize name=\"reset00\">" << endl;
680 outfile <<
" <ubody unit=\"FT/SEC\"> " << VState.
vUVW(eU) <<
" </ubody> " << endl;
681 outfile <<
" <vbody unit=\"FT/SEC\"> " << VState.
vUVW(eV) <<
" </vbody> " << endl;
682 outfile <<
" <wbody unit=\"FT/SEC\"> " << VState.
vUVW(eW) <<
" </wbody> " << endl;
684 outfile <<
" <theta unit=\"DEG\"> " << VState.
qAttitudeLocal.
GetEuler(eTht)*radtodeg <<
" </theta>" << endl;
688 outfile <<
" <altitude unit=\"FT\"> " << GetDistanceAGL() <<
" </altitude>" << endl;
689 outfile <<
"</initialize>" << endl;
692 cerr <<
"Could not open and/or write the state to the initial conditions file: " 698 if (outfile.is_open()) {
699 outfile <<
"<?xml version=\"1.0\"?>" << endl;
700 outfile <<
"<initialize name=\"IC File\" version=\"2.0\">" << endl;
701 outfile <<
"" << endl;
702 outfile <<
" <position frame=\"ECEF\">" << endl;
705 outfile <<
" <altitudeMSL unit=\"FT\"> " <<
GetAltitudeASL() <<
" </altitudeMSL>" << endl;
706 outfile <<
" </position>" << endl;
707 outfile <<
"" << endl;
708 outfile <<
" <orientation unit=\"DEG\" frame=\"LOCAL\">" << endl;
712 outfile <<
" </orientation>" << endl;
713 outfile <<
"" << endl;
714 outfile <<
" <velocity unit=\"FT/SEC\" frame=\"LOCAL\">" << endl;
715 outfile <<
" <x> " <<
GetVel(eNorth) <<
" </x>" << endl;
716 outfile <<
" <y> " <<
GetVel(eEast) <<
" </y>" << endl;
717 outfile <<
" <z> " <<
GetVel(eDown) <<
" </z>" << endl;
718 outfile <<
" </velocity>" << endl;
719 outfile <<
"" << endl;
720 outfile <<
" <attitude_rate unit=\"DEG/SEC\" frame=\"BODY\">" << endl;
721 outfile <<
" <roll> " << (VState.
vPQR*radtodeg)(eRoll) <<
" </roll>" << endl;
722 outfile <<
" <pitch> " << (VState.
vPQR*radtodeg)(ePitch) <<
" </pitch>" << endl;
723 outfile <<
" <yaw> " << (VState.
vPQR*radtodeg)(eYaw) <<
" </yaw>" << endl;
724 outfile <<
" </attitude_rate>" << endl;
725 outfile <<
"" << endl;
726 outfile <<
"</initialize>" << endl;
729 cerr <<
"Could not open and/or write the state to the initial conditions file: " 734 cerr <<
"When writing a state file, the supplied value must be 1 or 2 for the version number of the resulting IC file" << endl;
740 void FGPropagate::bind(
void)
748 PropertyManager->
Tie(
"velocities/v-east-fps",
this, eEast, (PMF)&FGPropagate::GetVel);
749 PropertyManager->
Tie(
"velocities/v-down-fps",
this, eDown, (PMF)&FGPropagate::GetVel);
752 PropertyManager->
Tie(
"velocities/v-fps",
this, eV, (PMF)&FGPropagate::GetUVW);
753 PropertyManager->
Tie(
"velocities/w-fps",
this, eW, (PMF)&FGPropagate::GetUVW);
756 PropertyManager->
Tie(
"velocities/q-rad_sec",
this, eQ, (PMF)&FGPropagate::GetPQR);
757 PropertyManager->
Tie(
"velocities/r-rad_sec",
this, eR, (PMF)&FGPropagate::GetPQR);
760 PropertyManager->
Tie(
"velocities/qi-rad_sec",
this, eQ, (PMF)&FGPropagate::GetPQRi);
761 PropertyManager->
Tie(
"velocities/ri-rad_sec",
this, eR, (PMF)&FGPropagate::GetPQRi);
764 PropertyManager->
Tie(
"velocities/eci-y-fps",
this, eY, (PMF)&FGPropagate::GetInertialVelocity);
765 PropertyManager->
Tie(
"velocities/eci-z-fps",
this, eZ, (PMF)&FGPropagate::GetInertialVelocity);
772 PropertyManager->
Tie(
"position/lat-gc-rad",
this, &FGPropagate::GetLatitude, &FGPropagate::SetLatitude,
false);
773 PropertyManager->
Tie(
"position/long-gc-rad",
this, &FGPropagate::GetLongitude, &FGPropagate::SetLongitude,
false);
774 PropertyManager->
Tie(
"position/lat-gc-deg",
this, &FGPropagate::GetLatitudeDeg, &FGPropagate::SetLatitudeDeg,
false);
775 PropertyManager->
Tie(
"position/long-gc-deg",
this, &FGPropagate::GetLongitudeDeg, &FGPropagate::SetLongitudeDeg,
false);
776 PropertyManager->
Tie(
"position/lat-geod-rad",
this, &FGPropagate::GetGeodLatitudeRad);
777 PropertyManager->
Tie(
"position/lat-geod-deg",
this, &FGPropagate::GetGeodLatitudeDeg);
778 PropertyManager->
Tie(
"position/geod-alt-ft",
this, &FGPropagate::GetGeodeticAltitude);
779 PropertyManager->
Tie(
"position/h-agl-ft",
this, &FGPropagate::GetDistanceAGL, &FGPropagate::SetDistanceAGL);
780 PropertyManager->
Tie(
"position/geod-alt-km",
this, &FGPropagate::GetGeodeticAltitudeKm);
781 PropertyManager->
Tie(
"position/h-agl-km",
this, &FGPropagate::GetDistanceAGLKm, &FGPropagate::SetDistanceAGLKm);
782 PropertyManager->
Tie(
"position/radius-to-vehicle-ft",
this, &FGPropagate::GetRadius);
783 PropertyManager->
Tie(
"position/terrain-elevation-asl-ft",
this,
784 &FGPropagate::GetTerrainElevation,
785 &FGPropagate::SetTerrainElevation,
false);
788 PropertyManager->
Tie(
"position/eci-y-ft",
this, eY, (PMF)&FGPropagate::GetInertialPosition);
789 PropertyManager->
Tie(
"position/eci-z-ft",
this, eZ, (PMF)&FGPropagate::GetInertialPosition);
791 PropertyManager->
Tie(
"position/ecef-x-ft",
this, eX, (PMF)&FGPropagate::GetLocation);
792 PropertyManager->
Tie(
"position/ecef-y-ft",
this, eY, (PMF)&FGPropagate::GetLocation);
793 PropertyManager->
Tie(
"position/ecef-z-ft",
this, eZ, (PMF)&FGPropagate::GetLocation);
795 PropertyManager->
Tie(
"position/epa-rad",
this, &FGPropagate::GetEarthPositionAngle);
799 PropertyManager->
Tie(
"attitude/theta-rad",
this, (
int)eTht, (PMF)&FGPropagate::GetEuler);
800 PropertyManager->
Tie(
"attitude/psi-rad",
this, (
int)ePsi, (PMF)&FGPropagate::GetEuler);
803 PropertyManager->
Tie(
"attitude/theta-deg",
this, (
int)eTht, (PMF)&FGPropagate::GetEulerDeg);
804 PropertyManager->
Tie(
"attitude/psi-deg",
this, (
int)ePsi, (PMF)&FGPropagate::GetEulerDeg);
806 PropertyManager->
Tie(
"attitude/roll-rad",
this, (
int)ePhi, (PMF)&FGPropagate::GetEuler);
807 PropertyManager->
Tie(
"attitude/pitch-rad",
this, (
int)eTht, (PMF)&FGPropagate::GetEuler);
808 PropertyManager->
Tie(
"attitude/heading-true-rad",
this, (
int)ePsi, (PMF)&FGPropagate::GetEuler);
810 PropertyManager->
Tie(
"simulation/integrator/rate/rotational", (
int*)&integrator_rotational_rate);
811 PropertyManager->
Tie(
"simulation/integrator/rate/translational", (
int*)&integrator_translational_rate);
812 PropertyManager->
Tie(
"simulation/integrator/position/rotational", (
int*)&integrator_rotational_position);
813 PropertyManager->
Tie(
"simulation/integrator/position/translational", (
int*)&integrator_translational_position);
815 PropertyManager->
Tie(
"simulation/write-state-file",
this, (iPMF)0, &FGPropagate::WriteStateFile);
837 void FGPropagate::Debug(
int from)
839 if (debug_lvl <= 0)
return;
846 if (debug_lvl & 2 ) {
847 if (from == 0) cout <<
"Instantiated: FGPropagate" << endl;
848 if (from == 1) cout <<
"Destroyed: FGPropagate" << endl;
850 if (debug_lvl & 4 ) {
852 if (debug_lvl & 8 && from == 2) {
854 <<
" Propagation Report (English units: ft, degrees) at simulation time " << FDMExec->
GetSimTime() <<
" seconds" 857 cout <<
highint <<
" Earth Position Angle (deg): " << setw(8) << setprecision(3) <<
reset 858 << GetEarthPositionAngleDeg() << endl;
860 cout <<
highint <<
" Body velocity (ft/sec): " << setw(8) << setprecision(3) <<
reset << VState.
vUVW << endl;
861 cout <<
highint <<
" Local velocity (ft/sec): " << setw(8) << setprecision(3) <<
reset << vVel << endl;
862 cout <<
highint <<
" Inertial velocity (ft/sec): " << setw(8) << setprecision(3) <<
reset << VState.vInertialVelocity << endl;
863 cout <<
highint <<
" Inertial Position (ft): " << setw(10) << setprecision(3) <<
reset << VState.vInertialPosition << endl;
869 cout <<
highint <<
" Matrix ECEF to Body (Orientation of Body with respect to ECEF): " 870 <<
reset << endl << Tec2b.
Dump(
"\t",
" ") << endl;
871 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
875 cout <<
highint <<
" Matrix Body to ECEF (Orientation of ECEF with respect to Body):" 876 <<
reset << endl << Tb2ec.
Dump(
"\t",
" ") << endl;
877 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
881 cout <<
highint <<
" Matrix Local to Body (Orientation of Body with respect to Local):" 882 <<
reset << endl << Tl2b.
Dump(
"\t",
" ") << endl;
883 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
887 cout <<
highint <<
" Matrix Body to Local (Orientation of Local with respect to Body):" 888 <<
reset << endl << Tb2l.
Dump(
"\t",
" ") << endl;
889 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
893 cout <<
highint <<
" Matrix Local to ECEF (Orientation of ECEF with respect to Local):" 894 <<
reset << endl << Tl2ec.
Dump(
"\t",
" ") << endl;
895 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
899 cout <<
highint <<
" Matrix ECEF to Local (Orientation of Local with respect to ECEF):" 900 <<
reset << endl << Tec2l.
Dump(
"\t",
" ") << endl;
901 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
905 cout <<
highint <<
" Matrix ECEF to Inertial (Orientation of Inertial with respect to ECEF):" 906 <<
reset << endl << Tec2i.
Dump(
"\t",
" ") << endl;
907 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
911 cout <<
highint <<
" Matrix Inertial to ECEF (Orientation of ECEF with respect to Inertial):" 912 <<
reset << endl << Ti2ec.
Dump(
"\t",
" ") << endl;
913 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
917 cout <<
highint <<
" Matrix Inertial to Body (Orientation of Body with respect to Inertial):" 918 <<
reset << endl << Ti2b.
Dump(
"\t",
" ") << endl;
919 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
923 cout <<
highint <<
" Matrix Body to Inertial (Orientation of Inertial with respect to Body):" 924 <<
reset << endl << Tb2i.
Dump(
"\t",
" ") << endl;
925 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
929 cout <<
highint <<
" Matrix Inertial to Local (Orientation of Local with respect to Inertial):" 930 <<
reset << endl << Ti2l.
Dump(
"\t",
" ") << endl;
931 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
935 cout <<
highint <<
" Matrix Local to Inertial (Orientation of Inertial with respect to Local):" 936 <<
reset << endl << Tl2i.
Dump(
"\t",
" ") << endl;
937 cout <<
highint <<
" Associated Euler angles (deg): " << setw(8)
941 cout << setprecision(6);
943 if (debug_lvl & 16) {
946 cerr << endl <<
"Vehicle rotation rate is excessive (>1000 rad/sec): " << VState.
vPQR.
Magnitude() << endl;
950 cerr << endl <<
"Vehicle velocity is excessive (>1e10 ft/sec): " << VState.
vUVW.
Magnitude() << endl;
953 if (fabs(GetDistanceAGL()) > 1e10) {
954 cerr << endl <<
"Vehicle altitude is excessive (>1e10 ft): " << GetDistanceAGL() << endl;
959 if (debug_lvl & 64) {
961 cout << IdSrc << endl;
962 cout << IdHdr << endl;
bool Run(bool Holding)
Runs the state propagation model; called by the Executive Can pass in a value indicating if the execu...
Models the Quaternion representation of rotations.
FGColumnVector3 vPQRi
The angular velocity vector for the vehicle body frame relative to the ECI frame, expressed in the bo...
FGQuaternion GetQDot(const FGColumnVector3 &PQR) const
Quaternion derivative for given angular rates.
const FGMatrix33 & GetT(void) const
Transformation matrix.
~FGPropagate()
Destructor.
double GetSeaLevelRadius(void) const
Get the local sea level radius.
double GetEulerDeg(int i) const
Retrieves the Euler angles.
void SetAltitudeAGL(double altitudeAGL)
Set the altitude above ground level.
const FGColumnVector3 GetPQRRadpsIC(void) const
Gets the initial body rotation rate.
bool InitModel(void)
Initializes the FGPropagate class after instantiation and prior to first execution.
const FGColumnVector3 & GetPQRi(void) const
Retrieves the body angular rates vector, relative to the ECI (inertial) frame.
double GetNEDVelocityMagnitude(void) const
Retrieves the total local NED velocity in ft/sec.
double GetGeodLatitudeDeg(void) const
Get the geodetic latitude in degrees.
const SGPath & GetFullAircraftPath(void)
Retrieves the full aircraft path name.
static char reset[5]
resets text properties
FGLocation holds an arbitrary location in the Earth centered Earth fixed reference frame (ECEF)...
double GetAltitudeASLmeters(void) const
Returns the current altitude above sea level.
virtual void SetSeaLevelRadius(double radius)
Set the sea level radius.
FGLocation vLocation
Represents the current location of the vehicle in Earth centered Earth fixed (ECEF) frame...
double GetContactPoint(FGLocation &contact, FGColumnVector3 &normal, FGColumnVector3 &v, FGColumnVector3 &w) const
Get terrain contact point information below the current location.
double GetAltitudeASL(void) const
Returns the current altitude above sea level.
FGColumnVector3 GetEulerDeg(void) const
Retrieves the Euler angles (in degrees) that define the vehicle orientation.
The current vehicle state vector structure contains the translational and angular position...
const FGColumnVector3 GetUVWFpsIC(void) const
Gets the initial body velocity.
const FGColumnVector3 & GetUVW(void) const
Retrieves the body frame vehicle velocity vector.
const FGColumnVector3 & GetPQR(void) const
Retrieves the body angular rates vector, relative to the ECEF frame.
void SetEllipse(double semimajor, double semiminor)
Sets the semimajor and semiminor axis lengths for this planet.
virtual bool Run(bool Holding)
Runs the model; called by the Executive.
std::string Dump(const std::string &delimeter) const
Prints the contents of the vector.
FGQuaternion qAttitudeLocal
The current orientation of the vehicle, that is, the orientation of the body frame relative to the lo...
const FGMatrix33 & GetTi2ec(void) const
Transform matrix from inertial to earth centered frame.
FGColumnVector3 vPQR
The angular velocity vector for the vehicle relative to the ECEF frame, expressed in the body frame...
Models the EOM and integration/propagation of state.
void Tie(const std::string &name, bool *pointer, bool useDefault=true)
Tie a property to an external bool variable.
double GetLocalTerrainRadius(void) const
Returns the "constant" LocalTerrainRadius.
Base class for all scheduled JSBSim models.
const FGColumnVector3 & GetVel(void) const
Retrieves the velocity vector.
double GetTerrainRadius(void) const
Get the local terrain radius.
static char underoff[6]
underline off
FGGroundCallback * GetGroundCallback(void)
Get a pointer to the ground callback currently used.
const FGQuaternion & GetOrientation(void) const
Gets the initial orientation.
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles that define the vehicle orientation.
double GetInertialVelocityMagnitude(void) const
Retrieves the total inertial velocity in ft/sec.
This class implements a 3 element column vector.
FGQuaternion qAttitudeECI
The current orientation of the vehicle, that is, the orientation of the body frame relative to the in...
const FGColumnVector3 & GetInertialPosition(void) const
Retrieves the inertial position vector.
static char fgblue[6]
blue text
Initializes the simulation run.
double GetLongitudeDeg() const
Get the longitude.
bool IntegrationSuspended(void) const
Returns the simulation suspension state.
double GetSimTime(void) const
Returns the cumulative simulation time in seconds.
FGQuaternion GetQuaternion(void) const
Returns the quaternion associated with this direction cosine (rotation) matrix.
double Gethdot(void) const
Returns the current altitude rate.
const FGColumnVector3 & GetInertialVelocity(void) const
Retrieves the inertial velocity vector in ft/sec.
static char highint[5]
highlights text
FGMatrix33 Transposed(void) const
Transposed matrix.
double Magnitude(void) const
Length of the vector.
double GetLatitudeDeg() const
Get the latitude.
eIntegrateType
These define the indices use to select the various integrators.
void Normalize(void)
Normalize.
const FGColumnVector3 & GetEuler(void) const
Retrieves the Euler angles.
const FGMatrix33 & GetTl2ec(void) const
Transform matrix from local horizontal to earth centered frame.
Encapsulates the JSBSim simulation executive.
const FGMatrix33 & GetTi2l(void) const
Transform matrix from the inertial to local horizontal frame.
static char underon[5]
underlines text
void IncrementEarthPositionAngle(double delta)
Increments the Earth position angle.
FGColumnVector3 vUVW
The velocity vector of the vehicle with respect to the ECEF frame, expressed in the body system...
void SetHoldDown(bool hd)
Sets the property forces/hold-down.
const FGLocation & GetPosition(void) const
Gets the initial position.
std::string Dump(const std::string &delimeter) const
Prints the contents of the matrix.
double GetAltitudeAGL(void) const
Get the altitude above ground level.
virtual void SetTerrainGeoCentRadius(double radius)
Set the local terrain radius.