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

AP_Compass: magcal keeps soft iron matrix + scale bugfix #27107

Open
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

jschall
Copy link
Contributor

@jschall jschall commented May 20, 2024

This patch changes the large vehicle compass calibration so that it keeps the soft-iron calibration matrix and the scale. This way, the user can perform a full compass calibration on a subsystem of the vehicle, without losing it when a large vehicle cal is performed.

It also fixes a bug: large vehicle compass calibration currently does not respect the scale parameter. It needs to either incorporate it into the math or reset it to 1.

Why was the scale param added when the diagonals already exist? Seems like something that can be removed.

@jschall jschall requested a review from tridge May 20, 2024 21:42
Copy link
Contributor

@tridge tridge left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this would need to be a COMPASS_OPTIONS bit, off by default

@peterbarker
Copy link
Contributor

this would need to be a COMPASS_OPTIONS bit, off by default

Or an option in the mavlink command to retain the diags/off-diags

field -= get_offsets(instance);
uncorrected_field -= get_offsets(instance);

new_offsets = mat_inv*truth_field*1.0f/scale - uncorrected_field;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

scale needs divide by zero check

@magicrub
Copy link
Contributor

I agree with @tridge . Needs to be an options bit, default off.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants