From 84fe5f4e78b4cce7b8c0cd542e227d1c6d5b12cb Mon Sep 17 00:00:00 2001 From: Peter Hall <33176108+IamPete1@users.noreply.github.com> Date: Tue, 7 Jan 2020 00:47:35 +0000 Subject: [PATCH] APM_Control: move to airspeed_estimate with pointer --- libraries/APM_Control/AP_PitchController.cpp | 4 ++-- libraries/APM_Control/AP_RollController.cpp | 2 +- libraries/APM_Control/AP_YawController.cpp | 2 +- 3 files changed, 4 insertions(+), 4 deletions(-) diff --git a/libraries/APM_Control/AP_PitchController.cpp b/libraries/APM_Control/AP_PitchController.cpp index fdf6fc982e..f06a05c664 100644 --- a/libraries/APM_Control/AP_PitchController.cpp +++ b/libraries/APM_Control/AP_PitchController.cpp @@ -239,7 +239,7 @@ int32_t AP_PitchController::_get_rate_out(float desired_rate, float scaler, bool int32_t AP_PitchController::get_rate_out(float desired_rate, float scaler) { float aspeed; - if (!_ahrs.airspeed_estimate(&aspeed)) { + if (!_ahrs.airspeed_estimate(aspeed)) { // If no airspeed available use average of min and max aspeed = 0.5f*(float(aparm.airspeed_min) + float(aparm.airspeed_max)); } @@ -270,7 +270,7 @@ float AP_PitchController::_get_coordination_rate_offset(float &aspeed, bool &inv bank_angle = constrain_float(bank_angle,-radians(180),-radians(100)); } } - if (!_ahrs.airspeed_estimate(&aspeed)) { + if (!_ahrs.airspeed_estimate(aspeed)) { // If no airspeed available use average of min and max aspeed = 0.5f*(float(aparm.airspeed_min) + float(aparm.airspeed_max)); } diff --git a/libraries/APM_Control/AP_RollController.cpp b/libraries/APM_Control/AP_RollController.cpp index d0a94064cc..18fdc6e455 100644 --- a/libraries/APM_Control/AP_RollController.cpp +++ b/libraries/APM_Control/AP_RollController.cpp @@ -114,7 +114,7 @@ int32_t AP_RollController::_get_rate_out(float desired_rate, float scaler, bool // Get an airspeed estimate - default to zero if none available float aspeed; - if (!_ahrs.airspeed_estimate(&aspeed)) { + if (!_ahrs.airspeed_estimate(aspeed)) { aspeed = 0.0f; } diff --git a/libraries/APM_Control/AP_YawController.cpp b/libraries/APM_Control/AP_YawController.cpp index 0b87fea902..fb6daa55e1 100644 --- a/libraries/APM_Control/AP_YawController.cpp +++ b/libraries/APM_Control/AP_YawController.cpp @@ -98,7 +98,7 @@ int32_t AP_YawController::get_servo_out(float scaler, bool disable_integrator) if (fabsf(bank_angle) < 1.5707964f) { bank_angle = constrain_float(bank_angle,-1.3962634f,1.3962634f); } - if (!_ahrs.airspeed_estimate(&aspeed)) { + if (!_ahrs.airspeed_estimate(aspeed)) { // If no airspeed available use average of min and max aspeed = 0.5f*(float(aspd_min) + float(aparm.airspeed_max)); }