public void Update(DolphiimoteData rawData) { this.data = rawData; Acceleration = calibration.NormalizeAcceleration(DateTime.Now, rawData.acceleration.x, rawData.acceleration.y, rawData.acceleration.z); if (IsDataValid(WiimoteDataValid.MotionPlus)) { MotionPlus = CalculateMotionPlus(rawData.motionplus); fuser.HandleIMUData(MotionPlus.Value.x, MotionPlus.Value.y, MotionPlus.Value.z, Acceleration.Value.x, Acceleration.Value.y, Acceleration.Value.z); } if (IsDataValid(WiimoteDataValid.Nunchuck)) { Nunchuck = new Nunchuck { Stick = calibration.NormalizeNunchuckStick(DateTime.Now, rawData.nunchuck.stick_x, rawData.nunchuck.stick_y), Acceleration = calibration.NormalizeNunchuckAcceleration(DateTime.Now, rawData.nunchuck.x, rawData.nunchuck.y, rawData.nunchuck.z) }; } }
public DolphiimoteWiimoteData(byte wiimoteNumber, WiimoteCalibration calibration, IMotionPlusFuser fuser) { WiimoteNumber = wiimoteNumber; this.calibration = calibration; this.fuser = fuser; MotionPlus = new CalibratedValue <Gyro>(false, new Gyro(0, 0, 0)); Acceleration = new CalibratedValue <Acceleration>(false, new Acceleration(0, 0, 0)); Nunchuck = new Nunchuck { Acceleration = new Acceleration(0, 0, 0), Stick = new NunchuckStick(0, 0) }; }
public DolphiimoteWiimoteData(byte wiimoteNumber, WiimoteCalibration calibration, IMotionPlusFuser fuser) { WiimoteNumber = wiimoteNumber; this.calibration = calibration; this.fuser = fuser; MotionPlus = new CalibratedValue <Gyro>(false, new Gyro(0, 0, 0)); Acceleration = new CalibratedValue <Acceleration>(false, new Acceleration(0, 0, 0)); Nunchuck = new Nunchuck { Acceleration = new Acceleration(0, 0, 0), Stick = new AnalogStick(0, 0) }; ClassicController = new ClassicController { LeftStick = new AnalogStick(0, 0), RightStick = new AnalogStick(0, 0), RightTrigger = new AnalogTrigger(0), LeftTrigger = new AnalogTrigger(0) }; Guitar = new Guitar { Stick = new AnalogStick(0, 0), TapBar = new TapBar(0x0F), Whammy = new AnalogTrigger(0), IsGH3 = false }; BalanceBoardSensor def = new BalanceBoardSensor { calibration = new BalanceBoardSensorCalibration { kg00 = 0, kg17 = 0, kg34 = 0 }, kg = 0, lb = 0, raw = 0 }; BalanceBoard = new BalanceBoard { sensors = new BalanceBoardSensorList { bottomLeft = def, bottomRight = def, topLeft = def, topRight = def }, weight = new BalanceBoardWeight { kg = 0, lb = 0, raw = 0 }, centerOfGravity = new AnalogStick(0, 0) }; BatteryPercentage = 0; }