pythonunreal-engine4drone.ioaltitudeairsim

AirSim get altitude


I am using Microsoft AirSim with Unreal engine, and connecting with python API. I am using the LandscapeMountains project available through Unreal. I am able to capture the altitude with client.getGpsData().gnss.geo_point.altitude However the altitude does not seem to change if I set the drone on a straight flight path. Shouldn't it be changing with various mountain terrain?

Like when the drone flies over a high mountain shouldn't the altitude be closer to zero than when it passes the mountain. If this isn't the way it should work, how would I get the relative distance between drone and the terrain directly below the drone?

I hope someone reads this that uses AirSim.


Solution

  • GeoPoint will give you z axis position with respect to your player start position. Means your initial spawn position would be considered the origin and all other distances will be measured relatively. So, external objects like mountains etc won't affect the value.

    If you want to get relative vertical position, you can read about altimeter here.