It is currently Sun May 19, 2013 2:22 am



Reply to topic  [ 93 posts ]  Go to page 1, 2, 3  Next
 [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod, 
Author Message
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
CyberVillain, I'm going to move the discussion onto this thread to increase visibility.
Previous thread: http://www.mtbs3d.com/phpBB/viewtopic.php?f=26&t=14167&start=0

CyberVillain wrote:
Strange company, if it was my company I would have recalled the cables... I will ask mars3554 in his thread about this... If you look at mars youtube clip you can see that the 2 pin header at the front is not connected


Yeah but at least those guys are "straight-shooters". They disclose everything about their components (warts and all) so you know exactly what to expect.

The more I think about it, I'm pretty sure the 3.3V pin on the Sparkfun is an (optional) unregulated power supply pin to run the sensors and CPU. But you can also power the device through the regulated power connector (3 AA batteries would be sufficient). It's just unfortunate that the cable power can't be used because it does simplify the setup. However if you're thinking about going BlueTooth, you're going to need a battey pack anyways.


Thu Jan 05, 2012 9:14 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
If you look at Mars youtube clip you it looks like a straight connection from the USB to the IMU, but we need his answer to be certain.. Mars where are youuu :D

I want to hook mine up tonight :D


Thu Jan 05, 2012 10:07 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
I have a thread going on the sparkfun forum, nothing concrete yet though. I reallly hope mars reads this soon and can shed some light over it.. he doesnt mentioned anything about powering the chip in this thread so i guess i just let the pin on the cable do it, but i want confirmation before i hook up a expensive chip like this

http://forum.sparkfun.com/viewtopic.php ... 33#p137833


Thu Jan 05, 2012 11:05 am
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
I think you can safely just connect TX, RX, and GND pins and then supply power to the regulated power connector via a 3 AA battery pack from Radio Shack . A temporary solution until you integrate the BlueTooth


Thu Jan 05, 2012 12:22 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
who, me? Im not going for a wireless solution (Your thinking about the guy who is doing a VR gun).. So I would rather use the cable only if possible, but I do not like risking the IMU just to test.. I hope Mars will see this anytime soon. OH well, going to the movies with my girl now so do time for playing anyway.. Hope i have an answer tomorrow so i can start playing


Thu Jan 05, 2012 12:57 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
Got an answer from Sparkfun

Quote:
The I/O on that cable is 3.3V, but the VCC pin is 5V. The microcontroller on the board can handle 5V just fine, but I don't think the sensors can. If you connect this directly to the FTDI port on the board you will most likely fry one or more of the sensors. If you plug the power into the connectors behind the JST connector (or the JST connector itself) you should be fine since this signal is regulated. Let me know if you have any other questions.


Why would i care if the internal voltage is 3.3 volt when they output 5 :D Anyway, I guess I can remove the 5V pin from the header and route that 5v to the JST pin which as a volt regulator

edit: But what i want is that SParkfun or my Swedish distributor supply me with a correct cable


Fri Jan 06, 2012 6:16 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
when i connect the usb cable to the computer i get no reaction at all, and i get no voltage off the vcc pin, probably a faulty cable :/


Sat Jan 07, 2012 10:39 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
Can a moderator change the first post in this thread and remove the link to the USB cable and add a link to this product

http://www.sparkfun.com/products/9873

The USB cable will fry the sensors on the board...


Mon Jan 09, 2012 7:57 am
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
CyberVillain wrote:
Can a moderator change the first post in this thread and remove the link to the USB cable and add a link to this product

http://www.sparkfun.com/products/9873

The USB cable will fry the sensors on the board...



Oh crap did you fry your Sparkfun? Does that cable not downconvert from serial to TTL voltages?


Mon Jan 09, 2012 8:58 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
brantlew wrote:
CyberVillain wrote:
Can a moderator change the first post in this thread and remove the link to the USB cable and add a link to this product

http://www.sparkfun.com/products/9873

The USB cable will fry the sensors on the board...



Oh crap did you fry your Sparkfun? Does that cable not downconvert from serial to TTL voltages?


No, no.. I just dont wont anyone else yo fry theirs, if they only read the first post and go try it they will :D
I'm waiting on a replacement cable because mine was broken.. I hope to get it tomorrow


Mon Jan 09, 2012 3:29 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10022
Ok, no prob. Made the edit.

_________________
Image


Mon Jan 09, 2012 9:15 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
thanks CR


Tue Jan 10, 2012 1:58 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
it is all hooked up now, but I got problems

I have downloaded this copy of the FreeIMU library

http://www.varesano.net/files/libraries_20111205_2110.zip

And i've included all the libs that the compiler complains about. Now my sketch file looks like this

Code:
#include <ITG3200.h>

#include <MS561101BA.h>

#include <HMC58X3.h>

#include <bma180.h>

#include <Wire.h>

#include <CommunicationUtils.h>
#include <FreeIMU.h>


Get this compiler error
Quote:
C:\Program Files (x86)\arduino-1.0\libraries\MS561101BA\MS561101BA.cpp: In member function 'long unsigned int MS561101BA::getConversion(uint8_t)':
C:\Program Files (x86)\arduino-1.0\libraries\MS561101BA\MS561101BA.cpp:144: error: call of overloaded 'write(int)' is ambiguous
C:\Program Files (x86)\arduino-1.0\libraries\Wire/Wire.h:55: note: candidates are: virtual size_t TwoWire::write(uint8_t)
C:\Program Files (x86)\arduino-1.0\hardware\arduino\cores\arduino/Print.h:49: note: size_t Print::write(const char*)


Looks like there are two write methods and it does not know which one to use.... Whats wrong?

Thanks..

If you wanna try you can download the Arduino IDE, install the freeimu library and compile (You do not need the board to do this)


Wed Jan 11, 2012 12:18 pm
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
Didn't download code, but I suspect a #define variable would probably clear it up, but you might have to dig around to find it. You might look at the definition of uint8_t for starters.

Another more direct method would be to just modify to source code to directly cast that variable or the object that's calling it.

Code:
// cast the parameter to clear the ambiguity
object->write((uint8_t)var);

// or cast the object to force the correct method call
((TwoWire*)object)->write(var);


If that's the only ambiguous occurrence then you're golden - but don't be surprised if there are dozens in which case you might have to search for #define(s)

Hope that helps.


Wed Jan 11, 2012 1:00 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
Fixed it! I am now receving data :D

Will write a quick C# test consoleprogram.. give me an hour and I have a youtube video up :D


Wed Jan 11, 2012 1:10 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden


Wed Jan 11, 2012 3:18 pm
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
Looks great! Can't wait to get my hands on one of these. Maybe you are seeing tracker noise and just need to put a smoothing filter on it. Is it bridged through GlovePie or another interface?

Also when you get a chance can you look to see if the spatial translation (X, Y, Z) tracking works at all or does it look like garbage?


Wed Jan 11, 2012 3:32 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
Its a problem with my Freetrack emulation, if i send a static float on all 3 axis i still get jumpy behaviur.. Strange thing is when I include the freetrackclient.dll in a testproject it looks good, and Arma2 uses the same dll to read freetrack data so I do not know where they read the wrong data from :/

Hmm, theres only 3DOF? I cant get translation values of this one can I?


Wed Jan 11, 2012 4:10 pm
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
It should have the sensors on-board to estimate translation. Maybe FreeIMU only supports orientation. Bummer.


Wed Jan 11, 2012 4:22 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
I do not think freeemu supports it oit of the box.. maybe you can take the data from the 9 sensors and do the math yourself?


Wed Jan 11, 2012 4:41 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
There is some huge drift, I do not know if its my copy or if all suffer from it :/


Wed Jan 11, 2012 5:24 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10022
Not bad for a first test.

You can try putting a sort-of low-pass filter on the readings. I did that for the Vuzix tracker I made. Basically set a maximum delta value with something reasonable and then ignore anything over this amount. It should be the fastest you could expect a user to move during one frame (could be around 10-20 degrees). I found this to pretty much eliminate those kinds of random jitters.

_________________
Image


Wed Jan 11, 2012 10:33 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
YEah, I have a low pass filter... Its something else, maybe its the float precision or something, Arma2 maybe want a lower precision or something. If i use the real freetrack server everything works, but if I use my freetrack server emulator it does not work.. If I send hard coded values with low number of decimals it works, like 0.1, if i send 0.00001 or something like that I get the stutter.. So its not related to the sensordata, its something in my way of simulating Freetrack...


Thu Jan 12, 2012 1:56 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
I've also written a little freetrackclient test program that uses the standard freetrackclient.dll (same as Arma2) and that works. So its a combination of some code in Arma2 and C# floats thats strange.. I think :P


Thu Jan 12, 2012 2:25 am
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
Any possibility its a byte ordering issue? I've stumbled across weird crap like this a lot working in Java where the byte ordering is enforced as little-endian as opposed to x86 native. Had same problem with OSC and GlovePie.


Thu Jan 12, 2012 9:16 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
Hmm, dont think so, if that was the case it the result would have been total screwed up :D
Will test more without the sparkfun, maybe send a nice Sinus curve


Thu Jan 12, 2012 9:19 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
This gets more and more sick.. If i send it a cos curve it works, from a seperate program..

But if i do the same thing from my sparktest program it jitters (I do not even send anything from the sparkfun), all it takes is that i have the SerialCom class initliezed and listeing on the com port and it scews up arma?!?!

One more thing that is strange, I tried to record the jitter with fraps, but when I start fraps the jitter goes away :P

Wtf?! Solutions please :D

edit: I was wrong there, i can have teh com class inited, but if I read from teh com port in the main loop where I send to Arma it screws starts to jitter

If i uncomment these two lines the cos-curve looks nice in arma
Code:
                            var text = serialPort.ReadLine();
                            var values = text.Split(',');


If i uncomment them arma starts to jitter (Even if i do not use the values in the values array)


Thu Jan 12, 2012 11:04 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
Lol.. if i hadnt written my little test program and gone and written the real program I wouldnt have had the problem..
In my test program I read from com and sent to freetrack in same loop / thread.

In the real program I would have had an Input class with a background thread and firing an update event when something new is on the com.. It turns out that putting the com reading in a own thread solves the problem!



Thu Jan 12, 2012 11:12 am
Profile
Certif-Eyed!

Joined: Tue Jan 19, 2010 6:38 pm
Posts: 500
Looks great. You could use a freetrack type thing to center the view when looking straight ahead, to compensate for that little bit of drift.

_________________
"If you have a diabolical mind, the first thing that probably came to mind is that it will make an excellent trap: how do you get off a functional omni-directional treadmill?"


Thu Jan 12, 2012 1:04 pm
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
Coming along nicely :)

