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) |
Private Attributes | |
_accCalibrationOne | |
_nunchukOneReading | |
Static Private Attributes | |
_accCalibrationZero = None | |
_gyroZeroReading = None | |
_nunchukJoystickZero = None | |
_nunchukZeroReading = None | |
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 35 of file wiistate.py.
def wiimote.wiistate.WIIState.__init__ | ( | self, | |
state, | |||
theTime, | |||
theRumble, | |||
buttonStatus | |||
) |
Unpack the given state, normalizing if normalizers are passed in.
Definition at line 86 of file wiistate.py.
def wiimote.wiistate.WIIState.__repr__ | ( | self | ) |
Definition at line 421 of file wiistate.py.
def wiimote.wiistate.WIIState.__str__ | ( | self | ) |
Definition at line 330 of file wiistate.py.
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 272 of file wiistate.py.
def wiimote.wiistate.WIIState.getGyroCalibration | ( | cls | ) |
Return current gyro zeroing offset as a list of x/y/z.
Definition at line 292 of file wiistate.py.
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 320 of file wiistate.py.
def wiimote.wiistate.WIIState.setAccelerometerCalibration | ( | cls, | |
zeroReading, | |||
oneReading | |||
) |
Set the current accelerometer zeroing calibration.
Definition at line 262 of file wiistate.py.
def wiimote.wiistate.WIIState.setGyroCalibration | ( | cls, | |
zeroReading | |||
) |
Set the x/y/z zeroing offsets for the gyro. Argument is a list
Definition at line 282 of file wiistate.py.
def wiimote.wiistate.WIIState.setNunchukAccelerometerCalibration | ( | cls, | |
zeroReading, | |||
oneReading | |||
) |
Set the current nunchuk accelerometer zeroing calibration.
Definition at line 301 of file wiistate.py.
def wiimote.wiistate.WIIState.setNunchukJoystickCalibration | ( | cls, | |
readings | |||
) |
Set the origin for the nunchuk joystick
Definition at line 311 of file wiistate.py.
|
private |
Definition at line 265 of file wiistate.py.
|
staticprivate |
Definition at line 77 of file wiistate.py.
|
staticprivate |
Definition at line 78 of file wiistate.py.
|
staticprivate |
Definition at line 80 of file wiistate.py.
|
private |
Definition at line 304 of file wiistate.py.
|
staticprivate |
Definition at line 79 of file wiistate.py.
wiimote.wiistate.WIIState.acc |
Definition at line 94 of file wiistate.py.
wiimote.wiistate.WIIState.accRaw |
Definition at line 95 of file wiistate.py.
wiimote.wiistate.WIIState.angleRageRaw |
Definition at line 98 of file wiistate.py.
wiimote.wiistate.WIIState.angleRate |
Definition at line 96 of file wiistate.py.
wiimote.wiistate.WIIState.angleRateRaw |
Definition at line 187 of file wiistate.py.
wiimote.wiistate.WIIState.ascTime |
Definition at line 90 of file wiistate.py.
wiimote.wiistate.WIIState.battery |
Definition at line 93 of file wiistate.py.
wiimote.wiistate.WIIState.buttons |
Definition at line 100 of file wiistate.py.
wiimote.wiistate.WIIState.classicButtons |
Definition at line 114 of file wiistate.py.
wiimote.wiistate.WIIState.classicPresent |
Definition at line 111 of file wiistate.py.
wiimote.wiistate.WIIState.classicStickLeft |
Definition at line 112 of file wiistate.py.
wiimote.wiistate.WIIState.classicStickRight |
Definition at line 113 of file wiistate.py.
wiimote.wiistate.WIIState.IRSources |
Definition at line 92 of file wiistate.py.
wiimote.wiistate.WIIState.motionPlusPresent |
Definition at line 99 of file wiistate.py.
wiimote.wiistate.WIIState.nunchukAcc |
Definition at line 106 of file wiistate.py.
wiimote.wiistate.WIIState.nunchukAccRaw |
Definition at line 105 of file wiistate.py.
wiimote.wiistate.WIIState.nunchukButtons |
Definition at line 109 of file wiistate.py.
wiimote.wiistate.WIIState.nunchukPresent |
Definition at line 104 of file wiistate.py.
wiimote.wiistate.WIIState.nunchukStick |
Definition at line 107 of file wiistate.py.
wiimote.wiistate.WIIState.nunchukStickRaw |
Definition at line 108 of file wiistate.py.
wiimote.wiistate.WIIState.rumble |
Definition at line 91 of file wiistate.py.
wiimote.wiistate.WIIState.time |
Definition at line 89 of file wiistate.py.