Skip to content

Commit

Permalink
AP_Arming: Allow arming when forcing DCM and no GPS configured
Browse files Browse the repository at this point in the history
* If we force AP to use DCM, and disable all GPS's, we never expect a
  home location
* Allow users to arm DCM with all pre-arm checks enabled in this special
  case
* This allows using AP as a simple stabilizer (FBWA) on plane
* If a user uses EK3 and does not have any GPS's configured (ie, no
  GPS), they can now arm

Signed-off-by: Ryan Friedman <25047695+Ryanf55@users.noreply.github.com>
  • Loading branch information
Ryanf55 committed Jan 5, 2025
1 parent 8875479 commit 3a6ecb3
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion libraries/AP_Arming/AP_Arming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -636,7 +636,13 @@ bool AP_Arming::gps_checks(bool report)
}
}

if (!AP::ahrs().home_is_set()) {
// Only check we have an AHRS home when we have at least 1 GPS enabled.
// This allows arming in DCM without GPS if the user doesn't have a GPS installed.
bool expects_home_location = gps.num_sensors() > 0;
#if AP_AHRS_DCM_ENABLED
expects_home_location = (AP_AHRS::EKFType)AP::ahrs().get_ekf_type() != AP_AHRS::EKFType::DCM;
#endif
if (expects_home_location && !AP::ahrs().home_is_set()) {
check_failed(ARMING_CHECK_GPS, report, "AHRS: waiting for home");
return false;
}
Expand Down

0 comments on commit 3a6ecb3

Please sign in to comment.