]> git.mxchange.org Git - flightgear.git/blobdiff - src/FDM/JSBSim/models/flight_control/FGAccelerometer.cpp
Merge branch 'next' of gitorious.org:fg/flightgear into next
[flightgear.git] / src / FDM / JSBSim / models / flight_control / FGAccelerometer.cpp
old mode 100755 (executable)
new mode 100644 (file)
index e5c529d..028509d
@@ -38,10 +38,19 @@ INCLUDES
 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
 
 #include "FGAccelerometer.h"
+#include <iostream>
+#include <cstdlib>
+
+#include "models/FGPropagate.h"
+#include "models/FGAccelerations.h"
+#include "models/FGMassBalance.h"
+#include "models/FGInertial.h"
+
+using namespace std;
 
 namespace JSBSim {
 
-static const char *IdSrc = "$Id$";
+static const char *IdSrc = "$Id: FGAccelerometer.cpp,v 1.9 2011/07/17 13:51:23 jberndt Exp $";
 static const char *IdHdr = ID_ACCELEROMETER;
 
 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
@@ -53,6 +62,7 @@ FGAccelerometer::FGAccelerometer(FGFCS* fcs, Element* element)
     FGSensorOrientation(element)
 {
   Propagate = fcs->GetExec()->GetPropagate();
+  Accelerations = fcs->GetExec()->GetAccelerations();
   MassBalance = fcs->GetExec()->GetMassBalance();
   Inertial = fcs->GetExec()->GetInertial();
   
@@ -84,8 +94,8 @@ bool FGAccelerometer::Run(void )
   vAccel = Propagate->GetTl2b() * FGColumnVector3(0, 0, Inertial->gravity());
 
   //aircraft forces
-  vAccel += (Propagate->GetUVWdot()
-              + Propagate->GetPQRdot() * vRadius
+  vAccel += (Accelerations->GetUVWdot()
+              + Accelerations->GetPQRdot() * vRadius
               + Propagate->GetPQR() * (Propagate->GetPQR() * vRadius));
 
   // transform to the specified orientation