Skip to content

Commit 726d213

Browse files
committed
Copter: set origin from last origin if none set
1 parent d38bc5d commit 726d213

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
@@ -566,7 +566,7 @@ bool AP_Arming_Copter::alt_checks(bool display_failure)
566566
// has side-effect that logging is started
567567
bool AP_Arming_Copter::arm_checks(AP_Arming::Method method)
568568
{
569-
const auto &ahrs = AP::ahrs();
569+
auto &ahrs = AP::ahrs();
570570

571571
// always check if inertial nav has started and is ready
572572
if (!ahrs.healthy()) {
@@ -645,6 +645,11 @@ bool AP_Arming_Copter::arm_checks(AP_Arming::Method method)
645645
return false;
646646
}
647647

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

0 commit comments

Comments
 (0)