|
@@ -502,20 +502,11 @@ void dcm2angleTest(float C[9], short att[3])
|
|
|
float yaw, pitch, roll;
|
|
|
|
|
|
pitch = asin(-C[6]);
|
|
|
-
|
|
|
- if(C[6] > 0.999999f || C[6] < -0.999999f)
|
|
|
- {
|
|
|
- //当俯仰角为90度的时候,则假设翻滚角为0度
|
|
|
- yaw = atan2(-C[1], C[4]);
|
|
|
-
|
|
|
- roll = 0.0f;
|
|
|
- }
|
|
|
- else
|
|
|
- {
|
|
|
- yaw = atan2(C[3], C[0]);
|
|
|
+
|
|
|
+ yaw = atan2(C[3], C[0]);
|
|
|
|
|
|
- roll = atan2(C[7], C[8]);
|
|
|
- }
|
|
|
+ roll = atan2(C[7], C[8]);
|
|
|
+
|
|
|
|
|
|
att[0] = (short)(yaw * 10000.f); //yaw
|
|
|
att[1] = (short)(pitch * 10000.f); //pitch
|