autotest: fixed the calculation of the acceleration due to gravity

this fixes the attitude calculation for the multicopter simulation
This commit is contained in:
Andrew Tridgell 2012-02-18 17:41:46 +11:00
parent b6fdf626e4
commit 5652ccd3c6

View File

@ -70,7 +70,7 @@ class Aircraft(object):
from math import sin, cos, sqrt, radians
# work out what the accelerometer would see
xAccel = sin(radians(self.pitch)) * cos(radians(self.roll))
xAccel = sin(radians(self.pitch))
yAccel = -sin(radians(self.roll)) * cos(radians(self.pitch))
zAccel = -cos(radians(self.roll)) * cos(radians(self.pitch))
scale = 9.81 / sqrt((xAccel*xAccel)+(yAccel*yAccel)+(zAccel*zAccel))