From 1e393530edba673990e4b70316d17c56134bc030 Mon Sep 17 00:00:00 2001 From: Paul Riseborough Date: Tue, 18 Apr 2017 17:06:31 +1000 Subject: [PATCH] EKF: Fix travis clang build error --- EKF/covariance.cpp | 4 ++-- EKF/drag_fusion.cpp | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/EKF/covariance.cpp b/EKF/covariance.cpp index 49549cfbc9..42fe9265e2 100644 --- a/EKF/covariance.cpp +++ b/EKF/covariance.cpp @@ -156,8 +156,8 @@ void Ekf::predictCovariance() // inhibit learning of imu acccel bias if the manoeuvre levels are too high to protect against the effect of sensor nonlinearities or bad accel data is detected float alpha = 1.0f - math::constrain((dt / _params.acc_bias_learn_tc), 0.0f, 1.0f); - _ang_rate_mag_filt = fmax(_imu_sample_delayed.delta_ang.norm(), alpha * _ang_rate_mag_filt); - _accel_mag_filt = fmax(_imu_sample_delayed.delta_vel.norm(), alpha * _accel_mag_filt); + _ang_rate_mag_filt = fmaxf(_imu_sample_delayed.delta_ang.norm(), alpha * _ang_rate_mag_filt); + _accel_mag_filt = fmaxf(_imu_sample_delayed.delta_vel.norm(), alpha * _accel_mag_filt); if (_ang_rate_mag_filt > dt * _params.acc_bias_learn_gyr_lim || _accel_mag_filt > dt * _params.acc_bias_learn_acc_lim || _bad_vert_accel_detected) { diff --git a/EKF/drag_fusion.cpp b/EKF/drag_fusion.cpp index f4abf826b1..4ce84402f4 100644 --- a/EKF/drag_fusion.cpp +++ b/EKF/drag_fusion.cpp @@ -94,7 +94,7 @@ void Ekf::fuseDrag() // Estimate the derivative of specific force wrt airspeed along the X axis // Limit lower value to prevent arithmetic exceptions - float Kacc = fmax(1e-1f,rho * BC_inv_x * airSpd); + float Kacc = fmaxf(1e-1f,rho * BC_inv_x * airSpd); SH_ACC[0] = sq(q0) + sq(q1) - sq(q2) - sq(q3); SH_ACC[1] = vn - vwn; @@ -164,7 +164,7 @@ void Ekf::fuseDrag() // Estimate the derivative of specific force wrt airspeed along the X axis // Limit lower value to prevent arithmetic exceptions - float Kacc = fmax(1e-1f,rho * BC_inv_y * airSpd); + float Kacc = fmaxf(1e-1f,rho * BC_inv_y * airSpd); SH_ACC[0] = sq(q0) - sq(q1) + sq(q2) - sq(q3); SH_ACC[1] = vn - vwn;