mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-02-03 14:38:44 -04:00
SITL: change for AP::terrain as a pointer
This commit is contained in:
parent
483ed19662
commit
7b9826cdce
@ -63,7 +63,7 @@ Aircraft::Aircraft(const char *frame_str) :
|
||||
sitl->ahrs_rotation_inv = sitl->ahrs_rotation.transposed();
|
||||
}
|
||||
|
||||
terrain = &AP::terrain();
|
||||
terrain = AP::terrain();
|
||||
|
||||
// init rangefinder array to -1 to signify no data
|
||||
for (uint8_t i = 0; i < RANGEFINDER_MAX_INSTANCES; i++){
|
||||
|
@ -178,9 +178,9 @@ void ShipSim::send_report(void)
|
||||
bool have_alt = false;
|
||||
|
||||
#if AP_TERRAIN_AVAILABLE
|
||||
auto &terrain = AP::terrain();
|
||||
auto terrain = AP::terrain();
|
||||
float height;
|
||||
if (terrain.enabled() && terrain.height_amsl(loc, height, true)) {
|
||||
if (terrain != nullptr && terrain->enabled() && terrain->height_amsl(loc, height, true)) {
|
||||
alt = height * 1000;
|
||||
have_alt = true;
|
||||
}
|
||||
|
Loading…
Reference in New Issue
Block a user