2003-01-26 15:53:35 +00:00
|
|
|
// mag_compass.hxx - an altimeter tied to the static port.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INSTRUMENTS_MAG_COMPASS_HXX
|
|
|
|
#define __INSTRUMENTS_MAG_COMPASS_HXX 1
|
|
|
|
|
|
|
|
#ifndef __cplusplus
|
|
|
|
# error This library requires C++
|
|
|
|
#endif
|
|
|
|
|
2003-05-06 23:46:24 +00:00
|
|
|
#include <simgear/props/props.hxx>
|
2003-09-24 17:20:55 +00:00
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
2003-01-26 15:53:35 +00:00
|
|
|
|
|
|
|
|
|
|
|
/**
|
|
|
|
* Model a magnetic compass.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/serviceable
|
2003-01-26 15:53:35 +00:00
|
|
|
* /orientation/heading-deg
|
|
|
|
* /orientation/beta-deg
|
|
|
|
* /environment/magnetic-variation-deg
|
|
|
|
* /environment/magnetic-dip-deg
|
|
|
|
* /accelerations/ned/north-accel-fps_sec
|
|
|
|
* /accelerations/ned/east-accel-fps_sec
|
|
|
|
* /accelerations/ned/down-accel-fps_sec
|
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/indicated-heading-deg
|
2003-01-26 15:53:35 +00:00
|
|
|
*/
|
2003-09-24 17:20:55 +00:00
|
|
|
class MagCompass : public SGSubsystem
|
2003-01-26 15:53:35 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
MagCompass ( SGPropertyNode *node);
|
2003-01-26 15:53:35 +00:00
|
|
|
MagCompass ();
|
|
|
|
virtual ~MagCompass ();
|
|
|
|
|
|
|
|
virtual void init ();
|
|
|
|
virtual void update (double dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
|
|
|
double _error_deg;
|
|
|
|
double _rate_degps;
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
string name;
|
|
|
|
int num;
|
|
|
|
|
2003-01-26 15:53:35 +00:00
|
|
|
SGPropertyNode_ptr _serviceable_node;
|
|
|
|
SGPropertyNode_ptr _heading_node;
|
2004-11-03 15:59:49 +00:00
|
|
|
SGPropertyNode_ptr _roll_node;
|
2003-01-26 15:53:35 +00:00
|
|
|
SGPropertyNode_ptr _beta_node;
|
|
|
|
SGPropertyNode_ptr _variation_node;
|
|
|
|
SGPropertyNode_ptr _dip_node;
|
|
|
|
SGPropertyNode_ptr _y_accel_node;
|
|
|
|
SGPropertyNode_ptr _z_accel_node;
|
|
|
|
SGPropertyNode_ptr _north_accel_node;
|
|
|
|
SGPropertyNode_ptr _east_accel_node;
|
|
|
|
SGPropertyNode_ptr _down_accel_node;
|
|
|
|
SGPropertyNode_ptr _out_node;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_MAG_COMPASS_HXX
|