AP_Arming: setup for terrain adjustment on arming

This commit is contained in:
Andrew Tridgell 2022-03-28 08:27:19 +11:00 committed by Randy Mackay
parent 78f83d5411
commit 59409fd6b7

View File

@ -1368,6 +1368,17 @@ bool AP_Arming::arm(AP_Arming::Method method, const bool do_arming_checks)
gcs().send_text(MAV_SEVERITY_WARNING, "Warning: Arming Checks Disabled"); gcs().send_text(MAV_SEVERITY_WARNING, "Warning: Arming Checks Disabled");
} }
#if AP_TERRAIN_AVAILABLE
if (armed) {
// tell terrain we have just armed, so it can setup
// a reference location for terrain adjustment
auto *terrain = AP::terrain();
if (terrain != nullptr) {
terrain->set_reference_location();
}
}
#endif
return armed; return armed;
} }