Regarding the other error (no local position): it seems to be thrown in
check_invalid_pos_nav_state as soon as
I followed the code and apparently the EKF thinks it’s deadreckoning (
_is_dead_reckoning is set in
Ekf::update_deadreckoning_status() when there is no vel/pos fuse in the last second and
_deadreckon_time_exceeded after 5 seconds.
fuseVelPosHeight there is no vel/pos fuse when
_vel_pos_test_ratio > 1, which indicates some sort of high innovation : state variance ratio.
I was thinking maybe there is a reset from GPS position to EV position, which results in a discontinuity, thus the high ratio. But I’ve been studying this log (in which we were testing the 30 seconds hypothesis) and there is a reset/discontinuity of the EKF position states, but only at ~8 seconds after stopping GPS use.
pos_test_ratio already increases wildly in the exact moment when stopping GPS use.
Edit: OK, maybe everything is caused by said discontinuity:
Ekf::controlGpsFusion the gps control flag is set to
false as soon as GPS checks are failing and EV is fused (“EKF GPS data quality poor - stopping use”), but nothing else - I would expect something like
Ekf::controlExternalVisionFusion there is
_fuse_hpos_as_odom = false whenever EV is used and GPS is not.
Again, no resets.
Later in that method:
_vel_pos_innov = _state.pos(0) - _ev_sample_delayed.posNED(0);
But if I understand correctly,
_state.pos is still in GPS coordinates, so the innovation is subject to a discontinuity -> huge values ->
pos_test_ratio explodes -> no more pos fusion whatsoever.