2006-10-23 21:58:28 +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_MRG_HXX
|
|
|
|
#define __INSTRUMENTS_MRG_HXX 1
|
|
|
|
|
|
|
|
|
|
|
|
#include <simgear/props/props.hxx>
|
|
|
|
#include <simgear/structure/subsystem_mgr.hxx>
|
|
|
|
|
|
|
|
#include "gyro.hxx"
|
|
|
|
|
|
|
|
|
|
|
|
/**
|
2008-11-11 21:20:02 +00:00
|
|
|
* Model an electrically-powered master reference gyro.
|
2006-10-23 21:58:28 +00:00
|
|
|
*
|
|
|
|
* Input properties:
|
|
|
|
*
|
|
|
|
* /instrumentation/"name"/config/tumble-flag
|
|
|
|
* /instrumentation/"name"/serviceable
|
|
|
|
* /instrumentation/"name"/caged-flag
|
|
|
|
* /instrumentation/"name"/tumble-norm
|
|
|
|
* /orientation/pitch-deg
|
|
|
|
* /orientation/roll-deg
|
|
|
|
*
|
|
|
|
* Output properties:
|
|
|
|
*
|
|
|
|
* /instrumentation/"name"/indicated-pitch-deg
|
|
|
|
* /instrumentation/"name"/indicated-roll-deg
|
|
|
|
* /instrumentation/"name"/tumble-norm
|
|
|
|
*/
|
|
|
|
|
|
|
|
class MasterReferenceGyro : public SGSubsystem
|
|
|
|
{
|
|
|
|
|
|
|
|
public:
|
|
|
|
|
|
|
|
MasterReferenceGyro ( SGPropertyNode *node );
|
|
|
|
MasterReferenceGyro ();
|
|
|
|
virtual ~MasterReferenceGyro ();
|
|
|
|
|
|
|
|
virtual void init ();
|
2012-09-17 00:12:29 +02:00
|
|
|
virtual void reinit ();
|
2006-10-23 21:58:28 +00:00
|
|
|
virtual void bind ();
|
|
|
|
virtual void unbind ();
|
|
|
|
virtual void update (double dt);
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
2010-10-28 17:32:22 +01:00
|
|
|
static const double gravity; //conversion factor
|
|
|
|
|
2011-10-17 17:41:59 +01:00
|
|
|
std::string _name;
|
2006-12-06 22:11:43 +00:00
|
|
|
int _num;
|
2006-10-23 21:58:28 +00:00
|
|
|
|
|
|
|
double _last_roll;
|
|
|
|
double _last_pitch;
|
|
|
|
double _last_hdg;
|
|
|
|
double _indicated_roll;
|
|
|
|
double _indicated_pitch;
|
|
|
|
double _indicated_hdg;
|
|
|
|
double _indicated_pitch_rate;
|
|
|
|
double _indicated_roll_rate;
|
|
|
|
double _indicated_hdg_rate;
|
|
|
|
double _last_roll_rate;
|
|
|
|
double _last_pitch_rate;
|
|
|
|
double _last_yaw_rate;
|
2008-11-11 21:20:02 +00:00
|
|
|
double _last_g;
|
2009-01-18 21:56:55 +00:00
|
|
|
double _erect_time;
|
2010-10-28 17:32:22 +01:00
|
|
|
double _g_error;
|
2006-10-23 21:58:28 +00:00
|
|
|
|
|
|
|
Gyro _gyro;
|
|
|
|
|
|
|
|
SGPropertyNode_ptr _tumble_flag_node;
|
|
|
|
SGPropertyNode_ptr _caged_node;
|
|
|
|
SGPropertyNode_ptr _off_node;
|
|
|
|
SGPropertyNode_ptr _tumble_node;
|
|
|
|
SGPropertyNode_ptr _pitch_in_node;
|
|
|
|
SGPropertyNode_ptr _roll_in_node;
|
|
|
|
SGPropertyNode_ptr _hdg_in_node;
|
2008-11-11 21:20:02 +00:00
|
|
|
SGPropertyNode_ptr _hdg_mag_in_node;
|
2006-10-23 21:58:28 +00:00
|
|
|
SGPropertyNode_ptr _g_in_node;
|
|
|
|
SGPropertyNode_ptr _electrical_node;
|
|
|
|
SGPropertyNode_ptr _pitch_int_node;
|
|
|
|
SGPropertyNode_ptr _roll_int_node;
|
|
|
|
SGPropertyNode_ptr _hdg_int_node;
|
|
|
|
SGPropertyNode_ptr _pitch_out_node;
|
|
|
|
SGPropertyNode_ptr _roll_out_node;
|
|
|
|
SGPropertyNode_ptr _hdg_out_node;
|
2008-11-11 21:20:02 +00:00
|
|
|
SGPropertyNode_ptr _hdg_mag_out_node;
|
2006-10-23 21:58:28 +00:00
|
|
|
SGPropertyNode_ptr _pitch_rate_out_node;
|
|
|
|
SGPropertyNode_ptr _roll_rate_out_node;
|
|
|
|
SGPropertyNode_ptr _hdg_rate_out_node;
|
|
|
|
SGPropertyNode_ptr _error_out_node;
|
|
|
|
SGPropertyNode_ptr _yaw_rate_node;
|
|
|
|
SGPropertyNode_ptr _roll_rate_node;
|
|
|
|
SGPropertyNode_ptr _pitch_rate_node;
|
|
|
|
SGPropertyNode_ptr _responsiveness_node;
|
2008-11-11 21:20:02 +00:00
|
|
|
SGPropertyNode_ptr _hdg_input_source_node;
|
2009-01-18 21:56:55 +00:00
|
|
|
SGPropertyNode_ptr _fast_erect_node;
|
2006-10-23 21:58:28 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
#endif // __INSTRUMENTS_MRG_HXX
|