#include "Sub.h"12// update terrain data3void Sub::terrain_update()4{5#if AP_TERRAIN_AVAILABLE6terrain.update();78// tell the rangefinder our height, so it can go into power saving9// mode if available10#if AP_RANGEFINDER_ENABLED11float height;12if (terrain.height_above_terrain(height, true)) {13rangefinder.set_estimated_terrain_height(height);14}15#endif16#endif17}1819#if HAL_LOGGING_ENABLED20// log terrain data - should be called at 1hz21void Sub::terrain_logging()22{23#if AP_TERRAIN_AVAILABLE24if (should_log(MASK_LOG_GPS)) {25terrain.log_terrain_data();26}27#endif28}29#endif // HAL_LOGGING_ENABLED30313233