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:
parent
6705a2ec6d
commit
fcf40ec6a8
1 changed files with 7 additions and 0 deletions
|
@ -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 ) )
|
||||
|
|
Loading…
Reference in a new issue