X-Git-Url: https://git.mxchange.org/?a=blobdiff_plain;f=src%2FFDM%2FJSBSim%2FJSBSim.cpp;h=a41a51e275680ca849508461c7f00686a9dc4069;hb=7cc98ad15f7295cc3665abe6a0d419bf84ada3ac;hp=bbae63b137828b9910cd5e926e9334a484cd51ec;hpb=6caf599f2bc5cb77dcdd67ef92cc3ff9984b8c8c;p=flightgear.git diff --git a/src/FDM/JSBSim/JSBSim.cpp b/src/FDM/JSBSim/JSBSim.cpp index bbae63b13..a41a51e27 100644 --- a/src/FDM/JSBSim/JSBSim.cpp +++ b/src/FDM/JSBSim/JSBSim.cpp @@ -101,6 +101,7 @@ USEUNIT("FGAerodynamics.cpp"); #include "FGPosition.h" #include "FGAuxiliary.h" #include "FGOutput.h" +#include "FGInitialCondition.h" #ifdef FGFS #include @@ -115,6 +116,8 @@ USEUNIT("FGAerodynamics.cpp"); #include #endif +static const char *IdSrc = "$Header$"; + int main(int argc, char** argv) { FGFDMExec* FDMExec; @@ -129,17 +132,38 @@ int main(int argc, char** argv) FDMExec = new FGFDMExec(); - result = FDMExec->LoadModel("aircraft", "engine", string(argv[1])); + result = FDMExec->LoadModel("/home/tony/FlightGear/Aircraft", + "/home/tony/FlightGear/Engine", + string(argv[1])); if (!result) { cerr << "Aircraft file " << argv[1] << " was not found" << endl; exit(-1); } - if ( ! FDMExec->GetState()->Reset("aircraft", string(argv[1]), string(argv[2]))) + if ( ! FDMExec->GetState()->Reset("/home/tony/FlightGear/Aircraft", + string(argv[1]), string(argv[2]))) FDMExec->GetState()->Initialize(2000,0,0,0,0,0,0.5,0.5,40000); - - float cmd = 0.0; + + FGInitialCondition *fgic= new FGInitialCondition(FDMExec); + fgic->SetUBodyFpsIC(170); + fgic->SetTrueHeadingDegIC(275); + FDMExec->RunIC(fgic); + cout << "FDMExec->GetTranslation()->GetVt(): " << FDMExec->GetTranslation()->GetVt() << endl; + cout << "FDMExec->GetPosition()->GetVn(): " << FDMExec->GetPosition()->GetVn() << endl; + cout << "FDMExec->GetPosition()->GetVe(): " << FDMExec->GetPosition()->GetVe() << endl; + cout << "FDMExec->GetAuxiliary()->GetVcalibratedKTS(): " << FDMExec->GetAuxiliary()->GetVcalibratedKTS() << endl; + fgic->SetVnorthFpsIC(170); + cout << "fgic->GetUBodyFpsIC(): " << fgic->GetUBodyFpsIC() << endl; + cout << "fgic->GetVBodyFpsIC(): " << fgic->GetVBodyFpsIC() << endl; + cout << "fgic->GetWBodyFpsIC(): " << fgic->GetWBodyFpsIC() << endl; + FDMExec->RunIC(fgic); + cout << "FDMExec->GetTranslation()->GetVt(): " << FDMExec->GetTranslation()->GetVt() << endl; + cout << "FDMExec->GetPosition()->GetVn(): " << FDMExec->GetPosition()->GetVn() << endl; + cout << "FDMExec->GetPosition()->GetVe(): " << FDMExec->GetPosition()->GetVe() << endl; + cout << "FDMExec->GetAuxiliary()->GetVcalibratedKTS(): " << FDMExec->GetAuxiliary()->GetVcalibratedKTS() << endl; + + /* float cmd = 0.0; while (FDMExec->GetState()->Getsim_time() <= 10.0) { @@ -164,6 +188,7 @@ int main(int argc, char** argv) FDMExec->Run(); } + */ delete FDMExec;