1
0
Fork 0

Added magnetic compass instrument.

Removed some unused bind/unbind methods.

Improved responsiveness of slip-skid ball.

Some minor cleanups.
This commit is contained in:
david 2003-01-26 15:56:11 +00:00
parent acbb9f5aff
commit f72891e113
10 changed files with 18 additions and 48 deletions

View file

@ -8,6 +8,7 @@ libInstrumentation_a_SOURCES = instrument_mgr.cxx instrument_mgr.hxx \
turn_indicator.cxx turn_indicator.hxx \ turn_indicator.cxx turn_indicator.hxx \
slip_skid_ball.cxx slip_skid_ball.hxx \ slip_skid_ball.cxx slip_skid_ball.hxx \
heading_indicator.cxx heading_indicator.hxx \ heading_indicator.cxx heading_indicator.hxx \
vertical_speed_indicator.cxx vertical_speed_indicator.hxx vertical_speed_indicator.cxx vertical_speed_indicator.hxx \
mag_compass.cxx mag_compass.hxx
INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src INCLUDES = -I$(top_srcdir) -I$(top_srcdir)/src

View file

@ -35,17 +35,6 @@ AirspeedIndicator::init ()
true); true);
} }
void
AirspeedIndicator::bind ()
{
}
void
AirspeedIndicator::unbind ()
{
}
#ifndef SEA_LEVEL_DENSITY_SLUGFG3 #ifndef SEA_LEVEL_DENSITY_SLUGFG3
# define SEA_LEVEL_DENSITY_SLUGFT3 0.002378 # define SEA_LEVEL_DENSITY_SLUGFT3 0.002378
#endif #endif

View file

@ -37,8 +37,6 @@ public:
virtual ~AirspeedIndicator (); virtual ~AirspeedIndicator ();
virtual void init (); virtual void init ();
virtual void bind ();
virtual void unbind ();
virtual void update (double dt); virtual void update (double dt);
private: private:

View file

@ -67,16 +67,6 @@ Altimeter::init ()
fgGetNode("/instrumentation/altimeter/indicated-altitude-ft", true); fgGetNode("/instrumentation/altimeter/indicated-altitude-ft", true);
} }
void
Altimeter::bind ()
{
}
void
Altimeter::unbind ()
{
}
void void
Altimeter::update (double dt) Altimeter::update (double dt)
{ {

View file

@ -40,8 +40,6 @@ public:
virtual ~Altimeter (); virtual ~Altimeter ();
virtual void init (); virtual void init ();
virtual void bind ();
virtual void unbind ();
virtual void update (double dt); virtual void update (double dt);
private: private:

View file

@ -12,6 +12,7 @@
#include "slip_skid_ball.hxx" #include "slip_skid_ball.hxx"
#include "heading_indicator.hxx" #include "heading_indicator.hxx"
#include "vertical_speed_indicator.hxx" #include "vertical_speed_indicator.hxx"
#include "mag_compass.hxx"
FGInstrumentMgr::FGInstrumentMgr () FGInstrumentMgr::FGInstrumentMgr ()
@ -23,6 +24,7 @@ FGInstrumentMgr::FGInstrumentMgr ()
set_subsystem("ball", new SlipSkidBall); set_subsystem("ball", new SlipSkidBall);
set_subsystem("hi", new HeadingIndicator); set_subsystem("hi", new HeadingIndicator);
set_subsystem("vsi", new VerticalSpeedIndicator); set_subsystem("vsi", new VerticalSpeedIndicator);
set_subsystem("compass", new MagCompass);
} }
FGInstrumentMgr::~FGInstrumentMgr () FGInstrumentMgr::~FGInstrumentMgr ()

View file

@ -19,22 +19,25 @@ SlipSkidBall::~SlipSkidBall ()
void void
SlipSkidBall::init () SlipSkidBall::init ()
{ {
_y_accel_node = fgGetNode("/orientation/roll-rate-degps", true); _serviceable_node =
_z_accel_node = fgGetNode("/orientation/yaw-rate-degps", true); fgGetNode("/instrumentation/slip-skid-ball/serviceable", true);
_y_accel_node = fgGetNode("/accelerations/pilot/y-accel-fps_sec", true);
_z_accel_node = fgGetNode("/accelerations/pilot/z-accel-fps_sec", true);
_out_node = _out_node =
fgGetNode("/instrumentation/slip-skid-ball/indicated-slip-skid", true); fgGetNode("/instrumentation/slip-skid-ball/indicated-slip-skid", true);
} }
void void
SlipSkidBall::update (double dt) SlipSkidBall::update (double delta_time_sec)
{ {
double d = -_z_accel_node->getDoubleValue(); if (_serviceable_node->getBoolValue()) {
if (d < 60.0) // originally 1 radian double d = -_z_accel_node->getDoubleValue();
d = 60.0; if (d < 1.0)
double pos = _y_accel_node->getDoubleValue()/d; d = 1.0;
pos = fgGetLowPass(_last_pos, pos, dt); double pos = _y_accel_node->getDoubleValue() / d * 5.0;
_last_pos = pos; pos = fgGetLowPass(_out_node->getDoubleValue(), pos, delta_time_sec);
_out_node->setDoubleValue(pos); _out_node->setDoubleValue(pos);
}
} }
// end of slip_skid_ball.cxx // end of slip_skid_ball.cxx

View file

@ -45,6 +45,7 @@ private:
Gyro _gyro; Gyro _gyro;
double _last_pos; double _last_pos;
SGPropertyNode_ptr _serviceable_node;
SGPropertyNode_ptr _y_accel_node; SGPropertyNode_ptr _y_accel_node;
SGPropertyNode_ptr _z_accel_node; SGPropertyNode_ptr _z_accel_node;
SGPropertyNode_ptr _out_node; SGPropertyNode_ptr _out_node;

View file

@ -32,16 +32,6 @@ VerticalSpeedIndicator::init ()
true); true);
} }
void
VerticalSpeedIndicator::bind ()
{
}
void
VerticalSpeedIndicator::unbind ()
{
}
void void
VerticalSpeedIndicator::update (double dt) VerticalSpeedIndicator::update (double dt)
{ {

View file

@ -36,8 +36,6 @@ public:
virtual ~VerticalSpeedIndicator (); virtual ~VerticalSpeedIndicator ();
virtual void init (); virtual void init ();
virtual void bind ();
virtual void unbind ();
virtual void update (double dt); virtual void update (double dt);
private: private: