From e24febec1b423d0648da29b5d5b2a83fbd770d33 Mon Sep 17 00:00:00 2001 From: Andrew Tridgell Date: Mon, 7 Jul 2014 13:36:30 +1000 Subject: [PATCH] AP_TECS: avoid a valgrind bug --- libraries/AP_TECS/AP_TECS.cpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/libraries/AP_TECS/AP_TECS.cpp b/libraries/AP_TECS/AP_TECS.cpp index 38ec07e11c..a7cee03c40 100644 --- a/libraries/AP_TECS/AP_TECS.cpp +++ b/libraries/AP_TECS/AP_TECS.cpp @@ -243,7 +243,7 @@ void AP_TECS::_update_speed(void) // airspeed is not being used and set speed rate to zero if (!_ahrs.airspeed_sensor_enabled() || !_ahrs.airspeed_estimate(&_EAS)) { // If no airspeed available use average of min and max - _EAS = 0.5f * (aparm.airspeed_min + aparm.airspeed_max); + _EAS = 0.5f * (aparm.airspeed_min.get() + (float)aparm.airspeed_max.get()); } // Implement a second order complementary filter to obtain a