Browse Source

EKF: reduce scope of variable and remove redeclaration of member

master
bresch 5 years ago committed by Mathieu Bresciani
parent
commit
26d4fbc000
  1. 3
      EKF/EKFGSF_yaw.cpp
  2. 1
      EKF/ekf.h
  3. 2
      EKF/estimator_interface.h

3
EKF/EKFGSF_yaw.cpp

@ -588,9 +588,8 @@ Matrix3f EKFGSF_yaw::ahrsPredictRotMat(const Matrix3f &R, const Vector3f &g) @@ -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
EKF/ekf.h

@ -347,7 +347,6 @@ private: @@ -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)

2
EKF/estimator_interface.h

@ -540,7 +540,7 @@ protected: @@ -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};

Loading…
Cancel
Save