2002-09-24 14:51:37 +00:00
|
|
|
// attitude_indicator.hxx - a vacuum-powered attitude indicator.
|
|
|
|
// Written by David Megginson, started 2002.
|
|
|
|
//
|
|
|
|
// This file is in the Public Domain and comes with no warranty.
|
|
|
|
|
|
|
|
|
|
|
|
#ifndef __INSTRUMENTS_ATTITUDE_INDICATOR_HXX
|
|
|
|
#define __INSTRUMENTS_ATTITUDE_INDICATOR_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>
|
2002-09-24 14:51:37 +00:00
|
|
|
|
2003-01-25 19:49:27 +00:00
|
|
|
#include "gyro.hxx"
|
|
|
|
|
2002-09-24 14:51:37 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Model a vacuum-powered attitude indicator.
|
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/config/tumble-flag
|
|
|
|
* /instrumentation/"name"/serviceable
|
|
|
|
* /instrumentation/"name"/caged-flag
|
|
|
|
* /instrumentation/"name"/tumble-norm
|
2002-09-24 14:51:37 +00:00
|
|
|
* /orientation/pitch-deg
|
|
|
|
* /orientation/roll-deg
|
2004-10-16 12:37:39 +00:00
|
|
|
* "vacuum-system"/suction-inhg
|
2002-09-24 14:51:37 +00:00
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
2004-10-16 12:37:39 +00:00
|
|
|
* /instrumentation/"name"/indicated-pitch-deg
|
|
|
|
* /instrumentation/"name"/indicated-roll-deg
|
|
|
|
* /instrumentation/"name"/tumble-norm
|
2002-09-24 14:51:37 +00:00
|
|
|
*/
|
2003-09-24 17:20:55 +00:00
|
|
|
class AttitudeIndicator : public SGSubsystem
|
2002-09-24 14:51:37 +00:00
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
AttitudeIndicator ( SGPropertyNode *node );
|
2002-09-24 14:51:37 +00:00
|
|
|
AttitudeIndicator ();
|
|
|
|
virtual ~AttitudeIndicator ();
|
|
|
|
|
|
|
|
virtual void init ();
|
|
|
|
virtual void bind ();
|
|
|
|
virtual void unbind ();
|
|
|
|
virtual void update (double dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2004-10-16 12:37:39 +00:00
|
|
|
string name;
|
|
|
|
int num;
|
|
|
|
string vacuum_system;
|
|
|
|
|
2003-01-25 19:49:27 +00:00
|
|
|
Gyro _gyro;
|
|
|
|
|
2003-04-04 03:25:02 +00:00
|
|
|
SGPropertyNode_ptr _tumble_flag_node;
|
2003-04-05 14:37:12 +00:00
|
|
|
SGPropertyNode_ptr _caged_node;
|
|
|
|
SGPropertyNode_ptr _tumble_node;
|
2002-09-24 14:51:37 +00:00
|
|
|
SGPropertyNode_ptr _pitch_in_node;
|
|
|
|
SGPropertyNode_ptr _roll_in_node;
|
|
|
|
SGPropertyNode_ptr _suction_node;
|
2003-04-25 02:22:06 +00:00
|
|
|
SGPropertyNode_ptr _pitch_int_node;
|
|
|
|
SGPropertyNode_ptr _roll_int_node;
|
2002-09-24 14:51:37 +00:00
|
|
|
SGPropertyNode_ptr _pitch_out_node;
|
|
|
|
SGPropertyNode_ptr _roll_out_node;
|
|
|
|
|
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_ATTITUDE_INDICATOR_HXX
|