1 // slip_skid_ball.cxx - an electric-powered turn indicator.
2 // Written by David Megginson, started 2003.
4 // This file is in the Public Domain and comes with no warranty.
6 #include "slip_skid_ball.hxx"
7 #include <Main/fg_props.hxx>
8 #include <Main/util.hxx>
11 SlipSkidBall::SlipSkidBall ()
15 SlipSkidBall::~SlipSkidBall ()
22 _y_accel_node = fgGetNode("/orientation/roll-rate-degps", true);
23 _z_accel_node = fgGetNode("/orientation/yaw-rate-degps", true);
25 fgGetNode("/instrumentation/slip-skid-ball/indicated-slip-skid", true);
29 SlipSkidBall::update (double dt)
31 double d = -_z_accel_node->getDoubleValue();
32 if (d < 60.0) // originally 1 radian
34 double pos = _y_accel_node->getDoubleValue()/d;
35 pos = fgGetLowPass(_last_pos, pos, dt);
37 _out_node->setDoubleValue(pos);
40 // end of slip_skid_ball.cxx