mirror of
https://github.com/ArduPilot/ardupilot
synced 2025-01-11 02:18:29 -04:00
AP_Arming: setup for terrain adjustment on arming
This commit is contained in:
parent
78f83d5411
commit
59409fd6b7
@ -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");
|
||||
}
|
||||
|
||||
#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;
|
||||
}
|
||||
|
||||
|
Loading…
Reference in New Issue
Block a user