EKF: reduce scope of variable and remove redeclaration of member

This commit is contained in:
bresch
2020-05-08 15:44:13 +02:00
committed by Mathieu Bresciani
parent edc8a88c24
commit 26d4fbc000
3 changed files with 2 additions and 4 deletions
+1 -2
View File
@@ -588,9 +588,8 @@ Matrix3f EKFGSF_yaw::ahrsPredictRotMat(const Matrix3f &R, const Vector3f &g)
ret(2,2) += R(2,0) * g(1) - R(2,1) * g(0);
// Renormalise rows
float rowLengthSq;
for (uint8_t r = 0; r < 3; r++) {
rowLengthSq = ret.row(r).norm_squared();
const float rowLengthSq = ret.row(r).norm_squared();
if (rowLengthSq > FLT_EPSILON) {
// Use linear approximation for inverse sqrt taking advantage of the row length being close to 1.0
const float rowLengthInv = 1.5f - 0.5f * rowLengthSq;
-1
View File
@@ -347,7 +347,6 @@ private:
uint64_t _time_last_of_fuse{0}; ///< time the last fusion of optical flow measurements were performed (uSec)
uint64_t _time_last_arsp_fuse{0}; ///< time the last fusion of airspeed measurements were performed (uSec)
uint64_t _time_last_beta_fuse{0}; ///< time the last fusion of synthetic sideslip measurements were performed (uSec)
uint64_t _time_last_mag{0}; ///< measurement time of last magnetomter sample (uSec)
uint64_t _time_last_fake_pos{0}; ///< last time we faked position measurements to constrain tilt errors during operation without external aiding (uSec)
Vector2f _last_known_posNE; ///< last known local NE position vector (m)
+1 -1
View File
@@ -540,7 +540,7 @@ protected:
// timestamps of latest in buffer saved measurement in microseconds
uint64_t _time_last_imu{0};
uint64_t _time_last_gps{0};
uint64_t _time_last_mag{0};
uint64_t _time_last_mag{0}; ///< measurement time of last magnetomter sample (uSec)
uint64_t _time_last_baro{0};
uint64_t _time_last_range{0};
uint64_t _time_last_airspeed{0};