-
Notifications
You must be signed in to change notification settings - Fork 17.7k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Allow full compass calibration with location sources other than GPS #27409
Allow full compass calibration with location sources other than GPS #27409
Conversation
@@ -1065,14 +1065,15 @@ bool CompassCalibrator::calculate_orientation(void) | |||
*/ | |||
bool CompassCalibrator::fix_radius(void) | |||
{ | |||
if (AP::gps().status() < AP_GPS::GPS_OK_FIX_2D) { | |||
Location loc; | |||
if (!AP::ahrs().get_location(loc)) { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
i think we need to accept either AHRS location or GPS location, so lack of healthy compass doesn't prevent compass calibration to fix the issue
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
could also do AP::ahrs().get_origin()
if (AP::gps().status() < AP_GPS::GPS_OK_FIX_2D) { | ||
Location loc; | ||
if (!AP::ahrs().get_location(loc)) { | ||
gcs().send_text(MAV_SEVERITY_WARNING, "MagCal: No location, fix_radius skipped"); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We should probably use GCS_SEND_TEXT and I think we should check the prefix is consistent with other text messages from this library.
f5ec99a
to
8ece859
Compare
Not having a GPS connected currently causes compass calibration to skip the fix_radius step, which prevents using the WMM in the ekf.
I also added a warning so users can know something is wrong.
this is a step towards fix #18229, and is extracted from #26506