Public Member Functions | Public Attributes | Private Attributes | Static Private Attributes | List of all members
wiimote.wiistate.WIIState Class Reference
Inheritance diagram for wiimote.wiistate.WIIState:
Inheritance graph
[legend]

Public Member Functions

def __init__ (self, state, theTime, theRumble, buttonStatus)
 
def __repr__ (self)
 
def __str__ (self)
 
def getAccelerometerCalibration (cls)
 
def getGyroCalibration (cls)
 
def getNunchukAccelerometerCalibration (cls)
 
def setAccelerometerCalibration (cls, zeroReading, oneReading)
 
def setGyroCalibration (cls, zeroReading)
 
def setNunchukAccelerometerCalibration (cls, zeroReading, oneReading)
 
def setNunchukJoystickCalibration (cls, readings)
 

Public Attributes

 acc
 
 accRaw
 
 angleRageRaw
 
 angleRate
 
 angleRateRaw
 
 ascTime
 
 battery
 
 buttons
 
 classicButtons
 
 classicPresent
 
 classicStickLeft
 
 classicStickRight
 
 IRSources
 
 motionPlusPresent
 
 nunchukAcc
 
 nunchukAccRaw
 
 nunchukButtons
 
 nunchukPresent
 
 nunchukStick
 
 nunchukStickRaw
 
 rumble
 
 time
 

Private Attributes

 _accCalibrationOne
 
 _nunchukOneReading
 

Static Private Attributes

 _accCalibrationZero = None
 
 _gyroZeroReading = None
 
 _nunchukJoystickZero = None
 
 _nunchukZeroReading = None
 

Detailed Description

Holds the state of a WIIRemote-plus.

The state is passed in and is as communicated
by one message from the WII+ device. We unpack
the information and place it into individual
dictionaries for callers to grab.

Public instance variables:
  o time             Time in fractional seconds since beginning of Epoch of when
                       state was measured (Float).
  o ascTime          Time when state was measured (Human-readable)
  o rumble           True/False if wiimote vibration is on/off
  o angleRate        A GyroReading instance containing gyro (a.k.a. angular rate) measurement
  o acc              A WIIReading instance containing accelerometer measurement corrected by
                       the calibration information that is stored in the Wiimote
  o accRaw           A WIIReading instance containing accelerometer measurement uncorrected
  o buttons          A dictionary for which buttons are being held down. That could be
                       multiple buttons. Keys are:
                             BTN_1, BTN_2, BTN_PLUS, BTN_MINUS, BTN_A, BTN_B,
                             BTN_UP, BTN_DOWN, BTN_LEFT, BTN_RIGHT, BTN_HOME
                       Values are 1/0
  o IRSources        Dictionary with on/off values for which IR lights are
                     being sensed. Keys are:
                             IR1, IR2, IR3, IR4
                     Values are 1/0
  o motionPlusPresent True if a gyro Motion+ is plugged into the Wiimote. Else False

  o nunchukPresent   True if nunchuk is plugged in. Else False
  o nunchukAccRaw    A WIIReading instance with acceleromoter measurement from the nunchuk (raw values)
  o nunchukAcc       The same, but zeroed using factory calibration
  o nunchukStickRaw  A tuple with the two axes of the joystick on the nunchuk, raw readings
  o nunchukStick     A tuple with the two axes of the joystick on the nunchuk, zeroed to be [-1, 1]
  o nunchukButtons   A dictionary for which nunchuk buttons are down. Keys are BTN_C and BTN_Z

Public methods:
  o setAccelerometerCalibration   Bias setting for accelerometer. This triplet is used to
                                    turn raw accelerometer values into calibrated values.
  o setGyroCalibration            Bias setting for gyro. This triplet is used to
                                    turn raw gyro values into calibrated values.

Definition at line 31 of file wiistate.py.

Constructor & Destructor Documentation

◆ __init__()

def wiimote.wiistate.WIIState.__init__ (   self,
  state,
  theTime,
  theRumble,
  buttonStatus 
)
Unpack the given state, normalizing if normalizers are passed in.

Definition at line 79 of file wiistate.py.

Member Function Documentation

◆ __repr__()

def wiimote.wiistate.WIIState.__repr__ (   self)

Definition at line 372 of file wiistate.py.

◆ __str__()

def wiimote.wiistate.WIIState.__str__ (   self)

Definition at line 291 of file wiistate.py.

◆ getAccelerometerCalibration()

def wiimote.wiistate.WIIState.getAccelerometerCalibration (   cls)
Return current accelerometer zeroing offset as two lists of x/y/z: the
zero-reading, and the one-reading.

Definition at line 258 of file wiistate.py.

◆ getGyroCalibration()

def wiimote.wiistate.WIIState.getGyroCalibration (   cls)
Return current gyro zeroing offset as a list of x/y/z. 

Definition at line 270 of file wiistate.py.

◆ getNunchukAccelerometerCalibration()

