It is currently Thu Jul 20, 2017 10:28 pm



 [ 82 posts ]  Go to page 1, 2, 3  Next
 Zeiss headtracker input/trackIR output? 
Author Message
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
I've recently purchased the Zeiss Cinemizer OLED & Headtracker. The headtracker works well imitating a mouse but the game I mostly play (Rise of Flight) has a nasty habit of recentering the mouse in the wrong place when changing the FOV (something you do a lot). This does not happen with trackIR (or FacetrackNoIR in my case) and apears t be something built into the games mouselook implementation.

As the zeiss headtracker appears to the system as a mouse, is it possible to pass the headtracker mouse input through the games inbuilt trackir interface using FreePIE?


Tue May 14, 2013 4:08 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Mars wrote:
I've recently purchased the Zeiss Cinemizer OLED & Headtracker. The headtracker works well imitating a mouse but the game I mostly play (Rise of Flight) has a nasty habit of recentering the mouse in the wrong place when changing the FOV (something you do a lot). This does not happen with trackIR (or FacetrackNoIR in my case) and apears t be something built into the games mouselook implementation.

As the zeiss headtracker appears to the system as a mouse, is it possible to pass the headtracker mouse input through the games inbuilt trackir interface using FreePIE?


FreePIE does not support Zeiss Cinimizer, what outputs other than mouse does it have?

_________________
FreePIE
My blog


Wed May 15, 2013 1:33 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Sorry it getting was late when I posted.

The headtracker operates as a standard mouse (albeit with roll). What i'm trying to do is to trick the game into thinking i'm using TIR by sending the headtracker mouse input through FreePIE i.e.

headtracker mouse --> freepie --> game sees input as TIR input and not mouse input

FreePIE does see the headtracker as mouse input but I don't seem able to output it as TIR input.


Wed May 15, 2013 12:15 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Mars wrote:
Sorry it getting was late when I posted.

The headtracker operates as a standard mouse (albeit with roll). What i'm trying to do is to trick the game into thinking i'm using TIR by sending the headtracker mouse input through FreePIE i.e.

headtracker mouse --> freepie --> game sees input as TIR input and not mouse input

FreePIE does see the headtracker as mouse input but I don't seem able to output it as TIR input.


What game is it? Some games need the TrackIR fixer to work

http://naturalpointofview.blogspot.se/p ... fixer.html

Are there no other outputs than mouse emulation from that tracker driver? Sounds shitty to me

_________________
FreePIE
My blog


Wed May 15, 2013 4:34 pm
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Theres an SDK apparently which you have to register for - the mouse emulation works well its just the game's (rise of flight) implementation of mouselook thats shitty; changing FOV centres the mouse on where you happen to be looking at the time.

The tracker is very impressive - no discernable latency. Your head is the limiting factor ;-). I've seen more latency using TIR or Facetracknoir.


Wed May 15, 2013 4:59 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Mars wrote:
Theres an SDK apparently which you have to register for - the mouse emulation works well its just the game's (rise of flight) implementation of mouselook thats shitty; changing FOV centres the mouse on where you happen to be looking at the time.

The tracker is very impressive - no discernable latency. Your head is the limiting factor ;-). I've seen more latency using TIR or Facetracknoir.


The problem is that FreePIE wont stop the mouse from bubble its data to the game so you will receive both mouse and TIR data.
Is the SDK free? I can look at it if you register and download it for me.

_________________
FreePIE
My blog


Thu May 16, 2013 6:27 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Fortunately ROF disables mouse look when TIR is detected so that should not be an issue (I hope).

I've registered for teh SDK but I'm waiting for a response.

Ideally I'd like to get to a point where I can use the headtracker with FaceTrackNoIR with a PS3 eye to provide 6DOF. I think that a plugin for FTNIR (which supports primary/secondary input soucres) would be required and for that I need the sdk.


Thu May 16, 2013 11:15 am
One Eyed Hopeful

Joined: Tue Aug 14, 2012 3:10 am
Posts: 13
Location: Karlsruhe Germany
Hey,

I'm one of the developers of the cinemizer Headtracker. Should you have any more questions feel free to contact me.
Have you received the SDK? The second HID-Interface of the Tracker offers raw Quaternion output.


