]> git.mxchange.org Git - flightgear.git/blob - src/Instrumentation/mag_compass.hxx
Begin a rewrite of the magnetic compass code. So far, only northerly
[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
17
18 /**
19  * Model a magnetic compass.
20  *
21  * Input properties:
22  *
23  * /instrumentation/"name"/serviceable
24  * /orientation/heading-deg
25  * /orientation/beta-deg
26  * /environment/magnetic-variation-deg
27  * /environment/magnetic-dip-deg
28  * /accelerations/ned/north-accel-fps_sec
29  * /accelerations/ned/east-accel-fps_sec
30  * /accelerations/ned/down-accel-fps_sec
31  *
32  * Output properties:
33  *
34  * /instrumentation/"name"/indicated-heading-deg
35  */
36 class MagCompass : public SGSubsystem
37 {
38
39 public:
40
41     MagCompass ( SGPropertyNode *node);
42     MagCompass ();
43     virtual ~MagCompass ();
44
45     virtual void init ();
46     virtual void update (double dt);
47
48 private:
49
50     double _error_deg;
51     double _rate_degps;
52
53     string name;
54     int num;
55
56     SGPropertyNode_ptr _serviceable_node;
57     SGPropertyNode_ptr _heading_node;
58     SGPropertyNode_ptr _roll_node;
59     SGPropertyNode_ptr _beta_node;
60     SGPropertyNode_ptr _variation_node;
61     SGPropertyNode_ptr _dip_node;
62     SGPropertyNode_ptr _y_accel_node;
63     SGPropertyNode_ptr _z_accel_node;
64     SGPropertyNode_ptr _north_accel_node;
65     SGPropertyNode_ptr _east_accel_node;
66     SGPropertyNode_ptr _down_accel_node;
67     SGPropertyNode_ptr _out_node;
68
69 };
70
71 #endif // __INSTRUMENTS_MAG_COMPASS_HXX