%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
#include "FGSensor.h"
-#include <input_output/FGXMLElement.h>
+#include "input_output/FGXMLElement.h"
#include "models/FGPropagate.h"
#include "models/FGMassBalance.h"
#include "models/FGInertial.h"
#include "math/FGColumnVector3.h"
#include "math/FGMatrix33.h"
+#include "FGSensorOrientation.h"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
DEFINITIONS
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-#define ID_MAGNETOMETER "$Id$"
+#define ID_MAGNETOMETER "$Id: FGMagnetometer.h,v 1.4 2009/12/11 06:03:06 jberndt Exp $"
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
FORWARD DECLARATIONS
@code
<magnetometer name="name">
- <input> property </input>
+ <axis> {X|Y|Z} </axis>
<lag> number </lag>
+ <orientation unit=DEG">
+ <x> number </x>
+ <y> number </y>
+ <z> number </z>
+ </orientation>
<noise variation="PERCENT|ABSOLUTE"> number </noise>
<quantization name="name">
<bits> number </bits>
Example:
@code
-<magnetometer name="aero/magnetometer/qbar">
- <input> aero/qbar </input>
+<magnetometer name="aero/magnetometer/X">
+ <axis> X </axis>
<lag> 0.5 </lag>
<noise variation="PERCENT"> 2 </noise>
<quantization name="aero/magnetometer/quantized/qbar">
</magnetometer>
@endcode
-The only required element in the magnetometer definition is the input element. In that
-case, no degradation would be modeled, and the output would simply be the input.
+The only required element in the magnetometer definition is the axis element. In
+the default case, no degradation would be modeled, and the output would simply be
+the input.
For noise, if the type is PERCENT, then the value supplied is understood to be a
percentage variance. That is, if the number given is 0.05, the the variance is
time.
@author Jon S. Berndt
-@version $Revision$
+@version $Revision: 1.4 $
*/
/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
CLASS DECLARATION
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
-class FGMagnetometer : public FGSensor
+class FGMagnetometer : public FGSensor, public FGSensorOrientation
{
public:
FGMagnetometer(FGFCS* fcs, Element* element);
FGMassBalance* MassBalance;
FGInertial* Inertial;
FGColumnVector3 vLocation;
- FGColumnVector3 vOrient;
FGColumnVector3 vRadius;
FGColumnVector3 vMag;
- FGMatrix33 mT;
- void CalculateTransformMatrix(void);
void updateInertialMag(void);
- int axis;
double field[6];
double usedLat;
double usedLon;