-->
Page 1 of 1

Opentrack/head tracking for games using MPU6050 & ESP-01

PostPosted: Sun Feb 14, 2016 3:45 am
by zz9pa
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 ]

Re: Opentrack/head tracking for games using MPU6050 & ESP-01

PostPosted: Sun Jan 08, 2017 8:21 pm
by OndrejB
Hello,

thanks for this sketch, I am thinking of the same thing, but with MPU-9250 with integrated compass, so it should be drift free.

Actually my Wemos D1 Mini should arrive in 1 or 2 days, so I will start experimenting (I am absolute beginner, but I hope I will sort it out. :D)

Re: Opentrack/head tracking for games using MPU6050 & ESP-01

PostPosted: Sat Oct 14, 2017 9:36 am
by unmateria
Hi nobugz :) Don't know in MPU6050 but in MPU9250 just use D7 pin in wemos D1 mini for interrupt (there are some pins that you shouldnt use for interrupts in D1 mini) and solder a 10k resistor to ground for that pin.

Re: Opentrack/head tracking for games using MPU6050 & ESP-01

PostPosted: Sat Oct 14, 2017 11:45 am
by rudy
I am thinking of the same thing, but with MPU-9250 with integrated compass, so it should be drift free.

They all will drift no matter how good a sensor. There needs to be a real reference in order to get rid of drift. Optical is the most common.