FG_LOG( FG_FLIGHT, FG_INFO, "Finished initializing JSBSim" );
copy_from_JSBsim();
-
+
+
return 1;
}
set_Euler_Angles( FDMExec.GetRotation()->Getphi(),
FDMExec.GetRotation()->Gettht(),
FDMExec.GetRotation()->Getpsi() );
+
+ for(int i=0; i<3; i++ ) {
+ for (int j=0; j<3; j++ ) {
+ set_T_Local_to_Body(i,j,FDMExec.GetState()->GetTl2b()(i,j));
+ }
+ }
set_Alpha( FDMExec.GetTranslation()->Getalpha() );
set_Beta( FDMExec.GetTranslation()->Getbeta() );
set_Static_pressure( FDMExec.GetAtmosphere()->GetPressure() );
set_Static_temperature ( FDMExec.GetAtmosphere()->GetTemperature() );
-
+ set_Earth_position_angle( FDMExec.GetAuxiliary()->GetEarthPositionAngle() );
/* **FIXME*** */ set_Sea_level_radius( sl_radius2 * METER_TO_FEET );
/* **FIXME*** */ set_Earth_position_angle( 0.0 );
Name = "FGAuxiliary";
vcas = veas = mach = qbar = pt = 0;
psl = rhosl = 1;
+ earthPosAngle = 0.0;
}
veas = sqrt(2*qbar/rhosl);
vPilotAccel = Translation->GetUVWdot() + Aircraft->GetXYZep() * Rotation->GetPQRdot();
-
-
+
+
+
+ earthPosAngle += State->Getdt()*OMEGA_EARTH;
} else {
}
inline FGColumnVector GetPilotAccel(void) { return vPilotAccel; }
inline FGColumnVector GetNpilot(void) { return vPilotAccel*INVGRAVITY; }
+ inline float GetEarthPositionAngle(void) { return earthPosAngle; }
+
protected:
FGColumnVector vPilotAccel;
+
+ float earthPosAngle;
void GetState(void);
};
#define KTSTOFPS 1.68781
#define FPSTOKTS 0.592484
#define INCHTOFT 0.08333333
+#define OMEGA_EARTH .00007272205217
#define NEEDED_CFG_VERSION "1.30"
#define HPTOFTLBSSEC 550
}
}
- } else
- cerr << "Attempt to divide by zero in method FGMatrix::operator/(const double scalar), object at " << this << endl;
- return Quot;
+ }
+ return Quot;
}
/******************************************************************************/
void FGMatrix::operator/=(const double scalar)
{
-
+
if(scalar != 0) {
for (unsigned int i=1; i<=Rows(); i++) {
for (unsigned int j=1; j<=Cols(); j++) {
data[i][j]/=scalar;
}
}
- } else
- cerr << "Attempt to divide by zero in method FGMatrix::operator/=(const double scalar), object " << this << endl;
+ }
}
/******************************************************************************/
{
FGColumnVector Quotient(Rows());
if(scalar != 0) {
-
-
for (unsigned int i=1; i<=Rows(); i++) Quotient(i) = data[i][1] / scalar;
-
- } else
- cerr << "Attempt to divide by zero in method FGColumnVector::operator/(const double scalar), object " << this << endl;
+ }
return Quotient;
-
-
}
/******************************************************************************/
*AC_cfg >> Capacity; // pounds (amount it can hold)
*AC_cfg >> Contents; // pounds (amount it is holding)
Selected = true;
- if(Capacity != 0)
+
+ if (Capacity != 0) {
PctFull = 100.0*Contents/Capacity; // percent full; 0 to 100.0
- else {
- Contents=0;
- PctFull=0;
+ } else {
+ Contents = 0;
+ PctFull = 0;
}
}
float cmd = 0.0;
- while (FDMExec->GetState()->Getsim_time() <= 145.0)
+ while (FDMExec->GetState()->Getsim_time() <= 10.0)
{
// Fake an elevator ramp here after 1 second, hold for one second, ramp down
/*
inline double get_T_local_to_body_33() const {
return t_local_to_body_m[2][2];
}
+ inline void set_T_Local_to_Body( int i, int j, double value) {
+ t_local_to_body_m[i-1][j-1] = value;
+ }
inline void set_T_Local_to_Body( double m[3][3] ) {
int i, j;
for ( i = 0; i < 3; i++ ) {