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

Added support for fixed yaw mag calibration #12863

Merged
merged 3 commits into from Dec 18, 2019

Conversation

tridge
Copy link
Contributor

@tridge tridge commented Nov 21, 2019

This is a fast compass calibration given vehicle position and yaw. The calibrations results in zero diagonal and off-diagonal elements, so is only suitable for vehicles where the field is close to spherical. It is useful for large vehicles where moving the vehicle to calibrate it is difficult.

The offsets of the selected compasses are set to values to bring them into consistency with the WMM tables at the given latitude and longitude. If compass_mask is zero then all enabled compasses are calibrated.

This assumes that the compass is correctly scaled in milliGauss

MAVProxy implements this using the "magcal yaw" command.

This PR depends on this:
ArduPilot/mavlink#113

@@ -3725,6 +3738,10 @@ MAV_RESULT GCS_MAVLINK::handle_command_long_packet(const mavlink_command_long_t

return MAV_RESULT_UNSUPPORTED;

case MAV_CMD_FIXED_MAG_CAL_YAW:
Copy link
Contributor

Choose a reason for hiding this comment

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

I guess this command could also arrive as part of a COMMAND_INT?

@rmackay9
Copy link
Contributor

rmackay9 commented Dec 2, 2019

I tested this out on my copter after adding a small change to allow triggering it from channel 6. The results look ok although some of the z-axis offsets are significantly different.
fixed-yaw-before-after
.

@tridge tridge force-pushed the pr-mag-cal-yaw branch 2 times, most recently from 94bb199 to aeca392 Compare December 9, 2019 21:15
@tridge tridge merged commit 6902cd2 into ArduPilot:master Dec 18, 2019
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.

None yet

4 participants