SITL: adjust the SITL compass code to have saner z values

This commit is contained in:
Andrew Tridgell 2012-02-15 22:34:16 +11:00
parent 62326c0f72
commit a48a118128
1 changed files with 1 additions and 1 deletions

View File

@ -48,7 +48,7 @@ static Vector3f heading_to_mag(float heading, float roll, float pitch, float yaw
cos_pitch = 1.0e-10;
}
v.z = -0.4;
v.z = -0.6*cos(roll)*cos(pitch);
v.y = (headY + v.z*sin_roll) / cos_roll;
v.x = (headX - (v.y*sin_roll*sin_pitch + v.z*cos_roll*sin_pitch)) / cos_pitch;
scale = magnitude / sqrt((v.x*v.x) + (v.y*v.y) + (v.z*v.z));