wiistate.py
Go to the documentation of this file.
1 # ###############################################################################
2 #
3 # File: wiistate.py
4 # RCS: $Header: $
5 # Description: Object representation of Wiimote's state
6 # Author: Andreas Paepcke
7 # Created: Thu Aug 13 11:01:34 2009 (Andreas Paepcke) paepcke@anw.willowgarage.com
8 # Modified: Thu Jan 13 13:50:15 2011 (Andreas Paepcke) paepcke@bhb.willowgarage.com
9 # Language: Python
10 # Package: N/A
11 # Status: Experimental (Do Not Distribute)
12 #
13 # ###############################################################################
14 #
15 # Revisions:
16 #
17 # Thu Mar 18 10:56:09 2010 (David Lu) davidlu@wustl.edu
18 # Added nunchuk state variables
19 # Fri Oct 29 08:58:21 2010 (Miguel Angel Julian Aguilar, QBO Project) miguel.angel@thecorpora.com
20 # Added classic controller state variables
21 # Mon Nov 08 11:43:23 2010 (David Lu) davidlu@wustl.edu
22 # Added calibration for nunchuk
23 # ###############################################################################
24 
25 from __future__ import absolute_import
26 from .wiimoteConstants import *
27 from .wiiutils import *
28 import numpy as np
29 
30 
31 class WIIState(object):
32  """
33  Holds the state of a WIIRemote-plus.
34 
35  The state is passed in and is as communicated
36  by one message from the WII+ device. We unpack
37  the information and place it into individual
38  dictionaries for callers to grab.
39 
40  Public instance variables:
41  o time Time in fractional seconds since beginning of Epoch of when
42  state was measured (Float).
43  o ascTime Time when state was measured (Human-readable)
44  o rumble True/False if wiimote vibration is on/off
45  o angleRate A GyroReading instance containing gyro (a.k.a. angular rate) measurement
46  o acc A WIIReading instance containing accelerometer measurement corrected by
47  the calibration information that is stored in the Wiimote
48  o accRaw A WIIReading instance containing accelerometer measurement uncorrected
49  o buttons A dictionary for which buttons are being held down. That could be
50  multiple buttons. Keys are:
51  BTN_1, BTN_2, BTN_PLUS, BTN_MINUS, BTN_A, BTN_B,
52  BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT, BTN_HOME
53  Values are 1/0
54  o IRSources Dictionary with on/off values for which IR lights are
55  being sensed. Keys are:
56  IR1, IR2, IR3, IR4
57  Values are 1/0
58  o motionPlusPresent True if a gyro Motion+ is plugged into the Wiimote. Else False
59 
60  o nunchukPresent True if nunchuk is plugged in. Else False
61  o nunchukAccRaw A WIIReading instance with acceleromoter measurement from the nunchuk (raw values)
62  o nunchukAcc The same, but zeroed using factory calibration
63  o nunchukStickRaw A tuple with the two axes of the joystick on the nunchuk, raw readings
64  o nunchukStick A tuple with the two axes of the joystick on the nunchuk, zeroed to be [-1, 1]
65  o nunchukButtons A dictionary for which nunchuk buttons are down. Keys are BTN_C and BTN_Z
66 
67  Public methods:
68  o setAccelerometerCalibration Bias setting for accelerometer. This triplet is used to
69  turn raw accelerometer values into calibrated values.
70  o setGyroCalibration Bias setting for gyro. This triplet is used to
71  turn raw gyro values into calibrated values.
72  """
73 
74  _accCalibrationZero = None
75  _gyroZeroReading = None
76  _nunchukZeroReading = None
77  _nunchukJoystickZero = None
78 
79  def __init__(self, state, theTime, theRumble, buttonStatus):
80  """Unpack the given state, normalizing if normalizers are passed in."""
81  self.time = theTime
82  self.ascTime = repr(theTime)
83  self.rumble = theRumble
84  self.IRSources = [None, None, None, None]
85  self.battery = None
86  self.acc = None
87  self.accRaw = None
88  self.angleRate = None
89  self.angleRate = None
90  self.angleRageRaw = None
91  self.motionPlusPresent = False
92  self.buttons = {BTN_1: False, BTN_2: False, BTN_PLUS: False,
93  BTN_MINUS: False, BTN_A: False, BTN_B: False,
94  BTN_UP: False, BTN_DOWN: False, BTN_LEFT: False,
95  BTN_RIGHT: False, BTN_HOME: False}
96  self.nunchukPresent = False
97  self.nunchukAccRaw = None
98  self.nunchukAcc = None
99  self.nunchukStick = None
100  self.nunchukStickRaw = None
101  self.nunchukButtons = {BTN_C: False, BTN_Z: False}
102 
103  self.classicPresent = False
104  self.classicStickLeft = None
105  self.classicStickRight = None
106  self.classicButtons = {CLASSIC_BTN_A: False, CLASSIC_BTN_B: False,
107  CLASSIC_BTN_L: False, CLASSIC_BTN_R: False,
108  CLASSIC_BTN_X: False, CLASSIC_BTN_Y: False,
109  CLASSIC_BTN_ZL: False, CLASSIC_BTN_ZR: False,
110  CLASSIC_BTN_PLUS: False, CLASSIC_BTN_MINUS: False,
111  CLASSIC_BTN_UP: False, CLASSIC_BTN_DOWN: False,
112  CLASSIC_BTN_LEFT: False, CLASSIC_BTN_RIGHT: False,
113  CLASSIC_BTN_HOME: False}
114 
115  # Handle buttons on the WII
116  # A zero means no button is down.
117 
118  if buttonStatus == 0:
119  for key in self.buttons.keys():
120  self.buttons[key] = False
121  continue
122 
123  self.buttons[BTN_1] = (buttonStatus & BTN_1) > 0
124  self.buttons[BTN_2] = (buttonStatus & BTN_2) > 0
125  self.buttons[BTN_PLUS] = (buttonStatus & BTN_PLUS) > 0
126  self.buttons[BTN_MINUS] = (buttonStatus & BTN_MINUS) > 0
127  self.buttons[BTN_A] = (buttonStatus & BTN_A) > 0
128  self.buttons[BTN_B] = (buttonStatus & BTN_B) > 0
129  self.buttons[BTN_UP] = (buttonStatus & BTN_UP) > 0
130  self.buttons[BTN_DOWN] = (buttonStatus & BTN_DOWN) > 0
131  self.buttons[BTN_LEFT] = (buttonStatus & BTN_LEFT) > 0
132  self.buttons[BTN_RIGHT] = (buttonStatus & BTN_RIGHT) > 0
133  self.buttons[BTN_HOME] = (buttonStatus & BTN_HOME) > 0
134 
135  for msgComp in state:
136  # msgComp has: (1,2) for Status:Button one pushed, or
137  # (3, [None,None,None,None]) for LEDs
138  # (7, {'angle_rage': (123,456,789)})
139  msgType = msgComp[0]
140 
141  if msgType == WII_MSG_TYPE_ACC:
142  # Second list member is accelerator triplet of numbers:
143  accStatus = msgComp[1]
144  self.accRaw = WIIReading(accStatus, self.time)
145 
146  # If this class knows about accelerometer calibration
147  # data, correct the raw reading:
148  if self._accCalibrationZero is not None and \
149  self._accCalibrationOne is not None and \
150  np.linalg.norm(self._accCalibrationOne - self._accCalibrationZero) > 1E-5:
151  self.acc = WIIReading((self.accRaw - self._accCalibrationZero) /
152  (self._accCalibrationOne - self._accCalibrationZero), self.time)
153  else:
154  self.acc = WIIReading(self.accRaw, self.time)
155 
156  continue
157 
158  elif msgType == WII_MSG_TYPE_IR:
159  # Second list member is a list of 4 dictionaries,
160  # one for each of the Wii IR sources:
161 
162  IRStatus = msgComp[1]
163  # IRStatus is an array of four Dicts. Ex: [{'pos': (317, 445)}, None, None, None]
164  self.IRSources[0] = IRStatus[0]
165  self.IRSources[1] = IRStatus[1]
166  self.IRSources[2] = IRStatus[2]
167  self.IRSources[3] = IRStatus[3]
168 
169  continue
170 
171  elif msgType == WII_MSG_TYPE_MOTIONPLUS:
172  # Second list member is a dictionary with the single
173  # key 'angle_rate', which yields as its value a gyro
174  # readings triplet of numbers:
175 
176  gyroDict = msgComp[1]
177 
178  if gyroDict is not None:
179  # If this class knows about a zero-movement reading for the
180  # gyro, subtract that reading from the raw measurement:
181 
182  self.angleRateRaw = GyroReading(gyroDict['angle_rate'], self.time)
183  if self._gyroZeroReading is not None:
184  self.angleRate = GyroReading(self.angleRateRaw - self._gyroZeroReading, self.time)
185  else:
186  self.angleRate = self.angleRateRaw
187 
188  self.motionPlusPresent = True
189 
190  continue
191  elif msgType == WII_MSG_TYPE_NUNCHUK:
192  nunChuk = msgComp[1]
193  if nunChuk is not None:
194  self.nunchukPresent = True
195  self.nunchukAccRaw = WIIReading(nunChuk['acc'], self.time)
196 
197  # If this class knows about accelerometer calibration
198  # data, correct the raw reading:
199  if self._nunchukZeroReading is not None:
201  (self._nunchukOneReading - self._nunchukZeroReading), self.time)
202  else:
203  self.nunchukAcc = WIIReading(self.nunchukAccRaw, self.time)
204 
205  self.nunchukStickRaw = nunChuk['stick']
206 
207  # scale the joystick to roughly [-1, 1]
208  if (self._nunchukJoystickZero is None):
209  calibration = [127, 127]
210  else:
211  calibration = self._nunchukJoystickZero
212 
213  [joyx, joyy] = self.nunchukStickRaw
214  joyx = -(joyx-calibration[0])/100.
215  joyy = (joyy-calibration[1])/100.
216  # create a deadzone in the middle
217  if abs(joyx) < .05:
218  joyx = 0
219  if abs(joyy) < .05:
220  joyy = 0
221  self.nunchukStick = [joyx, joyy]
222 
223  nunButtons = nunChuk['buttons']
224  self.nunchukButtons[BTN_C] = (nunButtons & BTN_C) > 0
225  self.nunchukButtons[BTN_Z] = (nunButtons & BTN_Z) > 0
226  continue
227  elif msgType == WII_MSG_TYPE_CLASSIC:
228  clasSic = msgComp[1]
229  if clasSic is not None:
230  self.classicPresent = True
231  self.classicStickLeft = clasSic['l_stick']
232  self.classicStickRight = clasSic['r_stick']
233  clasButtons = clasSic['buttons']
234  self.classicButtons[CLASSIC_BTN_A] = (clasButtons & CLASSIC_BTN_A) > 0
235  self.classicButtons[CLASSIC_BTN_B] = (clasButtons & CLASSIC_BTN_B) > 0
236  self.classicButtons[CLASSIC_BTN_DOWN] = (clasButtons & CLASSIC_BTN_DOWN) > 0
237  self.classicButtons[CLASSIC_BTN_HOME] = (clasButtons & CLASSIC_BTN_HOME) > 0
238  self.classicButtons[CLASSIC_BTN_L] = (clasButtons & CLASSIC_BTN_L) > 0
239  self.classicButtons[CLASSIC_BTN_LEFT] = (clasButtons & CLASSIC_BTN_LEFT) > 0
240  self.classicButtons[CLASSIC_BTN_MINUS] = (clasButtons & CLASSIC_BTN_MINUS) > 0
241  self.classicButtons[CLASSIC_BTN_PLUS] = (clasButtons & CLASSIC_BTN_PLUS) > 0
242  self.classicButtons[CLASSIC_BTN_R] = (clasButtons & CLASSIC_BTN_R) > 0
243  self.classicButtons[CLASSIC_BTN_RIGHT] = (clasButtons & CLASSIC_BTN_RIGHT) > 0
244  self.classicButtons[CLASSIC_BTN_UP] = (clasButtons & CLASSIC_BTN_UP) > 0
245  self.classicButtons[CLASSIC_BTN_X] = (clasButtons & CLASSIC_BTN_X) > 0
246  self.classicButtons[CLASSIC_BTN_Y] = (clasButtons & CLASSIC_BTN_Y) > 0
247  self.classicButtons[CLASSIC_BTN_ZL] = (clasButtons & CLASSIC_BTN_ZL) > 0
248  self.classicButtons[CLASSIC_BTN_ZR] = (clasButtons & CLASSIC_BTN_ZR) > 0
249  continue
250 
251  @classmethod
252  def setAccelerometerCalibration(cls, zeroReading, oneReading):
253  """Set the current accelerometer zeroing calibration."""
254  cls._accCalibrationZero = WIIReading(zeroReading)
255  cls._accCalibrationOne = WIIReading(oneReading)
256 
257  @classmethod
259  """Return current accelerometer zeroing offset as two lists of x/y/z: the
260  zero-reading, and the one-reading."""
261  return (cls._accCalibrationZero.tuple(), cls._accCalibrationOne.tuple())
262 
263  @classmethod
264  def setGyroCalibration(cls, zeroReading):
265  """Set the x/y/z zeroing offsets for the gyro. Argument is a list"""
266 
267  cls._gyroZeroReading = GyroReading(zeroReading)
268 
269  @classmethod
271  """Return current gyro zeroing offset as a list of x/y/z. """
272  return cls._gyroZeroReading.tuple()
273 
274  @classmethod
275  def setNunchukAccelerometerCalibration(cls, zeroReading, oneReading):
276  """Set the current nunchuk accelerometer zeroing calibration."""
277  cls._nunchukZeroReading = WIIReading(zeroReading)
278  cls._nunchukOneReading = WIIReading(oneReading)
279 
280  @classmethod
281  def setNunchukJoystickCalibration(cls, readings):
282  """Set the origin for the nunchuk joystick"""
283  cls._nunchukJoystickZero = readings
284 
285  @classmethod
287  """Return current nunchuk accelerometer zeroing offset as two lists of x/y/z: the
288  zero-reading, and the one-reading."""
289  return (cls._nunchukZeroReading.tuple(), cls._nunchukOneReading.tuple())
290 
291  def __str__(self):
292 
293  # Timestamp:
294  res = 'Time: ' + self.ascTime + '\n'
295 
296  # Buttons that are pressed:
297  butRes = ''
298 
299  if self.buttons is not None:
300  if self.buttons[BTN_1]:
301  butRes += ', 1'
302  if self.buttons[BTN_2]:
303  butRes += ', 2'
304  if self.buttons[BTN_PLUS]:
305  butRes += ', Plus'
306  if self.buttons[BTN_MINUS]:
307  butRes += ', Minus'
308  if self.buttons[BTN_A]:
309  butRes += ', A'
310  if self.buttons[BTN_B]:
311  butRes += ', B'
312  if self.buttons[BTN_UP]:
313  butRes += ', 4Way-up'
314  if self.buttons[BTN_DOWN]:
315  butRes += ', 4Way-down'
316  if self.buttons[BTN_LEFT]:
317  butRes += ', 4Way-left'
318  if self.buttons[BTN_RIGHT]:
319  butRes += ', 4Way-right'
320  if self.buttons[BTN_HOME]:
321  butRes += ', Home'
322 
323  # If none of the buttons is down, indicate that:
324  if not butRes:
325  res += 'Buttons: none.\n'
326  else:
327  res += 'Buttons: ' + butRes.lstrip(', ') + '\n'
328 
329  # Accelerator:
330  if self.acc is not None:
331  res += 'Accelerator: (' + \
332  repr(self.acc[X]) + ',' + \
333  repr(self.acc[Y]) + ',' + \
334  repr(self.acc[Z]) + ')\n'
335 
336  # Gyro (angular rate):
337  if self.angleRate is not None:
338  res += 'Gyro (angular rate): (' + \
339  repr(self.angleRate[X]) + ',' + \
340  repr(self.angleRate[Y]) + ',' + \
341  repr(self.angleRate[Z]) + ')\n'
342 
343  # Rumble status:
344  if self.rumble:
345  res += 'Rumble: On.\n'
346  else:
347  res += 'Rumble: Off.\n'
348 
349  # IR Sources:
350  irRes = ''
351 
352  if self.IRSources is not None:
353  if self.IRSources[IR1] is not None:
354  irRes += 'IR source 1'
355 
356  if self.IRSources[IR2] is not None:
357  irRes += 'IR source 2'
358 
359  if self.IRSources[IR3] is not None:
360  irRes += 'IR source 3'
361 
362  if self.IRSources[IR4] is not None:
363  irRes += 'IR source 4'
364 
365  if not irRes:
366  res += irRes.lstrip(', ') + '\n'
367  else:
368  res += 'No IR sources detected.\n'
369 
370  return res
371 
372  def __repr__(self):
373  return self.__str__()
374 
375 
376 class WIIReading(object):
377  """Instances hold one 3-D reading.
378 
379  Methods:
380  [X], [Y], [Z] to obtain respective axis paramters.
381  tuple() to obtain x/y/z as a NumPy array.
382  +,-,/ to add or subtract readings from each other
383  as one vector operation (pairwise for each dimension).
384  """
385 
386  # Private instance vars:
387  # o _measurement = np.array(3, dtype=numpy.float64)
388  # o time
389 
390  def __init__(self, xyz, theTime=None):
391  """Create a (possibly) time stamped WII Reading.
392 
393  Parameter xyz is an array of x,y,z coordinates of the
394  reading. WIIReading instances can be added, subtracted, and
395  divided into each other. The operations are pairwise over
396  x, y, and z. A numpy array of x,y,z is available by
397  calling tuple(). The time stamp is available via time().
398 
399  """
400  self.time = theTime
401  self._measurement = np.array([xyz[X], xyz[Y], xyz[Z]], dtype=np.float64)
402 
403  def __getitem__(self, key):
404  if key not in (X, Y, Z):
405  raise AttributeError("Attempt to index into a 3-D measurement array with index " + repr(key) + ".")
406  return self._measurement[key]
407 
408  def __str__(self):
409  return '[x=' + repr(self._measurement[X]) + \
410  ', y=' + repr(self._measurement[Y]) + \
411  ' z=' + repr(self._measurement[Z]) + \
412  ']'
413 
414  def __repr__(self):
415  return '[' + str(self._measurement[X]) + ', ' + \
416  str(self._measurement[Y]) + ', ' + str(self._measurement[Z]) + ']'
417 
418  def tuple(self):
419  return self._measurement
420 
421  def __add__(self, other):
422  """Adding two readings returns a numpy tuple with readings added pairwise."""
423 
424  return self._measurement + other._measurement
425 
426  def __sub__(self, other):
427  """Subtracting two readings returns a numpy tuple with components subtracted pairwise."""
428 
429  return self._measurement - other._measurement
430 
431  def __div__(self, other):
432  """Dividing two readings returns a numpy tuple with components divided pairwise."""
433 
434  return self._measurement / other._measurement
435 
436  def scale(self, scaleFactor):
437  """Return a numpy tuple that with X, Y, Z scaled by the given factor."""
438 
439  return self._measurement * scaleFactor
440 
441 
442 class GyroReading():
443  """Instances hold one gyroscope reading.
444 
445  Methods:
446  [PHI], [THETA], [PSI] to obtain respective axis paramters.
447  tuple() to obtain phi/theta/psi as a NumPy array.
448  +,-,/ to add or subtract readings from each other
449  as one vector operation (pairwise for each dimension).
450  """
451  # Local instance vars:
452  # o _measurement = np.array(3, dtype=numpy.float64)
453  # o time
454 
455  def __init__(self, phiThetaPsi, theTime=None):
456  """Create a (possibly) time stamped WII Reading.
457 
458  Parameter phiThetaPsi is an array of phi,theta,psi coordinates of the
459  gyro reading. GyroReading instances can be added, subtracted, and
460  divided into each other. The operations are pairwise over
461  phi, theta, and psi. A numpy array of phi,theta,psi is available by
462  calling tuple(). The time stamp is available via time().
463  """
464 
465  self.time = theTime
466  self._measurement = np.array([phiThetaPsi[PHI], phiThetaPsi[THETA], phiThetaPsi[PSI]], dtype=np.float64)
467 
468  def __getitem__(self, key):
469  if key not in (PHI, THETA, PSI):
470  raise AttributeError("Attempt to index into a 3-D measurement array with index " + repr(key) + ".")
471  return self._measurement[key]
472 
473  def __str__(self):
474  return '[PHI (roll)=' + repr(self._measurement[PHI]) + \
475  ', THETA (pitch)=' + repr(self._measurement[THETA]) + \
476  ', PSI (yaw)=' + repr(self._measurement[PSI]) + \
477  ']'
478 
479  def __repr__(self):
480  '[' + str(self._measurement[PHI]) + ', ' + \
481  str(self._measurement[THETA]) + ', ' + \
482  str(self._measurement[PSI]) + ']'
483 
484  def tuple(self):
485  return self._measurement
486 
487  def __add__(self, other):
488  """Adding two gyro readings returns a new reading with components added pairwise."""
489  return self._measurement + other._measurement
490 
491  def __sub__(self, other):
492  """Subtracting two gyro readings returns a new reading
493  with components subtracted pairwise.
494 
495  """
496  return self._measurement - other._measurement
497 
498  def __div__(self, other):
499  """Dividing two readings returns a numpy tuple with components divided pairwise."""
500 
501  return self._measurement / other._measurement
502 
503  def scale(self, scaleFactor):
504  """Return a numpy tuple that with X, Y, Z scaled by the given factor."""
505 
506  return self._measurement * scaleFactor
wiimote.wiistate.WIIState.nunchukPresent
nunchukPresent
Definition: wiistate.py:96
wiimote.wiistate.WIIState.motionPlusPresent
motionPlusPresent
Definition: wiistate.py:91
wiimote.wiistate.WIIReading._measurement
_measurement
Definition: wiistate.py:401
wiimote.wiistate.WIIReading.__repr__
def __repr__(self)
Definition: wiistate.py:414
wiimote.wiistate.WIIReading.__init__
def __init__(self, xyz, theTime=None)
Definition: wiistate.py:390
wiimote.wiistate.WIIReading
Definition: wiistate.py:376
wiimote.wiistate.GyroReading.__init__
def __init__(self, phiThetaPsi, theTime=None)
Definition: wiistate.py:455
wiimote.wiistate.WIIReading.scale
def scale(self, scaleFactor)
Definition: wiistate.py:436
wiimote.wiistate.GyroReading.__div__
def __div__(self, other)
Definition: wiistate.py:498
wiimote.wiistate.GyroReading.__repr__
def __repr__(self)
Definition: wiistate.py:479
wiimote.wiistate.WIIState.time
time
Definition: wiistate.py:81
wiimote.wiistate.WIIState.IRSources
IRSources
Definition: wiistate.py:84
wiimote.wiistate.WIIState.battery
battery
Definition: wiistate.py:85
wiimote.wiistate.WIIState.setNunchukAccelerometerCalibration
def setNunchukAccelerometerCalibration(cls, zeroReading, oneReading)
Definition: wiistate.py:275
wiimote.wiistate.WIIReading.tuple
def tuple(self)
Definition: wiistate.py:418
wiimote.wiistate.WIIState.rumble
rumble
Definition: wiistate.py:83
wiimote.wiistate.WIIState.nunchukAcc
nunchukAcc
Definition: wiistate.py:98
wiimote.wiistate.WIIState.acc
acc
Definition: wiistate.py:86
wiimote.wiistate.WIIReading.__div__
def __div__(self, other)
Definition: wiistate.py:431
wiimote.wiistate.WIIState.setAccelerometerCalibration
def setAccelerometerCalibration(cls, zeroReading, oneReading)
Definition: wiistate.py:252
wiimote.wiistate.WIIState.buttons
buttons
Definition: wiistate.py:92
wiimote.wiistate.WIIState.nunchukButtons
nunchukButtons
Definition: wiistate.py:101
wiimote.wiistate.WIIState.setNunchukJoystickCalibration
def setNunchukJoystickCalibration(cls, readings)
Definition: wiistate.py:281
wiimote.wiistate.GyroReading
Definition: wiistate.py:442
wiimote.wiistate.GyroReading._measurement
_measurement
Definition: wiistate.py:466
wiimote.wiistate.WIIState.ascTime
ascTime
Definition: wiistate.py:82
wiimote.wiistate.WIIState._gyroZeroReading
_gyroZeroReading
Definition: wiistate.py:75
wiimote.wiistate.WIIReading.__sub__
def __sub__(self, other)
Definition: wiistate.py:426
wiimote.wiistate.WIIState.nunchukStick
nunchukStick
Definition: wiistate.py:99
wiimote.wiistate.WIIState.__repr__
def __repr__(self)
Definition: wiistate.py:372
wiimote.wiistate.WIIState.nunchukStickRaw
nunchukStickRaw
Definition: wiistate.py:100
wiimote.wiistate.WIIState._accCalibrationOne
_accCalibrationOne
Definition: wiistate.py:255
wiimote.wiistate.GyroReading.time
time
Definition: wiistate.py:465
wiimote.wiistate.WIIState.getNunchukAccelerometerCalibration
def getNunchukAccelerometerCalibration(cls)
Definition: wiistate.py:286
wiimote.wiistate.GyroReading.__str__
def __str__(self)
Definition: wiistate.py:473
wiimote.wiistate.GyroReading.scale
def scale(self, scaleFactor)
Definition: wiistate.py:503
wiimote.wiistate.WIIState.classicStickLeft
classicStickLeft
Definition: wiistate.py:104
wiimote.wiistate.WIIState.accRaw
accRaw
Definition: wiistate.py:87
wiimote.wiistate.WIIReading.__add__
def __add__(self, other)
Definition: wiistate.py:421
wiimote.wiistate.GyroReading.__sub__
def __sub__(self, other)
Definition: wiistate.py:491
wiimote.wiistate.WIIState.getGyroCalibration
def getGyroCalibration(cls)
Definition: wiistate.py:270
wiimote.wiistate.GyroReading.__add__
def __add__(self, other)
Definition: wiistate.py:487
wiimote.wiistate.WIIReading.__getitem__
def __getitem__(self, key)
Definition: wiistate.py:403
wiimote.wiistate.WIIState.setGyroCalibration
def setGyroCalibration(cls, zeroReading)
Definition: wiistate.py:264
wiimote.wiistate.WIIState
Definition: wiistate.py:31
wiimote.wiistate.WIIState._nunchukZeroReading
_nunchukZeroReading
Definition: wiistate.py:76
wiimote.wiistate.WIIState.classicButtons
classicButtons
Definition: wiistate.py:106
wiimote.wiistate.WIIState.getAccelerometerCalibration
def getAccelerometerCalibration(cls)
Definition: wiistate.py:258
wiimote.wiistate.WIIState.angleRageRaw
angleRageRaw
Definition: wiistate.py:90
wiimote.wiistate.GyroReading.__getitem__
def __getitem__(self, key)
Definition: wiistate.py:468
wiimote.wiistate.WIIState.__str__
def __str__(self)
Definition: wiistate.py:291
wiimote.wiistate.WIIState.angleRateRaw
angleRateRaw
Definition: wiistate.py:182
wiimote.wiistate.WIIState.angleRate
angleRate
Definition: wiistate.py:88
wiimote.wiistate.WIIState.__init__
def __init__(self, state, theTime, theRumble, buttonStatus)
Definition: wiistate.py:79
wiimote.wiistate.WIIState.classicStickRight
classicStickRight
Definition: wiistate.py:105
wiimote.wiistate.WIIState.nunchukAccRaw
nunchukAccRaw
Definition: wiistate.py:97
wiimote.wiistate.WIIReading.time
time
Definition: wiistate.py:400
wiimote.wiistate.WIIState._nunchukOneReading
_nunchukOneReading
Definition: wiistate.py:278
wiimote.wiistate.WIIState._nunchukJoystickZero
_nunchukJoystickZero
Definition: wiistate.py:77
wiimote.wiistate.WIIState.classicPresent
classicPresent
Definition: wiistate.py:103
wiimote.wiistate.WIIState._accCalibrationZero
_accCalibrationZero
Definition: wiistate.py:74
wiimote.wiistate.GyroReading.tuple
def tuple(self)
Definition: wiistate.py:484


wiimote
Author(s): Andreas Paepcke, Melonee Wise, Mark Horn
autogenerated on Thu Dec 5 2024 03:18:13