Skip to content

Commit

Permalink
AP_Arming: use compass get_offsets_max()
Browse files Browse the repository at this point in the history
  • Loading branch information
tridge authored and OXINARF committed Apr 3, 2017
1 parent ee2afd3 commit fafd940
Showing 1 changed file with 1 addition and 5 deletions.
6 changes: 1 addition & 5 deletions libraries/AP_Arming/AP_Arming.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -17,10 +17,6 @@
#include <AP_Notify/AP_Notify.h>
#include <GCS_MAVLink/GCS.h>

#ifndef AP_ARMING_COMPASS_OFFSETS_MAX
// this can also be overridden for specific boards in the HAL
#define AP_ARMING_COMPASS_OFFSETS_MAX 600
#endif
#define AP_ARMING_COMPASS_MAGFIELD_EXPECTED 530
#define AP_ARMING_COMPASS_MAGFIELD_MIN 185 // 0.35 * 530 milligauss
#define AP_ARMING_COMPASS_MAGFIELD_MAX 875 // 1.65 * 530 milligauss
Expand Down Expand Up @@ -314,7 +310,7 @@ bool AP_Arming::compass_checks(bool report)

// check for unreasonable compass offsets
Vector3f offsets = _compass.get_offsets();
if (offsets.length() > AP_ARMING_COMPASS_OFFSETS_MAX) {
if (offsets.length() > _compass.get_offsets_max()) {
if (report) {
GCS_MAVLINK::send_statustext_all(MAV_SEVERITY_CRITICAL, "PreArm: Compass offsets too high");
}
Expand Down

0 comments on commit fafd940

Please sign in to comment.