1
0
Fork 0

Autopilot: initialize the derivative filter

Dont let the derivative filter emit a spike on init or reset if the input
value is non-zero. This is a potential fix for #973.
This commit is contained in:
Torsten Dreyer 2012-12-31 21:27:13 +01:00
parent 6705a2ec6d
commit fcf40ec6a8

View file

@ -75,6 +75,7 @@ class DerivativeFilterImplementation : public GainFilterImplementation {
public:
DerivativeFilterImplementation();
double compute( double dt, double input );
virtual void initialize( double output );
};
class ExponentialFilterImplementation : public GainFilterImplementation {
@ -180,6 +181,12 @@ DerivativeFilterImplementation::DerivativeFilterImplementation() :
{
}
void DerivativeFilterImplementation::initialize( double output )
{
_input_1 = output;
}
bool DerivativeFilterImplementation::configure( const std::string & nodeName, SGPropertyNode_ptr configNode )
{
if( GainFilterImplementation::configure( nodeName, configNode ) )