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 "math/FGColumnVector3.h"
42 #include "math/FGMatrix33.h"
43 #include "FGSensorOrientation.h"
45 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
47 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
49 #define ID_ACCELEROMETER "$Id: FGAccelerometer.h,v 1.7 2013/11/24 11:40:56 bcoconni Exp $"
51 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
53 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
59 class FGAccelerations;
63 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
65 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
67 /** Encapsulates a Accelerometer component for the flight control system.
72 <accelerometer name="name">
73 <location unit="{IN | M}">
78 <orientation unit="{RAD | DEG}">
79 <pitch> {number} </pitch>
80 <roll> {number} </roll>
83 <axis> {X | Y | Z} </axis>
85 <noise variation="PERCENT|ABSOLUTE"> number </noise>
86 <quantization name="name">
91 <drift_rate> number </drift_rate>
100 <accelerometer name="aero/accelerometer/right_tip_wing">
108 <noise variation="PERCENT"> 2 </noise>
109 <quantization name="aero/accelerometer/quantized/right_tip_wing">
118 The only required element in the accelerometer definition is the input element. In that
119 case, no degradation would be modeled, and the output would simply be the input.
121 For noise, if the type is PERCENT, then the value supplied is understood to be a
122 percentage variance. That is, if the number given is 0.05, the the variance is
123 understood to be +/-0.05 percent maximum variance. So, the actual value for the accelerometer
124 will be *anywhere* from 0.95 to 1.05 of the actual "perfect" value at any time -
125 even varying all the way from 0.95 to 1.05 in adjacent frames - whatever the delta
128 @author Jon S. Berndt
129 @version $Revision: 1.7 $
132 /*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
134 %%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
136 class FGAccelerometer : public FGSensor, public FGSensorOrientation
139 FGAccelerometer(FGFCS* fcs, Element* element);
145 FGPropagate* Propagate;
146 FGAccelerations* Accelerations;
147 FGMassBalance* MassBalance;
148 FGInertial* Inertial;
149 FGColumnVector3 vLocation;
150 FGColumnVector3 vRadius;
151 FGColumnVector3 vAccel;
153 void Debug(int from);