Tue May 21, 2013 9:06 am
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
@InrealMike Hi Mike, thanks for showing interest in FreePIE. Are you having a dialog with Mars?
Let me know if the FreePIE team can assist you, we very much want support for your products...

_________________
FreePIE
My blog


Tue May 21, 2013 10:46 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Hi,

No I haven't received the SDK but I may have been a bit thick and not checked the box that says 'yes I want the SDK'. Second registration e-mail sent!

Regards

Mars


Tue May 21, 2013 11:25 am
One Eyed Hopeful

Joined: Wed Nov 02, 2011 4:17 am
Posts: 9
Hey


Last edited by greenlantern on Wed May 22, 2013 12:29 am, edited 1 time in total.



Tue May 21, 2013 12:21 pm
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Blimey, thats service for you!


Tue May 21, 2013 2:47 pm
One Eyed Hopeful

Joined: Tue Aug 14, 2012 3:10 am
Posts: 13
Location: Karlsruhe Germany
I just send you the SDK and a link to the Tray-Icon tool


Wed May 22, 2013 12:31 am
One Eyed Hopeful

Joined: Tue Aug 14, 2012 3:10 am
Posts: 13
Location: Karlsruhe Germany
@CyberVillain:

I will gladly send you the SDK as well and can assist you to integrate it in FreePie.
The Tracker delivers absolute Quaternions, through an HID-Device at 200Hz.
It should be fairly easy to integrate this into FreePie.
Just send me a PN with your email and I will send you the SDK.


Wed May 22, 2013 1:24 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
SDK email received (I was already using the headtracking applet).

Now, I just need the time to do something with it!


Wed May 22, 2013 11:59 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Finally had time to have brief look at the SDK and I see that there is a C-compatible dll.

Am I right in thinking that this could be called by FreePIE as an external plugin without too much difficulty? Willing to have a crack but I haven't touched .Net/C# for nearly 10 years...

@Cybervillain: did Inreal send you the sdk?


Fri May 31, 2013 2:05 pm
One Eyed Hopeful

Joined: Tue Aug 14, 2012 3:10 am
Posts: 13
Location: Karlsruhe Germany
Hey Mars

Yes that's how it should be done. I suspect it to be fairly easy to integrate it into FreePie. Especially since it already has support for other IMUs. So instead of grabbing the tracker data through the COM port it can access it via the dll which handels all the USB communication and delivers the precalculated quaternions.

I did send the SDK to Cybervillan.


Fri May 31, 2013 2:19 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Sorry ive been super busy with other projects. I havent looked and it will take me some time todo it, but i can give you some pointers. First create a branch on github, do not work directly in the master branch.

If the sdk is C then you can use DllImport to import the fnctions you need. You can look in the Yei 3 branch how to use dllimport
https://github.com/AndersMalmgren/FreeP ... ace/Api.cs

edit: I can create a branch for you with a embryo that you can work on. Give me an hour or so

_________________
FreePIE
My blog


Sat Jun 01, 2013 4:55 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
If you can create the embryo that will give me a start. Now, to try and find my brain!


Sat Jun 01, 2013 5:25 am
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Is freeglut.dll required by tracker.dll?

_________________
FreePIE
My blog


Sat Jun 01, 2013 5:28 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
From my reading of the SDK docs I think that is just used in the example c# gui .exe that gives a visualisation of the tracker movement.


Sat Jun 01, 2013 5:53 am
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
I couldnt test it more than I get a device not found..

https://github.com/AndersMalmgren/FreePIE/tree/Zeiss

_________________
FreePIE
My blog


Sat Jun 01, 2013 6:12 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Its working!

After 3 hours of thinking wtf I just needed to comment out the bits that were calling setbootloader mode. The headtracker is not in bootloader mode for normal use so the dll was unable to find it when called and thus gave an error. Now I can see data being returned in the watch window!


Sat Jun 01, 2013 10:06 am
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Nice i just copied that stuff from the example.
Should I just remove that part all together or send in true?

_________________
FreePIE
My blog


Sat Jun 01, 2013 10:23 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Your chocie I think, the bits I commented out are as follows:

api.cs:
Code:
 /*public static bool SetBootloaderMode(bool activationMode, out int error)
        {
            var result = Tracker_SetBootloaderMode(false);
            error = GetLastError();

            return result;
        }*/


