Heading calculation - Gyroscope + Magnetometer - Sensor Fusion

Hi,
is there a simple way to get the heading (in degrees 0-360) using a sensor fusion that involves magnetometer + gyroscope? The magnetometer isn't enough since I have a lot of magnetic noise due to the proximity of brushless motors.
I can't find solutions on this form. Thanks

If you have a lot of magnetic noise, the magnetometer is not very useful, and you can’t calculate the heading.

Do you want a gyro to stabelize the noisy magnetometer ? It should be possible to combine that in a filter, but I don’t know how that should be done. I don’t know if that exists in a library somewhere.

I know that it's possible because every quadcopter has a magnetometer . thanks anyway

Keep the wires and motors away from the magnetometer. And use the average of a few samples.

The current through a wires causes less magnetic field, when the wire with reverse current is next to it. Therefor it is best to have a cable that consist of two wires to power the motors.

This is the Kalman Guide : http://forum.arduino.cc/index.php?topic=58048.0
I think the magnetometer values are part of the Kalman filter : Example-Sketch-for-IMU-including-Kalman-filter/MPU6050_HMC5883L.ino at master · TKJElectronics/Example-Sketch-for-IMU-including-Kalman-filter · GitHub
But I understand it very well. Sorry, I have not used a magnetometer combined with gyro + accel yet.

Thanks, but that's not I'm looking for. I'm already able to calculate pitch and roll form gyro+acc. I need magnetic nord with magnetometer+gyro, that's different!
My magnetometer is already 20 cm above the motors but the problem remains

What kind of magnetometer are you using? Analog or digital output?
Twist the two wires that go to each motor, this wuold reduce the magnetic noise.

Does it work ok without the motors running? If not, maybe you need to calibrate the magnetometer while it is installed on the UAV. I had the same problem with a 10DOF IMU until I calibrated the magnetometer.