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

Open
wants to merge 3 commits into
base: master
from

Conversation

@tridge
Copy link
Contributor

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

@tridge tridge added the DevCallTopic label Nov 25, 2019
@@ -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:

This comment has been minimized.

Copy link
@rmackay9

rmackay9 Dec 2, 2019

Contributor

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

@rmackay9

This comment has been minimized.

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
.

@CraigElder CraigElder removed the DevCallTopic label Dec 3, 2019
@tridge tridge force-pushed the tridge:pr-mag-cal-yaw branch from f74928c to 94bb199 Dec 9, 2019
tridge added 3 commits Nov 21, 2019
this is a fast compass calibration that uses a yaw value provided by
the user.
@tridge tridge force-pushed the tridge:pr-mag-cal-yaw branch from 94bb199 to aeca392 Dec 9, 2019
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
4 participants
You can’t perform that action at this time.