Yesterday I had a GPS glitch that I cannot explain.
The drone took off on an auto mission and when it got to 10m it started drifting. at some point, I saw a “GPS glitch” on MissionPlanner and landed the drone.
After that, I examine the flight logs to understand what caused this glitch and to my surprise, I saw that the data coming from the GPS was accurate. I made a plot of the location sources (AHR2, GPS) compared to the drone’s location estimate (POS). You can see that the POS plot has some “jumps” indicating there was a glitch in the location estimation.
I accept that fact but according to the flight logs, the glitch wasn’t on the GPS reading. When comparing the trajectory from the logs, the POS trajectory has several glitches and the GPS trajectory is smooth. another thing is that the sat count is fine throughout the whole flight. GPA also looks ok. any ideas where those glitches coming from?
Your compass is all over the place, heavily influenced by the throttle. No surprise that the EKF calculates a completely different trajectory from compass and acceleration then comparing that to the GPS confuses it.
Fix your compass location.