diff --git a/src/Autopilot/autopilotgroup.cxx b/src/Autopilot/autopilotgroup.cxx index a856c342f..8cf389f8e 100644 --- a/src/Autopilot/autopilotgroup.cxx +++ b/src/Autopilot/autopilotgroup.cxx @@ -65,7 +65,9 @@ void FGXMLAutopilotGroupImplementation::addAutopilot( const std::string & name, } FGXMLAutopilot::Autopilot * ap = new FGXMLAutopilot::Autopilot( apNode, config ); ap->set_name( name ); - set_subsystem( name, ap ); + + double updateInterval = config->getDoubleValue( "update-interval-secs", 0.0 ); + set_subsystem( name, ap, updateInterval ); _autopilotNames.push_back( name ); } diff --git a/src/Autopilot/digitalfilter.cxx b/src/Autopilot/digitalfilter.cxx index d73a2585e..d3b55cb4d 100644 --- a/src/Autopilot/digitalfilter.cxx +++ b/src/Autopilot/digitalfilter.cxx @@ -251,7 +251,7 @@ void NoiseSpikeFilterImplementation::initialize( double output ) double NoiseSpikeFilterImplementation::compute( double dt, double input ) { double delta = input - _output_1; - if( delta == 0.0 ) return input; // trivial + if( fabs(delta) <= SGLimitsd::min() ) return input; // trivial double maxChange = _rateOfChangeInput.get_value() * dt; const PeriodicalValue * periodical = _digitalFilter->getPeriodicalValue(); diff --git a/src/Autopilot/inputvalue.cxx b/src/Autopilot/inputvalue.cxx index d097cef91..6fd686b33 100644 --- a/src/Autopilot/inputvalue.cxx +++ b/src/Autopilot/inputvalue.cxx @@ -41,8 +41,11 @@ double PeriodicalValue::normalize( double value ) const double PeriodicalValue::normalizeSymmetric( double value ) const { - value = SGMiscd::normalizePeriodic( minPeriod->get_value(), maxPeriod->get_value(), value ); - double width_2 = (maxPeriod->get_value() - minPeriod->get_value())/2; + double minValue = minPeriod->get_value(); + double maxValue = maxPeriod->get_value(); + + value = SGMiscd::normalizePeriodic( minValue, maxValue, value ); + double width_2 = (maxValue - minValue)/2; return value > width_2 ? width_2 - value : value; }