|
|
|
@ -132,6 +132,20 @@ int32_t Plane::relative_altitude_abs_cm(void)
@@ -132,6 +132,20 @@ int32_t Plane::relative_altitude_abs_cm(void)
|
|
|
|
|
return labs(current_loc.alt - home.alt); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
return relative altitude in meters (relative to terrain, if available, |
|
|
|
|
or home otherwise) |
|
|
|
|
*/ |
|
|
|
|
float Plane::relative_ground_altitude(void) |
|
|
|
|
{ |
|
|
|
|
#if AP_TERRAIN_AVAILABLE |
|
|
|
|
float altitude; |
|
|
|
|
if (terrain.status() == AP_Terrain::TerrainStatusOK && terrain.height_above_terrain(altitude, true)) { |
|
|
|
|
return altitude; |
|
|
|
|
} |
|
|
|
|
#endif |
|
|
|
|
return relative_altitude(); |
|
|
|
|
} |
|
|
|
|
|
|
|
|
|
/*
|
|
|
|
|
set the target altitude to the current altitude. This is used when
|
|
|
|
|