51 SGPropertyNode *node =
fgGetNode(branch,
true );
52 _roll_rate_node =
fgGetNode(
"/orientation/roll-rate-degps",
true);
53 _yaw_rate_node =
fgGetNode(
"/orientation/yaw-rate-degps",
true);
54 _rate_out_node = node->getChild(
"indicated-turn-rate", 0,
true);
55 _spin_node = node->getChild(
"spin", 0,
true);
56 SGPropertyNode* gyro_node = node->getChild(
"gyro", 0,
true);
57 _gyro_spin_up_node = gyro_node->getChild(
"spin-up-sec", 0,
true);
58 _gyro_spin_down_node = gyro_node->getChild(
"spin-down-sec", 0,
true);
59 if (!_gyro_spin_up_node->hasValue())
60 _gyro_spin_up_node->setDoubleValue(_gyro_spin_up);
61 if (!_gyro_spin_down_node->hasValue())
62 _gyro_spin_down_node->setDoubleValue(_gyro_spin_down);
81 _gyro.set_spin_up(_gyro_spin_up_node->getDoubleValue());
82 _gyro.set_spin_down(_gyro_spin_down_node->getDoubleValue());
83 _gyro.set_spin_norm(_spin_node->getDoubleValue());
85 double spin = _gyro.get_spin_norm();
86 _spin_node->setDoubleValue( spin );
89 double factor = 1.0 - ((1.0 - spin) * (1.0 - spin) * (1.0 - spin));
90 double rate = ((_roll_rate_node->getDoubleValue() / 20.0) +
91 (_yaw_rate_node->getDoubleValue() / 3.0));
100 rate = -2.5 + (factor * (rate + 2.5));
105 _rate_out_node->setDoubleValue(rate);