def wiimote.wiistate.WIIState.getNunchukAccelerometerCalibration (   cls)
Return current nunchuk accelerometer zeroing offset as two lists of x/y/z: the
zero-reading, and the one-reading.

Definition at line 286 of file wiistate.py.

◆ setAccelerometerCalibration()

def wiimote.wiistate.WIIState.setAccelerometerCalibration (   cls,
  zeroReading,
  oneReading 
)
Set the current accelerometer zeroing calibration.

Definition at line 252 of file wiistate.py.

◆ setGyroCalibration()

def wiimote.wiistate.WIIState.setGyroCalibration (   cls,
  zeroReading 
)
Set the x/y/z zeroing offsets for the gyro. Argument is a list

Definition at line 264 of file wiistate.py.

◆ setNunchukAccelerometerCalibration()

def wiimote.wiistate.WIIState.setNunchukAccelerometerCalibration (   cls,
  zeroReading,
  oneReading 
)
Set the current nunchuk accelerometer zeroing calibration.

Definition at line 275 of file wiistate.py.

◆ setNunchukJoystickCalibration()

def wiimote.wiistate.WIIState.setNunchukJoystickCalibration (   cls,
  readings 
)
Set the origin for the nunchuk joystick

Definition at line 281 of file wiistate.py.

Member Data Documentation

◆ _accCalibrationOne

wiimote.wiistate.WIIState._accCalibrationOne
private

Definition at line 255 of file wiistate.py.

◆ _accCalibrationZero

wiimote.wiistate.WIIState._accCalibrationZero = None
staticprivate

Definition at line 74 of file wiistate.py.

◆ _gyroZeroReading

wiimote.wiistate.WIIState._gyroZeroReading = None
staticprivate

Definition at line 75 of file wiistate.py.

◆ _nunchukJoystickZero

wiimote.wiistate.WIIState._nunchukJoystickZero = None
staticprivate

Definition at line 77 of file wiistate.py.

◆ _nunchukOneReading

wiimote.wiistate.WIIState._nunchukOneReading
private

Definition at line 278 of file wiistate.py.

◆ _nunchukZeroReading

wiimote.wiistate.WIIState._nunchukZeroReading = None
staticprivate

Definition at line 76 of file wiistate.py.

◆ acc

wiimote.wiistate.WIIState.acc

Definition at line 86 of file wiistate.py.

◆ accRaw

wiimote.wiistate.WIIState.accRaw

Definition at line 87 of file wiistate.py.

◆ angleRageRaw

wiimote.wiistate.WIIState.angleRageRaw

Definition at line 90 of file wiistate.py.

◆ angleRate

wiimote.wiistate.WIIState.angleRate

Definition at line 88 of file wiistate.py.

◆ angleRateRaw

wiimote.wiistate.WIIState.angleRateRaw

Definition at line 182 of file wiistate.py.

◆ ascTime

wiimote.wiistate.WIIState.ascTime

Definition at line 82 of file wiistate.py.

◆ battery

wiimote.wiistate.WIIState.battery

Definition at line 85 of file wiistate.py.

◆ buttons

wiimote.wiistate.WIIState.buttons

Definition at line 92 of file wiistate.py.

◆ classicButtons

wiimote.wiistate.WIIState.classicButtons

Definition at line 106 of file wiistate.py.

◆ classicPresent

wiimote.wiistate.WIIState.classicPresent

Definition at line 103 of file wiistate.py.

◆ classicStickLeft

wiimote.wiistate.WIIState.classicStickLeft

Definition at line 104 of file wiistate.py.

◆ classicStickRight

wiimote.wiistate.WIIState.classicStickRight

Definition at line 105 of file wiistate.py.

◆ IRSources

wiimote.wiistate.WIIState.IRSources

Definition at line 84 of file wiistate.py.

◆ motionPlusPresent

wiimote.wiistate.WIIState.motionPlusPresent

Definition at line 91 of file wiistate.py.

◆ nunchukAcc

wiimote.wiistate.WIIState.nunchukAcc

Definition at line 98 of file wiistate.py.

◆ nunchukAccRaw

wiimote.wiistate.WIIState.nunchukAccRaw

Definition at line 97 of file wiistate.py.

◆ nunchukButtons

wiimote.wiistate.WIIState.nunchukButtons

Definition at line 101 of file wiistate.py.

◆ nunchukPresent

wiimote.wiistate.WIIState.nunchukPresent

Definition at line 96 of file wiistate.py.

◆ nunchukStick

wiimote.wiistate.WIIState.nunchukStick

Definition at line 99 of file wiistate.py.

◆ nunchukStickRaw

wiimote.wiistate.WIIState.nunchukStickRaw

Definition at line 100 of file wiistate.py.

◆ rumble

wiimote.wiistate.WIIState.rumble

Definition at line 83 of file wiistate.py.

◆ time

wiimote.wiistate.WIIState.time

Definition at line 81 of file wiistate.py.


The documentation for this class was generated from the following file:


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