EKF2 Reset to Zero When external vision source dropped

Hello,

I’m setting up the PX4 for an indoor navigation application. The setup is using one UWB indoor localization solution to provide position estimate using the mavros/vision_pose topic. The UWB localization solution was computed on an onboard computer running ROS1 noetic and relayed to /mavros/vision_pose/pose topic. On the PX4 I’ve configured the EKF2 setting to enable only the horizontal position fusion (since UWB does not have velocity estimate, heading and z estimate is relatively inaccurate, the detailed parameters can be found in flight logs attached below).

PX4 Firmware version: 1.14

The vehicle was able to localize and operate in both manual and offboard flight without issue. However, there are couple of time I observed when the external vision source cutoff (either due to the hardware cable bad connection or onboard UWB estimation crashed) the EKF2 local estimate will jump to zero right away. And because we were either using the RC or offboard sending position setpoint, this local estimate jump will create very large velocity command and results in unexpected and dangerous behavior.

The plot below (using plotJuggler) shows exact incident as I described. The magenta curve on the first plot is the position setpoint created by the RC and since I was not touching it, it maintained constant value at current location. The red curve is the external position source that dropped out at the end. The blue which is EKF2 estimate jumped to zero not long after external source dropped while the RC created setpoint was still at original value. This sudden change in position difference create large velocity command as show in the second plot.

So my question is, is there any parameter settings I’m not aware of that can keep the EKF2 dead reckoning instead of drop to zero in the air to prevent this happening? Or this is expected behavior? (which I think is dangerous to have position jump while the drone is in air).

Links to flight logs: https://review.px4.io/plot_app?log=ef74cc8a-23a7-4c3b-be6a-e9e18499fc91

Any suggestion or help would be much appreciated!

Chenhao