I would like some testers for a new ArduPilot feature - in-flight compass learning.
This is a feature that was originally developed for the SkyViper quadcopter, but can work with a wide range of vehicles (planes, copters, helicopters, rovers, boats etc). It avoids the need to do a compass calibration dance, which is particularly useful for large vehicles.
The pull request is here:
I am also happy to provide pre-built binaries if you let me know in the comments below what flight controller you are using and what firmware type you want.
Some notes on how to use it:
- you must have GPS lock for learning to work
- to use it set COMPASS_LEARN to 3, and then reboot (to ensure EKF is reset)
- then arm in a mode that doesn’t need GPS and fly or drive for a couple of minutes, making sure you yaw a lot to cover all compass directions. Roll and pitch is fine too, but is not required
- for copters and helis, I suggest flying in ALT_HOLD mode
- for planes I suggest flying in FBWA mode
- for rovers and boats I suggest driving in MANUAL mode
When learning is complete you will see a message “CompassLearn: finished” on your GCS. It will automatically save your new offsets and you should be ready to use GPS modes.
Some other notes:
- that this way of calibrating does not automatically learn the compass orientation, so please ensure your compass orientation is set correctly before starting.
- learning will only start when armed. If you don’t want to actually fly then you can arm at zero throttle and just walk around with the vehicle, turning a lot, but that will lose the advantage of learning compass offsets with the motors running
- it only learns offsets, not diagonals or off-diagonals for elliptical corrections, so it is not suitable for vehicles where the field may be badly enough distorted that it can’t be represented reasonably as a sphere
- feel free to set your compass offsets to crazy values before starting the test. The initial values don’t matter
Please provide feedback in the form of dataflash logs in the comments below.
Thanks for testing!
Update:
I have put pre-built binaries here http://uav.tridgell.net/MagLearn/test1/
So far just CubeBlack for copter, heli, rover and plane. The binaries are against master. I have not back-ported this feature to older firmwares versions.