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
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/opentrack This 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!"
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=63672
But 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 Monitor Rotate 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:
Hi Folks,
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?