]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/mag_compass.hxx
GPS: fix bad init when far from any airport
[flightgear.git] / src / Instrumentation / mag_compass.hxx
1 // mag_compass.hxx - an altimeter tied to the static port.
2 // Written by David Megginson, started 2002.
3 //
4 // This file is in the Public Domain and comes with no warranty.
5
6
7 #ifndef __INSTRUMENTS_MAG_COMPASS_HXX
8 #define __INSTRUMENTS_MAG_COMPASS_HXX 1
9
10 #ifndef __cplusplus
11 # error This library requires C++
12 #endif
13
14 #include <simgear/props/props.hxx>
15 #include <simgear/structure/subsystem_mgr.hxx>
16 #include <simgear/math/interpolater.hxx>
17
18
19 /**
20  * Model a magnetic compass.
21  *
22  * Input properties:
23  *
24  * /instrumentation/"name"/serviceable
25  * /instrumentation/"name"/pitch-offset-deg
26  * /instrumentation/"name"/max-pitch-deg
27  * /instrumentation/"name"/max-roll-deg
28  * /orientation/roll-deg
29  * /orientation/pitch-deg
30  * /orientation/heading-magnetic-deg
31  * /orientation/side-slip-deg
32  * /environment/magnetic-dip-deg
33  * /accelerations/pilot/north-accel-fps_sec
34  * /accelerations/pilot/east-accel-fps_sec
35  * /accelerations/pilot/down-accel-fps_sec
36  *
37  * Output properties:
38  *
39  * /instrumentation/"name"/indicated-heading-deg
40  */
41 class MagCompass : public SGSubsystem
42 {
43
44 public:
45
46     MagCompass ( SGPropertyNode *node);
47     MagCompass ();
48     virtual ~MagCompass ();
49
50     virtual void init ();
51     virtual void reinit ();
52     virtual void update (double dt);
53
54 private:
55
56     double _rate_degps;
57
58     std::string _name;
59     int _num;
60     SGSharedPtr<SGInterpTable> _deviation_table;
61     SGPropertyNode_ptr _deviation_node;
62
63     SGPropertyNode_ptr _serviceable_node;
64     SGPropertyNode_ptr _pitch_offset_node;
65     SGPropertyNode_ptr _roll_node;
66     SGPropertyNode_ptr _pitch_node;
67     SGPropertyNode_ptr _heading_node;
68     SGPropertyNode_ptr _beta_node;
69     SGPropertyNode_ptr _dip_node;
70     SGPropertyNode_ptr _x_accel_node;
71     SGPropertyNode_ptr _y_accel_node;
72     SGPropertyNode_ptr _z_accel_node;
73     SGPropertyNode_ptr _out_node;
74
75 };
76
77 #endif // __INSTRUMENTS_MAG_COMPASS_HXX