mirror of
https://gitee.com/mirrors_PX4/PX4-Autopilot.git
synced 2026-10-15 13:43:35 +08:00
EKF: Use consistent test for navigation validity reporting
This will enable controller to take advantage of non-inertial dead reckoning.
This commit is contained in:
+2
-3
@@ -1144,9 +1144,8 @@ void Ekf::zeroCols(float (&cov_mat)[_k_num_states][_k_num_states], uint8_t 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);
|
||||
// return true if we are not doing unconstrained free inertial navigation and the origin is set
|
||||
return (_NED_origin_initialised && !inertial_dead_reckoning());
|
||||
}
|
||||
|
||||
// return true if we are totally reliant on inertial dead-reckoning for position
|
||||
|
||||
@@ -464,8 +464,6 @@ void EstimatorInterface::unallocate_buffers()
|
||||
|
||||
bool EstimatorInterface::local_position_is_valid()
|
||||
{
|
||||
// return true if the position estimate is valid
|
||||
return (((_time_last_imu - _time_last_optflow) < 5e6) && _control_status.flags.opt_flow) ||
|
||||
(((_time_last_imu - _time_last_ext_vision) < 5e6) && _control_status.flags.ev_pos) ||
|
||||
global_position_is_valid();
|
||||
// return true if we are not doing unconstrained free inertial navigation
|
||||
return !inertial_dead_reckoning();
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user