回答編集履歴
1
修正
test
CHANGED
@@ -278,9 +278,9 @@
|
|
278
278
|
|
279
279
|
#print ('{0:4.3f}, {0:4.3f}, {0:4.3f}, {0:4.3f}, {0:4.3f}, {0:4.3f},' .format(gx, gy, gz, ax, ay, az))
|
280
280
|
|
281
|
-
Roll = math.atan2(ay
|
281
|
+
Roll = math.atan2(ay,az) * 57.324 #57.324 = 360/2π であり、rad から ° に変換
|
282
|
-
|
282
|
+
|
283
|
-
Pitch = math.atan2(-ax
|
283
|
+
Pitch = math.atan2(-ax , math.sqrt( ay* ay+ az*az ) ) * 57.324
|
284
284
|
|
285
285
|
|
286
286
|
|