Headtracker built with a Teensy 2.0 and an Adafruit 9-DOF IMU Breakout
Based on work from WebKris & Michael Baker
Not a member? You should
Already have an account?
To make the experience fit your profile, pick a username and tell us what interests you.
based on your interests.
Choose more interests.
Then, add thoses library to IDE :
Load one of the following code :
View all 6 instructions
Create an account to leave a comment.
Already have an account?
I finally built and got it working. Am able to visualized the data. Similar with the link https://www.pololu.com/product/2468#lightbox-picture0J3722.
I used Teensy2.0 and Pololu miniIMU-9 v3 and utilize the following sketch(program) MiniIMU9AHSR/or Pololu_Open_IMU. (included calibrate)
My only problem is that I couldn't get OpenTrack to recognize the data. I have tried to set it,
as a USB type, Serial, Keyboard+Mouse+Joystick and Serial Keyboard+Mouse+Joystick. Could this be the Teensy2.0 issue?
Are you sure? yes | no
I have another use for the tracker, navigation gear for simulator program. The visual device is on a gimbal and view needs to change as you move the device. Very much the same, just not a "head tracker". My program requires the clicking of a button to activate the joystick. I see the Joystick.button Action from the sub joystick example, but being New to this... I am not sure where to insert it to avoid creating a proble. Are there digital pins to stay away from? Wher in the sketch should the button lines Be safely added?
We built one without buttons and as soon as we removed the screws in the case and pointed toward north, calibration was much More fluid. Once the Joystick has buttons we can test.
Thanks for any advice
Update - ok I took a couple stabs at it and now have the buttons added to the breadboard version. Hopefully will be able to add them to our prototype and test on Monday
Hmm... I tried to upload to Git hub, but I'm not going to make changes to your existing.Grab code from here:http://planetkris.com/headtracker/
Ok, it is the original code from your blog (minus some changes on fscale parameters). I thought it was something else.
Exactly. Give Opentrack a shot!
I’ve added the configuration to the github project : https://github.com/paulgreg/headtracking-from-kris/blob/master/opentrack/elite.dangerous.ini (and I’ve added you as contributor too)
Hello @webkris ! Thanks a lot for those advice.
I’ll try to calibrate the breakout as you say then give a try to OpenTrack.
Just a question, when you say "I uploaded my code (for use with opentrack)", where did you upload it ? :-)
Okay - I had a lot more success tuning this when I dropped all the smoothing off of the Teensy - and moved to using https://github.com/opentrack/opentrackThis allowed me to set up my preferences in Opentrack while the game was running, and you basically leave the teensy to report 1:1 movement in space. I found this much more accurate. I uploaded my code (for use with opentrack) and the opentrack.ini to get you started.
"Just mapped the joystick 1:1.
Once your head tracker loads this code it will do all of the graphing and transformation on Opentrack. Or work like a REALLY SLOW joystick. :p
The Roll and Yaw axis are switched, and all of the inputs are inverted.Load the ini into Opentrack 2.2-stable /install/settings
Plug in tracker.Open the code with arduino and upload.Give it 10 seconds to reset.
Start Opentracker - load settings - hit start and try it out!Then you can get crazy with all your curves and filtering.
Open Elite - make sure to UNBIND the head look from the Joystick (original config).It'll be a totally blank config for "Headlook Mode" under elite.
Start a trainer and check it all out.You can tweak the settings while the game is running!"
Give it a shot!
Hello from PlanetKris :)Saw your comments about the headtracker and would be delighted to continue the conversation here. First off - let me start by saying - I only wish I wrote any of the code. This the the work of Michael Baker (the Pololu_Open_IMU using the Madgwick algorithm).
Originally I had tried to use the Adafruit library, but unfortunately, they took the calibration program out of their examples and code and their customer service was like "Techniques for solving the problem do exist, but they're proprietary and valuable to the companies that have them." - even small magnets are powerful to this device... blah blah bla: https://forums.adafruit.com/viewtopic.php?f=25&t=63672But the answer is this: Every single one of these chips needs to be calibrated to run with your program. I built 3 of these and ALL 3 needed manual direct calibration. So, how do we do that?Clear your desk off, connect your head tracker with a nice long USB, and load the Calibrate program from the LSM303 1.4.4 Library:Open Serial MonitorRotate your IMU slowly 360 degrees in the X, Y, and Z axis.I usually start flat on the table and rotate 360 - going slow about 10 seconds.Then without jarring (NO high G load) I slowly pick up the IMU and rotate Left to Right 360.Then Front to Back... You are trying to get the device to "see" magnetic north in every orientation.
You'll notice the MIN / MAX on the serial output will begin to settle out.Copy pasta those numbers to the top of the code:
#define compassXMin -###.0f#define compassYMin -###.0f#define compassZMin -###.0f#define compassXMax ###.0f#define compassYMax ###.0f#define compassZMax ###.0f
You're right, after a slow calibration process, results are much better ! I’ve updated steps to reflect that.
Become a member to follow this project and never miss any updates
© 2020 Hackaday
Yes, delete it
You are about to report the project "Elite Dangerous Headtracker", please tell us the reason.
Your application has been submitted.
Are you sure you want to remove yourself as
a member for this project?
Project owner will be notified upon removal.