AC_WPNav: fix compile when using AP_TERRAIN_AVAILABLE 0

This commit is contained in:
Tom Pittenger 2016-05-20 12:29:19 -07:00
parent f085666032
commit 684ac12dd6

View File

@ -1154,12 +1154,13 @@ void AC_WPNav::calc_spline_pos_vel(float spline_time, Vector3f& position, Vector
// get terrain's altitude (in cm above the ekf origin) at the current position (+ve means terrain below vehicle is above ekf origin's altitude)
bool AC_WPNav::get_terrain_offset(float& offset_cm)
{
#if AP_TERRAIN_AVAILABLE
float terr_alt = 0.0f;
if (_terrain != NULL && _terrain->height_above_terrain(terr_alt, true)) {
offset_cm = _inav.get_altitude() - (terr_alt * 100.0f);
return true;
}
#endif
return false;
}