ZeissPlugin.cs:
Code:
/*result = Api.SetBootloaderMode(false, out error);
            if (!result)
            {
                throw new Exception(string.Format("Error while setting bootloader mode: {0}", Api.GetError(error)));
            }*/


Just tried ROF using the following script:
Code:
def update():
#Zeiss2TrackIR output
 trackIR.yaw = zeiss.Yaw
 trackIR.pitch = zeiss.Pitch
 trackIR.roll = zeiss.Roll
 
 diagnostics.watch(zeiss.Yaw);
 diagnostics.watch(zeiss.Pitch);
 diagnostics.watch(zeiss.Roll);
 
if starting:
 zeiss.update += update


Pitch & Roll do nothing but I get movement (a twitch is the best I can describe it) with roll. I don't think whatever units are currently being passed to ROF via FreePIE, ROF's TIR interface understands. perhaps I need one of the other outputs of the API?


Last edited by Mars on Sat Jun 01, 2013 10:42 am, edited 1 time in total.



Sat Jun 01, 2013 10:38 am
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
trackIR uses deegrees while zeiss uses radians

convert using math.degrees in script

_________________
FreePIE
My blog


Sat Jun 01, 2013 10:40 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
zeiss using radians and TIR using degrees was only part of the problem. As it stands, when held with the clip on top (which fixes the tracker to the cinemizer glasses), the tracker axis are scrambled as follows:

Tracker --> TIR
yaw --> roll
roll --> pitch
pitch --> yaw

Note that it is the movement of the tracker that is wrong.

The sdk c# examples uses RotateTrackerToCinemizer(). i've tried the following code in Zeissplugin.cs but it has no effect:
Code:
 if (!(Api.WaitNextFrame())) Thread.Sleep(10);
               
                var frame = new Frame();
                var euler = new Euler();
                var quat = new Quat(); //mars

                if (Api.GetFrame(ref frame))
                {
                    Api.RotateTrackerToCinemizer(ref quat, frame.Rot); //mars
                    Api.QuatGetEuler(ref euler, frame.Rot);
                    Euler = euler;

                    newData = true;
                }


The sdk also mentions ApplyAutoRollAdjust () being used to orientate the tracker to the cinemizer glasses. Not sure how I would call that as it seems to be internal to the tracker.dll.

I take it I am missing something fundamental here! Any ideas?


Sun Jun 02, 2013 8:59 am
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Sorry cant help :/ Have to wait for the Zeiss guys to get back to us

_________________
FreePIE
My blog


Sun Jun 02, 2013 12:23 pm
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Getting closer - tracker now orientates correctly (zeissPlugin):

Code:
                if (!(Api.WaitNextFrame())) Thread.Sleep(10);
               
                var frame = new Frame();
                var euler = new Euler();
                var cinemizerRot = new Quat(); //mars
                var cinemizerEuler = new Euler(); //mars

                if (Api.GetFrame(ref frame))
                {
                    Api.QuatGetEuler(ref euler, frame.Rot);
                    Api.RotateTrackerToCinemizer(ref cinemizerRot, frame.Rot); //mars
                    Api.QuatGetEuler(ref cinemizerEuler, cinemizerRot); //mars
                   
                    Euler = cinemizerEuler; //mars euler to cinemizerEuler

                    newData = true;
                }


Using this in freePIE as it centres correctly when 'z' is pressed:

Code:
def update():
   global yaw,roll,pitch,caly,calr,calp
   
   yaw = math.degrees(zeiss.Yaw)
   roll = math.degrees(zeiss.Roll)
   pitch = math.degrees(zeiss.Pitch)
   
   trackIR.yaw=yaw+caly
   trackIR.roll=roll+calr
   trackIR.pitch=pitch+calp

if starting:
   yaw=0
   roll=0
   pitch=0
   caly=0
   calr=0
   calp=0
   
   zeiss.update += update

diagnostics.watch(yaw+caly)
diagnostics.watch(roll+calr)
diagnostics.watch(pitch+calp)

if (keyboard.getPressed(Key.Z)):
   caly=0-yaw
   calr=0-roll
   calp=0-pitch


Yaw is inverted and jumps when looking left (have to move tracker to the right)


Mon Jun 03, 2013 2:09 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Nice work!

Can you please push it to your Github fork? (Without your "mars" comments :D I can track whats changed using Git)

