I’m flying in terrain that changes a lot, I fist noticed one day while flying that I had a constant altitude error that the autopilot never closed on. I didn’t think much of it, until today when I got the mavProxy simulator running and was easily able to re-produce the issue, then I started digging into the arduplane code for the pixhawk.
What I think that I am seeing is that there is a concept of an origin, that is set in 3D space when GPS is first acquired. if you then move home 100m in altitude, then this origin does not change, but the reference for the altitude error does. The end result is that the airplane will not longer fly to the commanded altitude and the altitude error reported remains constant at 100m up or down in the same direction that home moved.
The origin is a bit convoluted in the code, but it seems to me, that the origin should be changed to the home location every time that a new home is uploaded. Anyone have any thoughts on this. I’m seasoned in both c++ and autopilot code, but I’m used to having intimate familiarity with the code and this seems a bit difficult to trace through. Anyone have any suggestions?
Thanks
Josh