While I test GPS glitch, I notice that a drone goes back to a wrong position caused by the GPS glitch.
I am not sure whether this issue is a known problem. Anyway, just in case, I would like to share this issue.
Here, expected behavior is that the drone keeps staying in the home position after cleaning the GPS glitch (i.e., after step 6 and 7). However, the drone goes back to the wrong position after the step 7.
If I’m understanding correctly then this is the expected behaviour. When the EKF resets its position we also reset Loiter’s target position. This is because from a pilot’s point of view, they don’t really care exactly where they are, they care much more that the vehicle physically stays in place.
If we did not reset the loiter position then the vehicle might suddenly move after a GPS glitch and this could be dangerous.
I think if you type in “map set showsimpos 1” then you’ll see that physically the vehicle doesn’t move at all.
It’s possible that I’m misunderstanding what you’ve seen but when I tested the steps you’ve listed above the vehicle didn’t physically move.
If you don’t mind, could you please review this log file?
Even though I turn on “map set showsimpos 1”, I can still see that the drone physically moves X and Y positions after the resolving the GPS glitch (i.e., param set SIM_GPS_GLITCH_X 0 and param set SIM_GPS_GLITCH_Y 0).
Further, I am wondering why these steps in the below do not make the drone move into the changed Loiter’s target position.
arm and takeoff in Loiter mode
param set SIM_GPS_GLITCH_Y 0.001
param set SIM_GPS_GLITCH_Y 0.000
Thank you!
Edit: It seems that changing altitude through QGroundControl is a root cause of this issue.
This is because the flight mode is changed to GUIDED and increase the drone’s altitude.
So you’re seeing the difference in behaviour on between Guided mode and Loiter. If you leave the vehicle in Loiter mode I think you’ll see it doesn’t move. Guided is different however because, like Auto, it tries to maintain a specific lat,lon,alt position.