ardupilot/ArduSub/terrain.cpp
Peter Barker ed0b0451cf ArduSub: remove AC_TERRAIN compilation option
Use AP_TERRAIN_AVAILABLE instead
2021-07-12 17:34:44 +10:00

30 lines
591 B
C++

#include "Sub.h"
// update terrain data
void Sub::terrain_update()
{
#if AP_TERRAIN_AVAILABLE
terrain.update();
// tell the rangefinder our height, so it can go into power saving
// mode if available
#if RANGEFINDER_ENABLED == ENABLED
float height;
if (terrain.height_above_terrain(height, true)) {
rangefinder.set_estimated_terrain_height(height);
}
#endif
#endif
}
// log terrain data - should be called at 1hz
void Sub::terrain_logging()
{
#if AP_TERRAIN_AVAILABLE
if (should_log(MASK_LOG_GPS)) {
terrain.log_terrain_data();
}
#endif
}