[Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Talk about Head Mounted Displays (HMDs), augmented reality, wearable computing, controller hardware, haptic feedback, motion tracking, and related topics here!
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by CyberVillain »

Dont think it will compile for the Sparkfun IMU, different sensors :/
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by CyberVillain »

Looks like it should be able to compile for the ADX345 Acc, but im a noob on C and Arduino, someone wanna give it a shot?
User avatar
BadKarma
One Eyed Hopeful
Posts: 17
Joined: Thu Feb 02, 2012 5:19 am
Location: The Netherlands
Contact:

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by BadKarma »

Hey CyberVillain, any update on this? :) Curious if you made any progress to eliminate that drift problem of yours... Also, are you using GlovePIE or FreePIE? I found this on pastebin through your YouTube channel:

Code: Select all

    var.freelookKey = Mouse.RightButton || Keyboard.RightAlt
    var.enableKey = Keyboard.Z
     
    var.sensitivity = 25
     
    var.yaw = RemoveUnits(TrackIR.Yaw)*var.Sensitivity
    var.pitch = RemoveUnits(TrackIr.Pitch)*var.Sensitivity
     
    if(Pressed(var.enableKey)) {
    var.enabled = !var.enabled
    }
     
    if(var.freelookKey && var.enabled) {
    var.mx+=delta(var.yaw)
    var.my+=delta(var.pitch)
     
    fakemouse.DirectInputX = var.mx
    fakemouse.DirectInputY = var.my
    }
This is for GlovePIE right? But (bare with me, I've only been reading up on this all since last night) can be used in FreePIE? Going to test it after dinner and see if I can hook this up with UDK (Unreal Development Kit). I'm using a Bluetooth module to send all values from the Razor, but so far in FreePIE i'm getting good results.

Also found this video of a guy using a FreeIMU with Gary's Mod and there's no drift at all. Might be worth checking out how the Source engine (or Gary's Mod itself) handles all the input! I know it's not a Razor IMU, but still, might shed some light..
Videolink: http://www.youtube.com/watch?v=vVrflj30 ... 1337100842
Imagination is more powerful than knowledge..
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by CyberVillain »

Thats GlovePIE code, havent bothered to upload the FreePIE code to youtube, FreePIE is still so small. But yes, I have this running with FreePIE too, nice that FreePIE is working nicly for you.

FreePIE equivalent of above GlovePIE code (Freetrack plugin used but can be switched to the other ones)

Code: Select all

if(starting) then
enabled = false
multiply = 20
	freeTrack.Update:Add(function()
		yaw = math.deg(freeTrack:getYaw())
		roll = math.deg(freeTrack:getRoll())
		pitch = math.deg(freeTrack:getPitch())
		
		deltaYaw = filters:delta(yaw)
		deltaPitch = filters:delta(pitch)	
		
		if(enabled and hotkey) then
			mouse:setDeltaX(deltaYaw*multiply)
			mouse:setDeltaY(-deltaPitch*multiply)
		end
	end)
end

hotkey = mouse:getRightButton()
toggle = keyboard:getPressed(Key.Z)
if(toggle) then
	enabled = not enabled
end
I dont know if its my Sparkfun IMU or if I live in a magnetic field of some kind, but I cant get it to work :/
Nope didnt get that code to work property, this is as far as I got

[youtube-hd]http://www.youtube.com/watch?v=2BxxYVEs7rw[/youtube-hd]


Yeah I know about that guy, it was him taht got me on the Sparkfun track.. Hes not using any filters other than the fusion in the FreeIMU lib
User avatar
BadKarma
One Eyed Hopeful
Posts: 17
Joined: Thu Feb 02, 2012 5:19 am
Location: The Netherlands
Contact:

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by BadKarma »

Thanks a lot CyberVillain! You made my day by sharing that with me ;)

1. So far I got it working (got rid of the hotkey and use only the toggle function) and quick tested it in Crysis 2. Seems your multiplier was set pretty high, but I'm sure it's all game related?

2. And oh, just to let you know I'm having the same drift issues you've been having so it's definitely not your IMU. Haven't calibrated it yet with the AHRS so going to do that as well before trying again.

3. I've used a USB cable this time to get it to work, since my Bluetooth module outputs in binary mode by default apparently. Need to change that into text output, burn it again and test it WITH the Bluetooth module. Going to do so this afternoon and post any results here.

And now for another FreePIE question: How can I send serial commands? I know GlovePIE uses "Serialout(COM12, "COMMANDHERE")" and I did a quick search for a LUA equivalent. Or am I going at it from a totally wrong angle? Would like to know how to do this because I can make my Razor IMU output text format with a command (#ot) as you probably know. This way I won't have to rewrite the Arduino code and it gives me the possibility to synch with it so I won't run into any reset problems.

Any input is much appreciated guys!
Imagination is more powerful than knowledge..
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by CyberVillain »

Hi Mate, I moved the discussion to the FreePIE forum

http://www.mtbs3d.com/phpBB/viewtopic.p ... 388#p73388
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

i would really like to keep this discussion going, mars s video just looks so neat!
mars, i would really appreciate if you could talk (or even share some code? ;) about the gmod changes..
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

hello all !

it took me a while ( cause i never did anything like this before, neither programming ), but i succeeded..
thanks to the code of mars (and some tweeks) and the freeimu documentation .. and and ... i finally got it working!

im using free imu and a arduino mini, free imu library and gmod as well..

[youtube]http://www.youtube.com/watch?v=JTJ_bg2By5Y[/youtube]

so thanks to you guys and your forum.. just for beeing here and giving information!

cheers
numu
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by brantlew »

good work. congrats on learning a new skill as well.
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by cybereality »

@numu: Wow man! That's really impressive if that's your first foray into programming.
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

cybereality wrote:@numu: Wow man! That's really impressive if that's your first foray into programming.
i try d to learn as3 .. but didnt really finish anything with it, but i know what a method is :)
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

here a small update :)

