ekf2: update getter for true airspeed

This commit is contained in:
bresch
2021-10-25 10:29:59 +02:00
committed by Mathieu Bresciani
parent 3927c183de
commit 456dfcb4b9
2 changed files with 3 additions and 5 deletions
+2 -4
View File
@@ -168,11 +168,9 @@ void Ekf::fuseAirspeed()
}
}
void Ekf::get_true_airspeed(float *tas) const
float Ekf::getTrueAirspeed() const
{
const float tempvar = sqrtf(sq(_state.vel(0) - _state.wind_vel(0)) + sq(_state.vel(1) - _state.wind_vel(1)) + sq(
_state.vel(2)));
memcpy(tas, &tempvar, sizeof(float));
return (_state.vel - Vector3f(_state.wind_vel(0), _state.wind_vel(1), 0.f)).norm();
}
/*
+1 -1
View File
@@ -134,7 +134,7 @@ public:
Vector2f getWindVelocityVariance() const { return P.slice<2, 2>(22, 22).diag(); }
// get the true airspeed in m/s
void get_true_airspeed(float *tas) const;
float getTrueAirspeed() const;
// get the full covariance matrix
const matrix::SquareMatrix<float, 24> &covariances() const { return P; }