From 147c5ad78dc2ecdc4018a1f7dacf0eb5b40d397b Mon Sep 17 00:00:00 2001 From: Peter Barker Date: Mon, 8 Jan 2024 13:07:46 +1100 Subject: [PATCH] AP_HAL: move simulated height_agl into fdm structure allows value to be shipped via multicast to simulated peripherals --- libraries/AP_HAL/SIMState.cpp | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/libraries/AP_HAL/SIMState.cpp b/libraries/AP_HAL/SIMState.cpp index b7c562f3b4..47cd3d4e79 100644 --- a/libraries/AP_HAL/SIMState.cpp +++ b/libraries/AP_HAL/SIMState.cpp @@ -384,7 +384,7 @@ void SIMState::set_height_agl(void) AP_Terrain *_terrain = AP_Terrain::get_singleton(); if (_terrain != nullptr && _terrain->height_amsl(location, terrain_height_amsl)) { - _sitl->height_agl = _sitl->state.altitude - terrain_height_amsl; + _sitl->state.height_agl = _sitl->state.altitude - terrain_height_amsl; return; } } @@ -392,7 +392,7 @@ void SIMState::set_height_agl(void) if (_sitl != nullptr) { // fall back to flat earth model - _sitl->height_agl = _sitl->state.altitude - home_alt; + _sitl->state.height_agl = _sitl->state.altitude - home_alt; } }