[youtube]http://www.youtube.com/watch?v=Bp2Figk5GAo[/youtube]
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by cybereality »

Cool.
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

hey guyz n girlz

i thought i d hook you up with a small progress :)

hoping to achieve a successful fieldtest next week

[youtube-hd]http://www.youtube.com/watch?v=HKqmPWXjYeQ[/youtube-hd]

what you see here is the working movement per X/Y coords from the camera
the imu angles, but that worked before as well..
and the possibility in gmod to port from one room to another and backwards, adding the changed coords to the camera XY.

now its possible to see more then one room eventhough the real room didnt change,.. (what is the core of my theaterplay idea that i m trying to realize ;)

thanks for watching
numu
User avatar
cybereality
3D Angel Eyes (Moderator)
Posts: 11407
Joined: Sat Apr 12, 2008 8:18 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by cybereality »

Nice.
User avatar
brantlew
Petrif-Eyed
Posts: 2221
Joined: Sat Sep 17, 2011 9:23 pm
Location: Menlo Park, CA

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by brantlew »

Cool, what camera is that?
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

brantlew wrote:Cool, what camera is that?
a ps3eye cost like 12 euros (15 dollars ~)

its cool because it makes 60 fps
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

brantlew wrote:Cool, what camera is that?

or you mean the camera i recorded the clip with? thats a go pro 920
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

hey guys!
so after a reaaalllyy long time, its finally finished!

http://www.youtube.com/watch?v=3aWQur76i2A

thanks for the input, the first steps i could start off the project with : )

used : ps3eye for movement
a freeimu for headtracking
and gmod is the game


thanks
numu
zalo
Certif-Eyed!
Posts: 661
Joined: Sun Mar 25, 2012 12:33 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by zalo »

I love the evolution of the marker.

Hm, it's not big enough or bright enough to work at long distances...
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

zalo wrote:I love the evolution of the marker.

Hm, it's not big enough or bright enough to work at long distances...
accually that marker (as it is) is not necessary anymore, it would work better if the whole helmet would glow (easy to do with led strips)
and when the whole helmet glows i think you could use it as well for long distance projects.

cause i only take the XY coords from the person inside the room, the orientation is now done simply with the free imu.
zalo
Certif-Eyed!
Posts: 661
Joined: Sun Mar 25, 2012 12:33 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by zalo »

Have you considered EL Panels?
Image
Since they have a lot of area, I'm assuming they'd be easy to track using blob tracking of some sort.

Or you could just stick an LED in a ping pong ball and do it PSMove style
http://www.youtube.com/watch?v=z0Zx6n_Ls98
numu
One Eyed Hopeful
Posts: 15
Joined: Mon May 21, 2012 5:00 pm

Re: [Video] Diy HeadTracking - Sparkfun Razor, Python, Gmod,

Post by numu »

ah! no i have never heard or EL panels, but that looks cool!

accually, as i said, i screwed it up with the marker, the calibration of the imu didnt work out back then (a year ago or so) so i thought i would need to merge the data with the orientation data of the camera, eg fiducial..

thanks for the el panels tip! :)
Post Reply

Return to “General VR/AR Discussion”