From: Torsten Dreyer Date: Tue, 5 Oct 2010 12:29:36 +0000 (+0200) Subject: Autopilot: fix initialization of digital filters X-Git-Url: https://git.mxchange.org/?a=commitdiff_plain;h=9ffaf11aa5e78ee5c6864fdaa0c3d0a5ea9097d1;p=flightgear.git Autopilot: fix initialization of digital filters --- diff --git a/src/Autopilot/digitalfilter.cxx b/src/Autopilot/digitalfilter.cxx index 9edf53b82..bdd39397a 100644 --- a/src/Autopilot/digitalfilter.cxx +++ b/src/Autopilot/digitalfilter.cxx @@ -343,8 +343,10 @@ void DigitalFilter::update( bool firstTime, double dt) { if( _implementation == NULL ) return; - if( firstTime ) - _implementation->initialize( get_output_value() ); + if( firstTime ) { + SG_LOG(SG_AUTOPILOT,SG_DEBUG, "First time initialization of " << get_name() << " to " << _valueInput.get_value() ); + _implementation->initialize( _valueInput.get_value() ); + } double input = _valueInput.get_value() - _referenceInput.get_value(); double output = _implementation->compute( dt, input );