mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-04-14 10:07:39 +08:00
ekf2: update getter for true airspeed
This commit is contained in:
parent
3927c183de
commit
456dfcb4b9
@ -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();
|
||||
}
|
||||
|
||||
/*
|
||||
|
||||
@ -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; }
|
||||
|
||||
Loading…
x
Reference in New Issue
Block a user