AP_Soaring: fixed filter constructor calls

fixes valgrind error from copy of filter objects on the stack
This commit is contained in:
Andrew Tridgell 2021-06-06 16:47:58 +10:00
parent a2d0f569c9
commit fbbb4a1183
4 changed files with 4 additions and 11 deletions

View File

@ -149,9 +149,6 @@ SoaringController::SoaringController(AP_SpdHgtControl &spdHgt, const AP_Vehicle:
_throttle_suppressed(true)
{
AP_Param::setup_object_defaults(this, var_info);
_position_x_filter = LowPassFilter<float>(1.0/60.0);
_position_y_filter = LowPassFilter<float>(1.0/60.0);
}
void SoaringController::get_target(Location &wp)

View File

@ -56,8 +56,8 @@ class SoaringController {
float _thermalability;
LowPassFilter<float> _position_x_filter;
LowPassFilter<float> _position_y_filter;
LowPassFilter<float> _position_x_filter{1/60.0};
LowPassFilter<float> _position_y_filter{1/60.0};
protected:
AP_Int8 soar_active;

View File

@ -9,9 +9,6 @@ Manages the estimation of aircraft total energy, drag and vertical air velocity.
Variometer::Variometer(const AP_Vehicle::FixedWing &parms) :
_aparm(parms)
{
_climb_filter = LowPassFilter<float>(1.0/60.0);
_vdot_filter2 = LowPassFilter<float>(1.0f/60.0f);
}
void Variometer::update(const float thermal_bank, const float polar_K, const float polar_Cd0, const float polar_B)

View File

@ -32,9 +32,8 @@ class Variometer {
AverageFilterFloat_Size5 _sp_filter;
// low pass filter @ 30s time constant
LowPassFilter<float> _climb_filter;
LowPassFilter<float> _vdot_filter2;
LowPassFilter<float> _climb_filter{1/60.0};
LowPassFilter<float> _vdot_filter2{1/60.0};
public:
Variometer(const AP_Vehicle::FixedWing &parms);