So its only a matter of chaning sign and then your set?

_________________
FreePIE
My blog


Mon Jun 03, 2013 4:04 pm
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
What the fork!, I was working off cloned branch and did not fork... I take it i will need to fork it and then commit?

Did some more testing (TV program interrupted things earlier):

Cause of jump in game is the yaw switching from -17x to 170 and hence the jump in view.

Comments were as much for my benefit as for posting on here ;-D


Mon Jun 03, 2013 4:34 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Aha, thats a common problem when going from absolute to delta (mouse). Continues yaw fixes this which some plugins have, might have to fix that for all imu plugins.

I a read only clone won't help, you need an account at github and then fork my repo.

_________________
FreePIE
My blog


Tue Jun 04, 2013 12:14 am
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Right, I've forked instead of cloned and commited the changes i made:

https://github.com/marcfellows/FreePIE/


Tue Jun 04, 2013 11:52 am
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
cool dude will check it out

_________________
FreePIE
My blog


Tue Jun 04, 2013 1:47 pm
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Still trying to figure out this lack of continous yaw problem :

Tracker, converting from radians to degrees, origin 0 is rotated 90deg from the position you actually hold the tracker . So when looking straight ahead, right is 0 deg, left 179. The rear arc behind you is then negative e.g (please excuse the crap diagram):

******* 90deg

179deg ********** 0deg
-179deg

******* -90deg

The view jumps in game with the change from 179 to -179

Any ideas on how to get around this? Maths was never my best subject (Biology was).

BTW thanks for all the help - I would not have got this far otherwise!


Tue Jun 04, 2013 2:16 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Leave that part to me :D i'm planning on doing something generic that all plugins can use.
Im just checking out your code

edit: by the way we are talking about mouse emulation now right?

_________________
FreePIE
My blog


Tue Jun 04, 2013 2:31 pm
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
Yes, its probably a good thing I don't do this for a living. I would starve!

Nope - the game seems to want 0-360 with no negative numbers. I've just tested with the following freepie script:

Quote:
def update():
yaw = math.degrees(zeiss.Yaw)
...
if starting:
if yaw < 0:
yaw = yaw + 360
else:
yaw = yaw


This gives yaw of 0-360. Panning is smooth with no jumps but it is the default rotation of the tracker with 0 to the right that is screwing it up now.

edit: talking about TIR not mouse


Tue Jun 04, 2013 2:51 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
no tir goes from 0 to -90 and 0 to +90 (And can go futher but since it optic that the ranges most games implement)
Which game?

edit: Here is a android > TIR script i did thats worked well with all TrackIR titles i tried

Code:
def update():
   global yaw
   yaw = android.yaw
   global pitch
   pitch = -android.roll
   global roll
   roll = android.pitch

if starting:
   centerYaw = 0
   centerPitch = 0
   centerRoll = 0
   
   yaw = 0
   pitch = 0
   roll = 0
   android.update += update

trackIR.yaw  = math.degrees(yaw - centerYaw)
trackIR.pitch =  math.degrees(pitch - centerPitch)
trackIR.roll =  math.degrees(roll - centerRoll)

if keyboard.getKeyDown(Key.LeftControl) and keyboard.getPressed(Key.C):
   centerYaw = yaw
   centerPitch = pitch
   centerRoll = roll

_________________
FreePIE
My blog


Tue Jun 04, 2013 3:09 pm
One Eyed Hopeful

Joined: Tue May 14, 2013 3:49 pm
Posts: 39
No, that script still jumps and has the 90 deg rotation of 0 to the right. Rise of flight is a very peculiar game in many respects so it wouldn't surprise me if they decided to do something different (russians do love their wodka).


Tue Jun 04, 2013 3:23 pm
Petrif-Eyed

Joined: Mon Jun 22, 2009 8:36 am
Posts: 2156
Location: Stockholm, Sweden
Strange game :D

Try to send in constant values and see what the reference points are, find center left and right

trackIR.yaw = -90 should give you full left in a game that follows TIR protocoll

edit: btw, I pulled your changes. Should I merge the Zeiss branch into master, or does it need more work?

_________________
FreePIE
My blog


Tue Jun 04, 2013 3:48 pm
Display posts from previous:  Sort by  
   [ 82 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.