FlightGear next
FGMagnetometer.h
Go to the documentation of this file.
1/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
2
3 Header: FGMagnetometer.h
4 Author: Matthew Chave
5 Date started: August 2009
6
7 ------------- Copyright (C) 2009 -------------
8
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
11 Software Foundation; either version 2 of the License, or (at your option) any
12 later version.
13
14 This program is distributed in the hope that it will be useful, but WITHOUT ANY
15 WARRANTY; without even the implied warranty of MERCHANTABILITY or FITNESS FOR A
16 PARTICULAR PURPOSE. See the GNU Lesser General Public License for more
17 details.
18
19 You should have received a copy of the GNU Lesser General Public License along
20 with this program; if not, write to the Free Software Foundation, Inc., 59
21 Temple Place - Suite 330, Boston, MA 02111-1307, USA.
22
23 Further information about the GNU Lesser General Public License can also be
24 found on the world wide web at http://www.gnu.org.
25
26HISTORY
27--------------------------------------------------------------------------------
28
29%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
30SENTRY
31%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
32
33#ifndef FGMAGNETOMETER_H
34#define FGMAGNETOMETER_H
35
36/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
37INCLUDES
38%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
39
40#include "FGSensor.h"
41#include "FGSensorOrientation.h"
42
43/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
44FORWARD DECLARATIONS
45%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
46
47namespace JSBSim {
48
49class FGFCS;
50class FGPropagate;
51class FGMassBalance;
52class FGInertial;
53
54/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
55CLASS DOCUMENTATION
56%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
57
114
115/*%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
116CLASS DECLARATION
117%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%*/
119class FGMagnetometer : public FGSensor, public FGSensorOrientation
120{
121public:
122 FGMagnetometer(FGFCS* fcs, Element* element);
124
125 bool Run (void) override;
126 void ResetPastStates(void) override;
127
128private:
129 FGPropagate* Propagate;
130 FGMassBalance* MassBalance;
131 FGInertial* Inertial;
132 FGColumnVector3 vLocation;
133 FGColumnVector3 vRadius;
134 FGColumnVector3 vMag;
135 void updateInertialMag(void);
136 double field[6];
137 double usedLat;
138 double usedLon;
139 double usedAlt;
140 unsigned long int date;
141 unsigned int counter;
142 const unsigned int INERTIAL_UPDATE_RATE;
143
144 void Debug(int from) override;
145};
146}
147#endif
This class implements a 3 element column vector.
Models inertial forces (e.g.
Definition FGInertial.h:65
FGMagnetometer(FGFCS *fcs, Element *element)
void ResetPastStates(void) override
bool Run(void) override
Models weight, balance and moment of inertia information.
Models the EOM and integration/propagation of state.
Definition FGPropagate.h:93
FGSensorOrientation(Element *element)
FGSensor(FGFCS *fcs, Element *element)
Definition FGSensor.cpp:52