Skip to content

Commit f020dbf

Browse files
committed
Copter: set origin from last origin if none set
1 parent 2d69b32 commit f020dbf

File tree

1 file changed

+6
-1
lines changed

1 file changed

+6
-1
lines changed

ArduCopter/AP_Arming_Copter.cpp

Lines changed: 6 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -568,7 +568,7 @@ bool AP_Arming_Copter::alt_checks(bool display_failure)
568568
// has side-effect that logging is started
569569
bool AP_Arming_Copter::arm_checks(AP_Arming::Method method)
570570
{
571-
const auto &ahrs = AP::ahrs();
571+
auto &ahrs = AP::ahrs();
572572

573573
// always check if inertial nav has started and is ready
574574
if (!ahrs.healthy()) {
@@ -647,6 +647,11 @@ bool AP_Arming_Copter::arm_checks(AP_Arming::Method method)
647647
return false;
648648
}
649649

650+
if (!ahrs.ensure_origin_is_set()) {
651+
check_failed(true, "No origin set");
652+
return false;
653+
}
654+
650655
// superclass method should always be the last thing called; it
651656
// has side-effects which would need to be cleaned up if one of
652657
// our arm checks failed

0 commit comments

Comments
 (0)