1
0
Fork 0

Autopilot: fix initialization of digital filters

This commit is contained in:
Torsten Dreyer 2010-10-05 14:29:36 +02:00
parent dba471519f
commit 9ffaf11aa5

View file

@ -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 );