mirror of
https://github.com/ArduPilot/ardupilot.git
synced 2026-10-06 19:00:27 +08:00
autotest: add frame-aware Location class
mavutil.location has no altitude frame field; its alt is AMSL only by convention and the suite routinely stuffs relative-to-home and terrain altitudes into it, leading to silent frame-mixing bugs. Add a Location class mirroring AP_Common's Location: meters altitude tagged with an AltFrame (ABSOLUTE/ABOVE_HOME/ABOVE_ORIGIN/ ABOVE_TERRAIN). It deliberately has no alt attribute. Altitude is only reachable via get_alt_m(frame), and asking in the wrong frame is an error, not a conversion: code that assumes a frame fails loudly instead of silently misreading the altitude. Converting is its own explicit step, TestSuite.change_alt_frame(), which polls home, origin or terrain data from the vehicle as required.
This commit is contained in: