Zeiss headtracker input/trackIR output?
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Zeiss headtracker input/trackIR output?
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?
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?
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
FreePIE does not support Zeiss Cinimizer, what outputs other than mouse does it have?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?
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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.
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.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
What game is it? Some games need the TrackIR fixer to workMars 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.
http://naturalpointofview.blogspot.se/p ... fixer.html
Are there no other outputs than mouse emulation from that tracker driver? Sounds shitty to me
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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 tracker is very impressive - no discernable latency. Your head is the limiting factor . I've seen more latency using TIR or Facetracknoir.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
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.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.
Is the SDK free? I can look at it if you register and download it for me.
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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.
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.
-
- One Eyed Hopeful
- Posts: 13
- Joined: Tue Aug 14, 2012 3:10 am
- Location: Karlsruhe Germany
- Contact:
Re: Zeiss headtracker input/trackIR output?
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.
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.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
@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...
Let me know if the FreePIE team can assist you, we very much want support for your products...
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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
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
-
- One Eyed Hopeful
- Posts: 9
- Joined: Wed Nov 02, 2011 4:17 am
Re: Zeiss headtracker input/trackIR output?
Hey
Last edited by greenlantern on Wed May 22, 2013 12:29 am, edited 1 time in total.
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
Blimey, thats service for you!
-
- One Eyed Hopeful
- Posts: 13
- Joined: Tue Aug 14, 2012 3:10 am
- Location: Karlsruhe Germany
- Contact:
Re: Zeiss headtracker input/trackIR output?
I just send you the SDK and a link to the Tray-Icon tool
-
- One Eyed Hopeful
- Posts: 13
- Joined: Tue Aug 14, 2012 3:10 am
- Location: Karlsruhe Germany
- Contact:
Re: Zeiss headtracker input/trackIR output?
@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.
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.
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
SDK email received (I was already using the headtracking applet).
Now, I just need the time to do something with it!
Now, I just need the time to do something with it!
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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?
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?
-
- One Eyed Hopeful
- Posts: 13
- Joined: Tue Aug 14, 2012 3:10 am
- Location: Karlsruhe Germany
- Contact:
Re: Zeiss headtracker input/trackIR output?
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.
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.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
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
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
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
If you can create the embryo that will give me a start. Now, to try and find my brain!
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
Is freeglut.dll required by tracker.dll?
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
I couldnt test it more than I get a device not found..
https://github.com/AndersMalmgren/FreePIE/tree/Zeiss
https://github.com/AndersMalmgren/FreePIE/tree/Zeiss
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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!
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!
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
Nice i just copied that stuff from the example.
Should I just remove that part all together or send in true?
Should I just remove that part all together or send in true?
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
Your chocie I think, the bits I commented out are as follows:
api.cs:
ZeissPlugin.cs:
Just tried ROF using the following script:
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?
api.cs:
Code: Select all
/*public static bool SetBootloaderMode(bool activationMode, out int error)
{
var result = Tracker_SetBootloaderMode(false);
error = GetLastError();
return result;
}*/
Code: Select all
/*result = Api.SetBootloaderMode(false, out error);
if (!result)
{
throw new Exception(string.Format("Error while setting bootloader mode: {0}", Api.GetError(error)));
}*/
Code: Select all
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
Last edited by Mars on Sat Jun 01, 2013 10:42 am, edited 1 time in total.
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
trackIR uses deegrees while zeiss uses radians
convert using math.degrees in script
convert using math.degrees in script
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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:
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?
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: Select all
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;
}
I take it I am missing something fundamental here! Any ideas?
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
Sorry cant help :/ Have to wait for the Zeiss guys to get back to us
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
Getting closer - tracker now orientates correctly (zeissPlugin):
Using this in freePIE as it centres correctly when 'z' is pressed:
Yaw is inverted and jumps when looking left (have to move tracker to the right)
Code: Select all
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;
}
Code: Select all
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
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
Nice work!
Can you please push it to your Github fork? (Without your "mars" comments I can track whats changed using Git)
So its only a matter of chaning sign and then your set?
Can you please push it to your Github fork? (Without your "mars" comments I can track whats changed using Git)
So its only a matter of chaning sign and then your set?
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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
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
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
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.
I a read only clone won't help, you need an account at github and then fork my repo.
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
Right, I've forked instead of cloned and commited the changes i made:
https://github.com/marcfellows/FreePIE/
https://github.com/marcfellows/FreePIE/
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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!
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!
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
Leave that part to me 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?
Im just checking out your code
edit: by the way we are talking about mouse emulation now right?
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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:
edit: talking about TIR not mouse
Nope - the game seems to want 0-360 with no negative numbers. I've just tested with the following freepie script:
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.def update():
yaw = math.degrees(zeiss.Yaw)
...
if starting:
if yaw < 0:
yaw = yaw + 360
else:
yaw = yaw
edit: talking about TIR not mouse
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
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
Which game?
edit: Here is a android > TIR script i did thats worked well with all TrackIR titles i tried
Code: Select all
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
-
- One Eyed Hopeful
- Posts: 39
- Joined: Tue May 14, 2013 3:49 pm
Re: Zeiss headtracker input/trackIR output?
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).
-
- Petrif-Eyed
- Posts: 2166
- Joined: Mon Jun 22, 2009 8:36 am
- Location: Stockholm, Sweden
Re: Zeiss headtracker input/trackIR output?
Strange game
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?
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?