mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-17 05:43:33 +08:00
EKF: Add function to calculate global position validity
This commit is contained in:
@@ -393,3 +393,10 @@ void Ekf::zeroCols(float (&cov_mat)[_k_num_states][_k_num_states], uint8_t first
|
||||
memset(&cov_mat[row][first], 0, sizeof(cov_mat[0][0]) * (1 + last - first));
|
||||
}
|
||||
}
|
||||
|
||||
bool Ekf::global_position_is_valid()
|
||||
{
|
||||
// return true if the position estimate is valid
|
||||
// TODO implement proper check based on published GPS accuracy, innovation consistency checks and timeout status
|
||||
return (_NED_origin_initialised && ((_time_last_imu - _time_last_gps) < 5e6) && _control_status.flags.gps);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user