From: curt Date: Fri, 4 Aug 2000 03:20:09 +0000 (+0000) Subject: 20000803 updates. X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=120b26cc88c094515dab58fbd50d1a9673cde9c0;p=flightgear.git 20000803 updates. --- diff --git a/src/FDM/JSBSim.cxx b/src/FDM/JSBSim.cxx index bca731b59..376afdfc2 100644 --- a/src/FDM/JSBSim.cxx +++ b/src/FDM/JSBSim.cxx @@ -160,7 +160,8 @@ int FGJSBsim::init( double dt ) { FG_LOG( FG_FLIGHT, FG_INFO, "Finished initializing JSBSim" ); copy_from_JSBsim(); - + + return 1; } @@ -344,6 +345,12 @@ int FGJSBsim::copy_from_JSBsim() { 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() ); @@ -365,7 +372,7 @@ int FGJSBsim::copy_from_JSBsim() { 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 ); diff --git a/src/FDM/JSBSim/FGAuxiliary.cpp b/src/FDM/JSBSim/FGAuxiliary.cpp index 618fbc74d..71cf25b26 100644 --- a/src/FDM/JSBSim/FGAuxiliary.cpp +++ b/src/FDM/JSBSim/FGAuxiliary.cpp @@ -60,6 +60,7 @@ FGAuxiliary::FGAuxiliary(FGFDMExec* fdmex) : FGModel(fdmex) { Name = "FGAuxiliary"; vcas = veas = mach = qbar = pt = 0; psl = rhosl = 1; + earthPosAngle = 0.0; } @@ -93,8 +94,10 @@ bool FGAuxiliary::Run() { veas = sqrt(2*qbar/rhosl); vPilotAccel = Translation->GetUVWdot() + Aircraft->GetXYZep() * Rotation->GetPQRdot(); - - + + + + earthPosAngle += State->Getdt()*OMEGA_EARTH; } else { } diff --git a/src/FDM/JSBSim/FGAuxiliary.h b/src/FDM/JSBSim/FGAuxiliary.h index f3b6e87de..08fba1e34 100644 --- a/src/FDM/JSBSim/FGAuxiliary.h +++ b/src/FDM/JSBSim/FGAuxiliary.h @@ -65,6 +65,8 @@ public: inline FGColumnVector GetPilotAccel(void) { return vPilotAccel; } inline FGColumnVector GetNpilot(void) { return vPilotAccel*INVGRAVITY; } + inline float GetEarthPositionAngle(void) { return earthPosAngle; } + protected: @@ -83,6 +85,8 @@ private: FGColumnVector vPilotAccel; + + float earthPosAngle; void GetState(void); }; diff --git a/src/FDM/JSBSim/FGDefs.h b/src/FDM/JSBSim/FGDefs.h index 05b5cc79f..8ebf61a78 100644 --- a/src/FDM/JSBSim/FGDefs.h +++ b/src/FDM/JSBSim/FGDefs.h @@ -54,6 +54,7 @@ SENTRY #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 diff --git a/src/FDM/JSBSim/FGMatrix.cpp b/src/FDM/JSBSim/FGMatrix.cpp index 5b4f5da10..6e51fa17d 100644 --- a/src/FDM/JSBSim/FGMatrix.cpp +++ b/src/FDM/JSBSim/FGMatrix.cpp @@ -344,24 +344,22 @@ FGMatrix FGMatrix::operator/(const double scalar) } } - } 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; + } } /******************************************************************************/ @@ -521,15 +519,9 @@ FGColumnVector FGColumnVector::operator/(const double scalar) { 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; - - } /******************************************************************************/ diff --git a/src/FDM/JSBSim/FGTank.cpp b/src/FDM/JSBSim/FGTank.cpp index 22a611344..12fdf2ae0 100644 --- a/src/FDM/JSBSim/FGTank.cpp +++ b/src/FDM/JSBSim/FGTank.cpp @@ -58,11 +58,12 @@ FGTank::FGTank(FGConfigFile* AC_cfg) *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; } } diff --git a/src/FDM/JSBSim/JSBSim.cpp b/src/FDM/JSBSim/JSBSim.cpp index aff77319c..7e2790d79 100644 --- a/src/FDM/JSBSim/JSBSim.cpp +++ b/src/FDM/JSBSim/JSBSim.cpp @@ -120,7 +120,7 @@ int main(int argc, char** argv) 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 /* diff --git a/src/FDM/flight.hxx b/src/FDM/flight.hxx index dad9bacd8..ea54f977b 100644 --- a/src/FDM/flight.hxx +++ b/src/FDM/flight.hxx @@ -637,6 +637,9 @@ public: 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++ ) {