Hopefully you will be able to characterize the drift a bit in the future. (which axis is most problematic, which types of motion are problematic, how many degrees per minute on average during gameplay, etc..)

Once you get the GlovePie integration in there, this could be the tracker of choice for nearly everyone here (as long as they don't mind a little soldering). I would be interested to see someone take a crack at a simple DIY design for an enclosure - a cabled design as well as a battery powered bluetooth integrated module.

I'll probably be getting one of these pretty soon to play with. CyberVillain If you can't find an easy way to get X,Y,Z position information from that API, I might take a crack at it.


Thu Jan 12, 2012 1:30 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
I will probably focus on getting a C# program for it up and running first.. Algebra was never my thing anyway :D
Its the Yaw that has the drift, I havent had the time to play with it so much that I can really decide if its a problem or not.. will have to try to fix a way of mounting it on my headset so i can actually dry and game with it


Thu Jan 12, 2012 1:37 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10022
Great work, its looking really nice so far.

_________________
Image


Thu Jan 12, 2012 7:26 pm
Profile
Certif-Eyable!

Joined: Fri Jul 08, 2011 11:47 pm
Posts: 1165
Isn't eliminating the yaw drift the entire point of these '9DOF' sensors?

I thought that was what the compass component was for.


Thu Jan 12, 2012 8:29 pm
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
WiredEarp wrote:
Isn't eliminating the yaw drift the entire point of these '9DOF' sensors?

I thought that was what the compass component was for.


You know I sort of have the same question. There's no doubt that these magnetic sensors hold their calibration much better but can anyone explain to me in simple terms why they can't maintain a constant and stable calibration using the earths magnetic north? I mean I can open a box of Cracker Jack and find a sensor that keeps a better yaw heading than these IMU's. Someone please enlighten us. :)


Thu Jan 12, 2012 8:34 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
The FreeIMU is not written for the exakt same sensors has in the Sparkfun 9DOF. I've talked to the guy behind FreeIMU library and he's promised to add full support to Sparkfun IMU in upcoming version, it's very likely that the drift issue will be solved with that...

edit: I do not have the exact detail but it could be that FreeIMU does not utilize all of the IMU's sensors...


Fri Jan 13, 2012 2:07 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
I tested the IMU using the test libs that comes with FreeIMU, it looks bad



I move the device two times during the video, look at the drift


Fri Jan 13, 2012 11:45 am
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
I downloaded the AHRS software to the IMU instead, it looks like it has more calibration options.. Its up and running and are sening data to my c# program, but I have to look into the calibration stuff tomorrow

https://dev.qu.tu-berlin.de/projects/sf ... he-tracker


Fri Jan 13, 2012 7:51 pm
Profile
3D Angel Eyes (Moderator)
User avatar

Joined: Sat Apr 12, 2008 8:18 pm
Posts: 10022
Hmm... I wonder if there is enough data to compensate.

_________________
Image


Fri Jan 13, 2012 9:20 pm
Profile
Petrif-Eyed
User avatar

Joined: Sat Sep 17, 2011 9:23 pm
Posts: 2035
Location: Irvine, CA
CyberVillain wrote:
I downloaded the AHRS software to the IMU instead, it looks like it has more calibration options.


What an excellent little walk-through!


Fri Jan 13, 2012 10:47 pm
Profile
Terrif-eying the Ladies!

Joined: Mon Jun 22, 2009 8:36 am
Posts: 933
Location: Stockholm, Sweden
I did some calibrating yesterday, i dont have a compass so I could only calibrate the accelerometer and the gyro (To calibrate the magnetometer you need to know exactly were north is pointing)... But it didnt help much, still drifting like crazy on the Yaw, I guess i cant rule anything out until I have calibrated the magn. But has i understand it there is always some drift on the magn and thats why the software on the IMU should use the other two sensors to compensate for that, so i do not have my hope up that it will get much better after I've calibratet the magn.


Mon Jan 16, 2012 1:40 am
Profile
Display posts from previous:  Sort by  
Reply to topic   [ 93 posts ]  Go to page 1, 2, 3  Next

Who is online

Users browsing this forum: No registered users and 2 guests


You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot post attachments in this forum

Jump to:  
Powered by phpBB® Forum Software © phpBB Group
Designed by STSoftware.