Opentrack/head tracking for games using MPU6050 & ESP-01
Posted: Sun Feb 14, 2016 3:45 am
Hi,
I used stock MPU6050 and i2c libraries - and made a tiny modification to one of the examples (MPU6050_DMP6.ino) to get opentrack head tracking working via UDP.
If you Google for "Ed Tracker" - its pretty much the same sort of thing, only theirs is much much better!
Its not calibrated properly - and "drifts" over time (google around - there might be a fix somewhere).
I only knocked it up as a play thing, I don't intend to maintain/improve it...
I don't have any setup/config in there - the ssid/password and PC are all hard coded in the sketch.
You should see these lines which will need changing
WiFi.begin("ssid", "password");
...
port.beginPacket("192.168.2.10",remotePort);
And you'll need to adjust :
Wire.begin(0,2);
for I2C configuration, depending on how you wire up the sensor.
Which are the I2C pins, the Wifi setup and the remote PC to send the data packets to.
With that all working - start opentrack on the PC you setup in "beginPacket", move the sensor - and the octopus should move. The sensor seems to take a little while to warm up - and at least on mine - I get yaw drift for a few minutes during this phase - after that - it gets more reliable.
In opentrack set :
Tracker: FreePIE UDP receiver
Protocol freetrack2.0 enhanced
Make sure you set a "center" key in the options (with the drift - you'll need it) - then "start".
Depending on how you place the sensor - you might need to adjust the pitch/roll/yaw options (On mine - I needed to invert pitch and roll).
Then start your game (I'm playing with Elite Dangerous) and move your head
[ Uploaded with a .txt extension - it should obviously be .ino - but the forums block that extension ]
I used stock MPU6050 and i2c libraries - and made a tiny modification to one of the examples (MPU6050_DMP6.ino) to get opentrack head tracking working via UDP.
If you Google for "Ed Tracker" - its pretty much the same sort of thing, only theirs is much much better!
Its not calibrated properly - and "drifts" over time (google around - there might be a fix somewhere).
I only knocked it up as a play thing, I don't intend to maintain/improve it...
I don't have any setup/config in there - the ssid/password and PC are all hard coded in the sketch.
You should see these lines which will need changing
WiFi.begin("ssid", "password");
...
port.beginPacket("192.168.2.10",remotePort);
And you'll need to adjust :
Wire.begin(0,2);
for I2C configuration, depending on how you wire up the sensor.
Which are the I2C pins, the Wifi setup and the remote PC to send the data packets to.
With that all working - start opentrack on the PC you setup in "beginPacket", move the sensor - and the octopus should move. The sensor seems to take a little while to warm up - and at least on mine - I get yaw drift for a few minutes during this phase - after that - it gets more reliable.
In opentrack set :
Tracker: FreePIE UDP receiver
Protocol freetrack2.0 enhanced
Make sure you set a "center" key in the options (with the drift - you'll need it) - then "start".
Depending on how you place the sensor - you might need to adjust the pitch/roll/yaw options (On mine - I needed to invert pitch and roll).
Then start your game (I'm playing with Elite Dangerous) and move your head
[ Uploaded with a .txt extension - it should obviously be .ino - but the forums block that extension ]