mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-05-18 13:17:36 +08:00
EKF: reduce scope of variable and remove redeclaration of member
This commit is contained in:
committed by
Mathieu Bresciani
parent
edc8a88c24
commit
26d4fbc000
+1
-2
@@ -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);
|
ret(2,2) += R(2,0) * g(1) - R(2,1) * g(0);
|
||||||
|
|
||||||
// Renormalise rows
|
// Renormalise rows
|
||||||
float rowLengthSq;
|
|
||||||
for (uint8_t r = 0; r < 3; r++) {
|
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) {
|
if (rowLengthSq > FLT_EPSILON) {
|
||||||
// Use linear approximation for inverse sqrt taking advantage of the row length being close to 1.0
|
// 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;
|
const float rowLengthInv = 1.5f - 0.5f * rowLengthSq;
|
||||||
|
|||||||
@@ -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_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_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_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)
|
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)
|
Vector2f _last_known_posNE; ///< last known local NE position vector (m)
|
||||||
|
|||||||
@@ -540,7 +540,7 @@ protected:
|
|||||||
// timestamps of latest in buffer saved measurement in microseconds
|
// timestamps of latest in buffer saved measurement in microseconds
|
||||||
uint64_t _time_last_imu{0};
|
uint64_t _time_last_imu{0};
|
||||||
uint64_t _time_last_gps{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_baro{0};
|
||||||
uint64_t _time_last_range{0};
|
uint64_t _time_last_range{0};
|
||||||
uint64_t _time_last_airspeed{0};
|
uint64_t _time_last_airspeed{0};
|
||||||
|
|||||||
Reference in New Issue
Block a user