SITL: adjust the SITL compass code to have saner z values
This commit is contained in:
parent
63d768143d
commit
bc89b53bdc
@ -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));
|
||||
|
Loading…
Reference in New Issue
Block a user