My problem is in the case that GPS is invalid for a while during the flight.
If there is no GPS, the drone would fly based on optical flow or vision sensor to estimate local position.
Then the estimation would have a drift as the time goes longer.
It is like the accumulated drift problem in SLAM without loop closure.
Then, if the GPS goes back to live again, the _gpsLatOrigin, _gpsLonOrigin or _gpsAltOrigin would not be reset.
This may lead to a position gap between the current position estimation based on previous optical flow or other sensors and GPS position valid again.
In such case, if the drone is desired to hover or move, the position estimation would have a bad behavior due to such gap.
In the loop closure problem in SLAM, the position would have a sudden change once the loop is detected and all the previous positions would be adjusted based on some optimization algorithm. But it is obviously not a good way to do in LPE.
So I wonder if this is a problem in current system? or it would never happen?