Magnetometer Easy Calibration

This is a great idea. Frankly, I thought it could be supported by GPS. But then I researched Virtual Anchors and thought it wouldn't be possible because GPS can't get direction when stationary (very small movements). So, how can a code structure be created as you mentioned?

I have this video, you also gave me the codes. I remember we talked about this in a different topic a while ago. But I still don't know how I can manage this project without slope compensation. So what kind of control mechanism should I set up so that the direction is not affected by the waves?