Arduino Tracker
Plugin for OSVR that uses an Arduino + MPU6050 to do rotational headtracking.
How to use
- Open Arduino_Tracker_Sketch in the Arduino IDE, and upload it to your board.
- Open the serial monitor and set the baudrate to 115200 and if you see something like this, it worked:
- Place the dll into your osvr-plugins-0 folder.
- Add the following to your osvr_server_config file, substituting "com4" with the com port your arduino is connected to:
"drivers": [{
"plugin": "inf_osvr_arduino",
"driver": "ArduinoTracker",
"params": {
"port":"com4"
}
}],
...
"aliases": {
"/me/head": "/inf_osvr_arduino/ArduinoTracker/semantic/arduino"
}
- Run the calibration procedure the first time you use the plugin with the key combo CTRL + SHIFT + I. See notes below for more info...
- Place your headset in the "Forward" direction and press the key combo CTRL + SHIFT + O to reset this position to 0 (looking directly forward on the Z axis)
notes
- The X axis of your MPU should be pointing toward the left, and y axis pointing toward you and be mounted on the front of your headset for the axes to align.
- Use the key combo CTRL + SHIFT + I from anywhere to begin the calibration procedure.
- Calibration will sometimes hang. Simply reconnect the arduino to reset and try again (plugin will auto-reconnect to arduino).
- You will need to run calibration the first time you use the plugin. The calibration procedure saves the offsets to eeprom so you should only need to run it once.
- Use the key combo CTRL + SHIFT + O from anywhere to reset your current rotation to 0 (looking directly forward on the Z axis).
- Because the MPU6050 doesn't have a magnetometer, you may need to reset the rotation occasionally as it has a tendency to drift over time.