added ev_pos flag check to valid_lpos, disable fake gps when ev_pos is valid

This commit is contained in:
Nic
2016-05-17 21:07:04 -07:00
parent 50ba26a434
commit 1b16f3575a
2 changed files with 4 additions and 2 deletions
+3 -1
View File
@@ -393,5 +393,7 @@ 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) || global_position_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();
}