APM_Control: move to airspeed_estimate with pointer

This commit is contained in:
Peter Hall 2020-01-07 00:47:35 +00:00 committed by WickedShell
parent 0afa144f80
commit 84fe5f4e78
3 changed files with 4 additions and 4 deletions

View File

@ -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));
}

View File

@ -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;
}

View File

@ -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));
}