Copter: update terrain db pre-arm checks

This commit is contained in:
rishabsingh3003 2023-01-09 03:50:25 +05:30 committed by Andrew Tridgell
parent d56f476789
commit 6d117528e4
1 changed files with 6 additions and 0 deletions

View File

@ -162,6 +162,12 @@ bool AP_Arming_Copter::board_voltage_checks(bool display_failure)
// all data loaded // all data loaded
bool AP_Arming_Copter::terrain_database_required() const bool AP_Arming_Copter::terrain_database_required() const
{ {
if (copter.wp_nav->get_terrain_source() == AC_WPNav::TerrainSource::TERRAIN_FROM_RANGEFINDER) {
// primary terrain source is from rangefinder, allow arming without terrain database
return false;
}
if (copter.wp_nav->get_terrain_source() == AC_WPNav::TerrainSource::TERRAIN_FROM_TERRAINDATABASE && if (copter.wp_nav->get_terrain_source() == AC_WPNav::TerrainSource::TERRAIN_FROM_TERRAINDATABASE &&
copter.mode_rtl.get_alt_type() == ModeRTL::RTLAltType::RTL_ALTTYPE_TERRAIN) { copter.mode_rtl.get_alt_type() == ModeRTL::RTLAltType::RTL_ALTTYPE_TERRAIN) {
return true; return true;