Skip to content
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

Merged
merged 2 commits into from
Jul 9, 2024

Conversation

Williangalvani
Copy link
Contributor

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

@Williangalvani Williangalvani added this to the Sub-4.5 milestone Jun 28, 2024
@@ -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)) {
Copy link
Contributor

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

Copy link
Contributor

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");
Copy link
Contributor

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.

@tridge tridge merged commit 64e859e into ArduPilot:master Jul 9, 2024
92 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Sub: Yaw drift issue
4 participants