From ffebd8e771c3f474ce08e9ad77d91155107cbff6 Mon Sep 17 00:00:00 2001 From: bresch Date: Tue, 18 Jan 2022 15:52:30 +0100 Subject: [PATCH] ekf2: initialize cos tilt variable assuming no tilt --- src/modules/ekf2/EKF/sensor_range_finder.hpp | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/modules/ekf2/EKF/sensor_range_finder.hpp b/src/modules/ekf2/EKF/sensor_range_finder.hpp index c9dcaa03aa..f8935358a2 100644 --- a/src/modules/ekf2/EKF/sensor_range_finder.hpp +++ b/src/modules/ekf2/EKF/sensor_range_finder.hpp @@ -141,7 +141,7 @@ private: /* * Tilt check */ - float _cos_tilt_rng_to_earth{}; ///< 2,2 element of the rotation matrix from sensor frame to earth frame + float _cos_tilt_rng_to_earth{1.f}; ///< 2,2 element of the rotation matrix from sensor frame to earth frame float _range_cos_max_tilt{0.7071f}; ///< cosine of the maximum tilt angle from the vertical that permits use of range finder and flow data float _pitch_offset_rad{3.14f}; ///< range finder tilt rotation about the Y body axis float _sin_pitch_offset{0.0f}; ///< sine of the range finder tilt rotation about the Y body axis