mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-21 16:18:29 -04:00
AC_WPNav: fix compile when using AP_TERRAIN_AVAILABLE 0
This commit is contained in:
parent
f085666032
commit
684ac12dd6
@ -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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user