Hi @Mahmut37, welcome to the forum
Which autopilot firmware are you using? If you’re using ArduSub, updating to the latest beta firmware is expected to fix the yaw drift issues, assuming the sensors have been appropriately calibrated.
Note that both the compass and gyroscope affect the yaw estimate, and an incorrect gyroscope offset is often the cause of drifting yaw. If you’ve only calibrated the compass, try also calibrating the gyroscope (when the vehicle is resting on a stable surface).
The latest BlueOS beta has some advanced calibration options in the Vehicle Setup page, although BlueOS is not yet fully supported on Raspberry Pi 5.
Note that