def calcPitch(self, accel):
x = accel[0]
y = accel[1]
z = accel[2]
try:
theta = math.atan(-x / math.sqrt(y * y + z * z))
except:
if x > 0:
theta = -1.0
else:
theta = 1.0
return theta