wchill / Left4VR

Left 4 Dead 2 (and other games) enhanced with VR addons for MHacks V
7 stars 1 forks source link

Nunchuck/MotionPlus support over I2C #2

Open wchill opened 9 years ago

wchill commented 9 years ago

Currently all data from the Nunchuck is done using the Wiimote as a communication bridge and using FreePIE to handle the data received. While this is a workable solution, it still makes the stack somewhat clunkier, limits platform compatibility to Windows only, and having an additional program in the background to run makes things that much harder to setup.

The solution is to have the Raspberry Pi communicate directly with the Nunchuck using the I2C protocol, which is actually pretty simple. Then extend the Pi's code such that it will pass this data over to the computer. There should be no added latency as the Wiimote has to talk with the Nunchuck over I2C anyway.

As an addendum to this, MotionPlus support (the standalone MotionPlus, not the Wiimote+) needs to be added. This will allow us to remove myo-python as a dependency and also remove the need for a Myo.

Useful links:

Using the MotionPlus in passthrough mode

WiiBrew article on data passed back from the MotionPlus in passthrough mode

Note that this will drop the poll rate of the data from each peripheral to 6ms. This will most likely not be a problem for the time being, but it may be worthwhile to consider using a dedicated IMU like this 9DOF Razor IMU.

wchill commented 9 years ago

Also, to connect the peripherals, an adapter board such as this will be needed.