1234567891011121314151617181920212223242526272829303132333435363738 |
- #include "Sub.h"
- void Sub::terrain_update()
- {
- #if AP_TERRAIN_AVAILABLE && AC_TERRAIN
- terrain.update();
-
-
- #if RANGEFINDER_ENABLED == ENABLED
- float height;
- if (terrain.height_above_terrain(height, true)) {
- rangefinder.set_estimated_terrain_height(height);
- }
- #endif
- #endif
- }
- void Sub::terrain_logging()
- {
- #if AP_TERRAIN_AVAILABLE && AC_TERRAIN
- if (should_log(MASK_LOG_GPS)) {
- terrain.log_terrain_data();
- }
- #endif
- }
- bool Sub::terrain_use()
- {
- #if AP_TERRAIN_AVAILABLE && AC_TERRAIN
- return (g.terrain_follow > 0);
- #else
- return false;
- #endif
- }
|