Using your script:
Code: Select all
def update():
global yaw
yaw = zeiss.Yaw
global pitch
pitch = zeiss.Pitch
global roll
roll = zeiss.Roll
if starting:
centerYaw = 0
centerPitch = 0
centerRoll = 0
yaw = 0
pitch = 0
roll = 0
zeiss.update += update
#if yaw < 0:
# yaw = yaw + 360
#else:
# yaw = yaw
#if centerYaw < 0:
# centerYaw = centerYaw + 360
#else:
# centerYaw = centerYaw
trackIR.yaw = math.degrees(yaw - centerYaw)
trackIR.pitch = math.degrees(pitch - centerPitch)
trackIR.roll = math.degrees(roll - centerRoll)
diagnostics.watch(yaw)
diagnostics.watch(roll)
diagnostics.watch(pitch)
diagnostics.watch(centerYaw)
diagnostics.watch(centerPitch)
diagnostics.watch(centerRoll)
if (keyboard.getPressed(Key.Y)):
centerYaw = yaw
centerPitch = pitch
centerRoll = roll
starts looking 90deg right value with a value of 1.6
0.0 is straight ahead
< 3.14 is looking right upto 180 behind you
-1.6 is looking left i.e 270 deg
< -3.14 pans left until 180deg behind you
Forgot to add that the axis is reversed too.