Hi! there was a lot of work put into improving heading performance on the latest ArduSub release (4.5.0-beta3, which should be the new stable tomorrow).
I have a couple of recommendations:
-
Use the latest stable BlueOS
-
Use ArduSub 4.5.0
-
make sure you calibrate your Gyros in BlueOS and that all axis readings are under 10. Bonus points for calibrating after the rov warms up for a couple of minutes, as the gyro has thermal drift.
-
ArduSub 4.5.0 has two new parameters used as a “backup location” for vehicle with no GPS (ORIGIN_LAT, ORIGIN_LON), those are used to get an estimative of the local magnetic field in order to do a 3d magnetic fusion isntead of the regular 2D. I recommend setting those.
-
Make sure the compasses show “Fully calibrated” in the BlueOS compass page
-
Leave COMPASS_AUTODEC enabled
If this doesn’t help, then I agree with @ljlukis that you could disable Auto Declination and used it to correct the offset