1 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
3 Header: FGAccelerometer.h
7 ------------- Copyright (C) 2009 -------------
9 This program is free software; you can redistribute it and/or modify it under
10 the terms of the GNU Lesser General Public License as published by the Free Software
11 Foundation; either version 2 of the License, or (at your option) any later
14 This program is distributed in the hope that it will be useful, but WITHOUT
15 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS
16 FOR A PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
19 You should have received a copy of the GNU Lesser General Public License along with
20 this program; if not, write to the Free Software Foundation, Inc., 59 Temple
21 Place - Suite 330, Boston, MA 02111-1307, USA.
23 Further information about the GNU Lesser General Public License can also be found on
24 the world wide web at http://www.gnu.org.
27 --------------------------------------------------------------------------------
29 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
31 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
33 #ifndef FGACCELEROMETER_H
34 #define FGACCELEROMETER_H
36 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
38 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
41 #include "input_output/FGXMLElement.h"
42 #include "models/FGPropagate.h"
43 #include "models/FGMassBalance.h"
44 #include "models/FGInertial.h"
45 #include "math/FGColumnVector3.h"
46 #include "math/FGMatrix33.h"
47 #include "FGSensorOrientation.h"
49 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
51 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
53 #define ID_ACCELEROMETER "$Id: FGAccelerometer.h,v 1.4 2009/10/02 10:30:09 jberndt Exp $"
55 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
57 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
63 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
67 /** Encapsulates a Accelerometer component for the flight control system.
72 <accelerometer name="name">
73 <input> property </input>
75 <noise variation="PERCENT|ABSOLUTE"> number </noise>
76 <quantization name="name">
81 <drift_rate> number </drift_rate>
89 <accelerometer name="aero/accelerometer/qbar">
90 <input> aero/qbar </input>
92 <noise variation="PERCENT"> 2 </noise>
93 <quantization name="aero/accelerometer/quantized/qbar">
102 The only required element in the accelerometer definition is the input element. In that
103 case, no degradation would be modeled, and the output would simply be the input.
105 For noise, if the type is PERCENT, then the value supplied is understood to be a
106 percentage variance. That is, if the number given is 0.05, the the variance is
107 understood to be +/-0.05 percent maximum variance. So, the actual value for the accelerometer
108 will be *anywhere* from 0.95 to 1.05 of the actual "perfect" value at any time -
109 even varying all the way from 0.95 to 1.05 in adjacent frames - whatever the delta
112 @author Jon S. Berndt
113 @version $Revision: 1.4 $
116 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
118 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
120 class FGAccelerometer : public FGSensor, public FGSensorOrientation
123 FGAccelerometer(FGFCS* fcs, Element* element);
129 FGPropagate* Propagate;
130 FGMassBalance* MassBalance;
131 FGInertial* Inertial;
132 FGColumnVector3 vLocation;
133 FGColumnVector3 vRadius;
134 FGColumnVector3 vAccel;
136 void Debug(int from);