mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-31 02:11:35 +08:00
EKF: Add true airspeed accessor
This commit is contained in:
@@ -225,6 +225,12 @@ void Ekf::get_wind_velocity(float *wind)
|
|||||||
wind[1] = _state.wind_vel(1);
|
wind[1] = _state.wind_vel(1);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
void Ekf::get_true_airspeed(float *tas)
|
||||||
|
{
|
||||||
|
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));
|
||||||
|
}
|
||||||
|
|
||||||
/*
|
/*
|
||||||
* Reset the wind states using the current airspeed measurement, ground relative nav velocity, yaw angle and assumption of zero sideslip
|
* Reset the wind states using the current airspeed measurement, ground relative nav velocity, yaw angle and assumption of zero sideslip
|
||||||
*/
|
*/
|
||||||
|
|||||||
@@ -112,6 +112,9 @@ public:
|
|||||||
// get the wind velocity in m/s
|
// get the wind velocity in m/s
|
||||||
void get_wind_velocity(float *wind);
|
void get_wind_velocity(float *wind);
|
||||||
|
|
||||||
|
// get the true airspeed in m/s
|
||||||
|
void get_true_airspeed(float *tas);
|
||||||
|
|
||||||
// get the diagonal elements of the covariance matrix
|
// get the diagonal elements of the covariance matrix
|
||||||
void get_covariances(float *covariances);
|
void get_covariances(float *covariances);
|
||||||
|
|
||||||
|
|||||||
@@ -93,6 +93,8 @@ public:
|
|||||||
|
|
||||||
virtual void get_wind_velocity(float *wind) = 0;
|
virtual void get_wind_velocity(float *wind) = 0;
|
||||||
|
|
||||||
|
virtual void get_true_airspeed(float *tas) = 0;
|
||||||
|
|
||||||
virtual void get_covariances(float *covariances) = 0;
|
virtual void get_covariances(float *covariances) = 0;
|
||||||
|
|
||||||
// gets the variances for the NED velocity states
|
// gets the variances for the NED velocity states
|
||||||
|
|||||||
Reference in New Issue
Block a user