TauLabs/TauLabs — pull request #724 by solidgoldbomb (2013-07-07 21:38:12+00:00)
Title: sim sensors: avoid divide by zero in magOffsetEstimation

magOffsetEstimation() does a divide by zero when computing delta[0] and delta[1] when:
````
(gdb) p attitude
$28 = {q1 = 1, q2 = 0, q3 = 0, q4 = 0, Roll = 0, Pitch = 0, Yaw = 0}
(gdb) p homeLocation
$29 = {Latitude = 0, Longitude = 0, Altitude = 0, Be = {0, 0, 0}, SeaLevelPressure = 1013, Set = 0 '\000', GroundTemperature = 15 '\017'}
(gdb) p magBias
$30 = {x = 0, y = 0, z = 0}
````

This skips the computation of magBias when ````xy_norm == 0```` to avoid the nan in magBias.