Jelajahi Sumber

不做极限值的处理, 防止计算航向角有误

liang 2 tahun lalu
induk
melakukan
26b625af8e
1 mengubah file dengan 4 tambahan dan 13 penghapusan
  1. 4 13
      motion/trajAlgorithm/footPDR.c

+ 4 - 13
motion/trajAlgorithm/footPDR.c

@@ -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