I’m using EKF2 and trying to develop an autonomous indoor vehicle (GPS denied, offboard mode). I’ve noticed that the local position estimates start off at (0,0,Z) when the quadcopter is on the ground as optical flow is not available. The velocities on the other hand are random and huge which if given about 20-30 seconds settle back to < 0.1.
If at any point optical flow quality is good enough, then the estimates are pretty good. But, if once optical flow is used you lose it due to bad quality (Say for example your mission involves taking off - flying around - landing - taking off again) the estimates shoot off towards really large values until it is re obtained. But in the meantime the quad is completely out of control as the velocity and position estimates that the pixhawk bases its control on are wrong.
Is there a way to combat this as at the moment it seems like luck of the draw and hoping that it doesn’t obtain flow while on the ground (which happens sometimes and throws everything off). Is LPE better than EKF2 for this application?