Skip to content

Commit 2f6a88b

Browse files
committed
Copter: inertial nav replaced with AHRS
1 parent b50703a commit 2f6a88b

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

ArduCopter/AP_Arming_Copter.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -133,8 +133,10 @@ bool AP_Arming_Copter::barometer_checks(bool display_failure)
133133
// that may differ from the baro height due to baro drift.
134134
const auto &ahrs = AP::ahrs();
135135
const bool using_baro_ref = !ahrs.has_status(AP_AHRS::Status::PRED_HORIZ_POS_REL) && ahrs.has_status(AP_AHRS::Status::PRED_HORIZ_POS_ABS);
136+
float pos_d_m = 0;
137+
UNUSED_RESULT(AP::ahrs().get_relative_position_D_origin_float(pos_d_m));
136138
if (using_baro_ref) {
137-
if (fabsf(copter.inertial_nav.get_position_z_up_cm() - copter.baro_alt) > PREARM_MAX_ALT_DISPARITY_CM) {
139+
if (fabsf(pos_d_m) > PREARM_MAX_ALT_DISPARITY_CM) {
138140
check_failed(Check::BARO, display_failure, "Altitude disparity");
139141
ret = false;
140142
}

0 commit comments

Comments
 (0)