PiBoSo Official Forum

GP Bikes => Support => Topic started by: HornetMaX on May 26, 2015, 10:00:08 PM

Title: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 26, 2015, 10:00:08 PM
Hi,
due to an interesting post on a 3dof head tracking device (http://www.edtracker.org.uk/index.php (http://www.edtracker.org.uk/index.php)) I wanted to check how it could be used in GPB.

The devidc has a HID interface (i.e. like a joystick) but it can also use OpenTrack (https://github.com/opentrack/opentrack (https://github.com/opentrack/opentrack)) in order to emulate FreeTrack: as GPB is supposed to be FreeTrack compatible, then the device could be used for freelook.

So I downloaded OpenTrack and I run its main executable: the GUI allows me to chose the input device and the output format.
I select freetrack as output and either one of my joypad or head tracking (via webcam) as input. Both seems to work fine in the opentrack gui (I see stuff/numbers moving correctly when I move the joypad or my head).

The problem is, in GPB, after having set the freelook to "Tracker", there's no movement.

Even more weird: if I use mouse emulation as opentrack output, everything works fine in opentrack gui (the mouse pointer moves with my joypad or my head).
Once in GPB however (havin gset frelook to mouse look):

I know nothing about all this stuff so I'm confident I'm missing something. If anybody has an idea ...

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Napalm Nick on May 26, 2015, 10:13:42 PM
Maybe its like games like F1 2013/14 where it has no use (and doesn't function - why would it come on arcade mode right?) unless you are in 'onboard view'.

Just a thought.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 26, 2015, 10:20:56 PM
Of course I'm trying this in 'onboard view' (and now I'm inches away from blaming you :) ).

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: h106frp on May 26, 2015, 10:25:25 PM
With no tracking stuff installed at all i just enabled freelook in the 'simulation' option tab and left it on mouse look and i can happily move the first person view around with the mouse (no buttons needed).

Does this work for you?
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Napalm Nick on May 26, 2015, 10:25:57 PM
Quote from: HornetMaX on May 26, 2015, 10:20:56 PM
Of course I'm trying this in 'onboard view' (and now I'm inches away from blaming you :) ).

MaX.
(https://s-media-cache-ak0.pinimg.com/originals/77/63/a0/7763a02c3849de301000de914ccfcfe0.jpg)

Ooh yeh another win for Napalm  ;)
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 26, 2015, 10:27:31 PM
Quote from: h106frp on May 26, 2015, 10:25:25 PM
With no tracking stuff installed at all i just enabled freelook in the 'simulation' option tab and left it on mouse look and i can happily move the first person view around with the mouse (no buttons needed).

Does this work for you?

Yes, of course.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Napalm Nick on May 26, 2015, 10:28:42 PM
Quote from: h106frp on May 26, 2015, 10:25:25 PM
With no tracking stuff installed at all i just enabled freelook in the 'simulation' option tab and left it on mouse look and i can happily move the first person view around with the mouse (no buttons needed).

Does this work for you?

Yes , now get mouse emulation software and tie in your tracking device to it and boom your away.  But it should be easier than that and that is what we need to know - how to enable Freelook/Tracking without shenanigans.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: h106frp on May 26, 2015, 10:31:53 PM
Well if its simulating the mouse OK i can only agree that its a case of 'weird stuff' going on  ;D

If you run the game windowed you should be able to see the freetrack client and the game - i dont think you need opentrack to get it working in mouse look mode.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 26, 2015, 10:45:25 PM
Quote from: h106frp on May 26, 2015, 10:31:53 PM
Well if its simulating the mouse OK i can only agree that its a case of 'weird stuff' going on  ;D

If you run the game windowed you should be able to see the freetrack client and the game - i dont think you need opentrack to get it working in mouse look mode.
Uh I'm lost ... my understanding is that I don't need freetrack, I just need opentrack.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Napalm Nick on May 26, 2015, 11:08:53 PM
Well eat this for your supper:

I just flashed my TrackIR 5 and confirmed it doesn't work in the game no matter what setting. Great I hear you murmer.

So I flashed TIRMouse (comes with Track IR - mouse emulator), selected Mouse-look in game and there we go all working nice left right up and down like a dream. No 6DOF but hey one miracle a day is enough.

so tracking device ---> Mouse emulator--------> mouse look          all work fine in a TRACKIR setup

But yes I do understand your problem - if it is driving the mouse in the menus it should work in the game with Mouse look selected (like mine does). I don't have any bright ideas on that (well I did and you didn't like them too much)  :)

I asked the question before about 'Tracking' and 'Face tracking' settings and got the usual Tumbleweed response.

I was hoping (I think like you) that Freetrack or AN other, would be like TrackIR could be (almost plug n play 6DOF) if it wasn't for NDA's and SDKs and NFI's.

The big man might give some input.

I'm going to bed now and waiting on an Occulus, though the reality is tomorrow I will be TrackIR-ing round the um....track
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Klax75 on May 26, 2015, 11:19:19 PM
Quote from: Napalm Nick on May 26, 2015, 11:08:53 PM
Well eat this for your supper:

I just flashed my TrackIR 5 and confirmed it doesn't work in the game no matter what setting. Great I hear you murmer.

So I flashed TIRMouse (comes with Track IR - mouse emulator), selected Mouse-look in game and there we go all working nice left right up and down like a dream. No 6DOF but hey one miracle a day is enough.

so tracking device ---> Mouse emulator--------> mouse look          all work fine in a TRACKIR setup

But yes I do understand your problem - if it is driving the mouse in the menus it should work in the game with Mouse look selected (like mine does). I don't have any bright ideas on that (well I did and you didn't like them too much)  :)

I asked the question before about 'Tracking' and 'Face tracking' settings and got the usual Tumbleweed response.

I was hoping (I think like you) that Freetrack or AN other, would be like TrackIR could be (almost plug n play 6DOF) if it wasn't for NDA's and SDKs and NFI's.

The big man might give some input.

I'm going to bed now and waiting on an Occulus, though the reality is tomorrow I will be TrackIR-ing round the um....track

I got GP Bikes and Track IR 5 to use Mouse Emulation about to work about a year, year and half ago to work with GP Bikes. The problem I had was the view would start to drift on you so eventually your head is at a awkward angle. Or you'd have to turn your head left and right to max angle to get it to adjust every time. But then it would start drifting off of center again.

I have Track IR 5 and DK2. Track IR is nice since it is screen resolution and you can adjust the movement of your head sensitivity. DK2 is always 1:1 ratio, and the screen resolution isn't great. Plus wearing glasses with it is a tight fit and gives your more tunnel vision so you are moving your head a little more. And since it is always 1:1 ratio it for me is a really pain when GP Bike gets it to look behind you. I'd still have to use a button for it. Also since it's "3D" like in Kart Pro if you lean forward the steering wheel will get very close to your virtual face and make your eyes want to cross. Not very comfortable. :/
Title: Re: GPB and OpenTrack/FreeTrack
Post by: h106frp on May 26, 2015, 11:21:23 PM
Understand what you were doing now with joystick to mouse emulation in opentrack. Tried it and i am getting the same results - no mouse simulation. Will have to read up on opentrack :(
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Napalm Nick on May 26, 2015, 11:26:29 PM
That's right Klax I remember reading your post now. I will have to check see if mine drifts too. :)
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Hawk on May 27, 2015, 06:50:48 AM
Yes I read something about that last night. It's because it tracks in 3 DOF and not 6 DOF, so by moving your head from side to side and moving back and forward it cannot track your head position so it starts to loose your heads position in space. You need full 6 DOF to be able to fully track your head position apparently.  ;)

Hawk.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 27, 2015, 07:00:20 AM
Quote from: h106frp on May 26, 2015, 11:21:23 PM
Understand what you were doing now with joystick to mouse emulation in opentrack. Tried it and i am getting the same results - no mouse simulation. Will have to read up on opentrack :(
The problem is, there doesn't seem to be a lot to read.

On opentrack side, everything seems to work fine, no matter what I use as input (joypad, head-tracking), it's only between opentrack and GPB that something goes lost (no matter what I use as output, FreeTrack or mouse emulation).

Too bad, I was warming up to the idea of EDTracker: I'm sure you can still use it in HID mode, but still it would be a pity not giving it a try in freelook mode.

Even wikipedia seems to say GPB/WRS/KRP work fine with FreeTrack (http://en.wikipedia.org/wiki/List_of_games_compatible_with_FreeTrack (http://en.wikipedia.org/wiki/List_of_games_compatible_with_FreeTrack)).

Quote from: Hawk UK on May 27, 2015, 06:50:48 AM
Yes I read something about that last night. It's because it tracks in 3 DOF and not 6 DOF, so by moving your head from side to side and moving back and forward it cannot track your head position so it starts to loose your heads position in space. You need full 6 DOF to be able to fully track your head position apparently.  ;)
I don't think drifting is related to 6dof or 3dof. Anyway Piboso games only need 2dof (yaw, pitch) for freelook: they don't use full head position (and attitude) tracking, they just need a 2 axis input.
Of course if you can also track the head position then you could assign the X-Y head movements to (for example) rider lean. But freelook seems to be just 2 dof.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 27, 2015, 07:42:18 AM
Quote from: ptrshpt on May 27, 2015, 07:31:22 AM
Some time ago i tested facetracknoir with an webcam and it worked in GPB.
Will give it a try, but OpenTrack and FreeTrackNoIR are made essentially by the same people and my understanding (could be wrong) is that OpenTrack is somehow what replaces FreeTrackNoIR.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 27, 2015, 07:49:57 AM
So, at least the mouse emulation problem is a known problem of OpenTrack: https://github.com/opentrack/opentrack/issues/157 (https://github.com/opentrack/opentrack/issues/157)

The rest still puzzles me.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: teeds on May 27, 2015, 10:02:35 AM
Trying to fully understand the potential of this device but am I right in thinking it could be used as input controls? 
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 27, 2015, 10:21:54 AM
Quote from: teeds on May 27, 2015, 10:02:35 AM
Trying to fully understand the potential of this device but am I right in thinking it could be used as input controls?
Yes, as it is sen by Windows as an HID device (i.e. a joystick/joypad essentially) with 3 analog axis.

For that you don't even need OpenTrack, just the EDTracker software running and you're good to go: you will see a new "joystick" in GPB and you can associate it to inputs.
That's why I thought about strapping the device to the joypad: you lean the joypad (not its stick) and the rider leans (or the bike leans, or the throttle goes up, ...).

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: Napalm Nick on May 27, 2015, 10:30:17 AM
Joypad leaning is indeed a very interesting potential use.  8) Good luck.


Title: Re: GPB and OpenTrack/FreeTrack
Post by: teeds on May 27, 2015, 11:52:50 AM
My friend Jester plays GPB and MXB using the built-in tilt of a PS4 controller and he seems happy with it but he had to use a programmable adaptor to get it working as he wanted.
I'm trying to get analogue rider lean in MXB and it sounds like this might do it. I want to strap something to my chest and have the virtual rider lean when I do. I've played with this on my phone which works ok but I need my phone for other stuff and it's a bit much to strap it horizontally to my chest, this little device looks ideal though  :)

Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 27, 2015, 12:02:37 PM
Holy shite, now hear this ...

I tried at office on my office laptop (it runs GPB fine).

As son as I run opentrack 2.2 (latest stable), GPB no longer starts. Not even if I close OpenTrack.
I have to physically remove the directory in which I have unzipped the opentrack zip (there's no installation): after that GPB starts again.
There must be some dll mess going on with 2.2. Glad that was not something more serious causing this.

BTW, doesn't happen with opentrack 2.3 rc10 (latest release candidate), but it still doesn't work in GPB.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 27, 2015, 07:12:37 PM
Update: I've contacted the people at EDTracker but they can't help much on the problem, their software works fine.
I've also contacted the author of OpenTrack (waiting reply).

In the while I've verified that GPB works fine with FreeTrack in demo mode, so the issue is somewhere between GPB and OpenTrack.

FaceTrackNoIR: can't start the camera thingy :(

Would probably be way easier if GPB could support assigning axes to free look.

BTW, that's why I like coding better: at least I know who to blame when my software doesn't work :)

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: h106frp on May 27, 2015, 07:42:42 PM
If it seems like a good affordable controller after testing then maybe native edtrack support could be added at some point.

Its a shame the GPB control setup cannot be edited at the moment as far as i can see :( although the dialogue box 'unassigned' when you click on a control suggests it might have been considered at some point - anyone know if its possible?

Other option might be something like vJoy and map it to the 'heading' keys (,.) for testing purposes.

Good detective work so far Max! Having dug out my XBox controller i can see how easy it would be to velcro the tracker underneath for a simple functional expansion of a basic controller   8)

edit: Does the input plugin offer a solution? Does anybody have some demo code to build a plugin with it?
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 27, 2015, 08:29:45 PM
Quote from: h106frp on May 27, 2015, 07:42:42 PM
If it seems like a good affordable controller after testing then maybe native edtrack support could be added at some point.
My understanding is that EDTracker only interface is HID, so there's no native suport possible.

Quote from: h106frp on May 27, 2015, 07:42:42 PM
Other option might be something like vJoy and map it to the 'heading' keys (,.) for testing purposes.
Hmm that would be bad, as it will only move like a button (fully left/rigt).
BTW GPB freelook seems to be 2 axis only: it shouldn't be a big problem to make it 3 axis (even if probably it's not very important).

Quote from: h106frp on May 27, 2015, 07:42:42 PM
edit: Does the input plugin offer a solution? Does anybody have some demo code to build a plugin with it?
No it's not a solution, unless GPB allows to assign 2 axes to the free look.
But in that case, you no longer need the plugin anyway :)

Let's see what the OpenTrack guy says: it should just work with FreeTrack output (given that GPB works with FreeTrack and that OpenTrack works with many FreeTrack games).
Also, if OpenTrack fixes the mouse emulation, it could also work via that (for free look I mean).

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 28, 2015, 06:40:08 AM
Quote from: ptrshpt on May 27, 2015, 07:31:22 AM
Some time ago i tested facetracknoir with an webcam and it worked in GPB.
Yep, FaceTrackNoIR works with GPB.

Have to say that face-tracking in OpenTrack seems to have better performance. If only it worked with GPB, it would be already interesting to test: it doesn't seem to eat up too much CPU (i5-2500K @ 4.5GHz), so maybe it is already a valid no-hardware solution for people using rider pov and wanting to have free look.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: h106frp on May 28, 2015, 08:19:23 AM
After a bit of research (idle browsing  ;))...
The processor used in edtrack has native HID mouse (and joystick) support libraries so it is possible that the opensource code could be modified to output a mouse stream directly, it might be that if a case for free look (mouse look) could be made the edtrack developers (or some other Arduino developer) would implement it.

The other option might be FreePIE, it promises that you can write scripts (python based) that translate between any input devices.
http://andersmalmgren.github.io/FreePIE/ (http://andersmalmgren.github.io/FreePIE/)

Getting emails telling me my hardware bits are in the post  :). Quite looking forward to wielding the soldering iron on this.
I went for the developers circuit board and box as it makes life easier, the device smaller and its a bit of support for a worthy opensource project. This brings the cost for a magnetometer unit to about £28 homemade so you save about a tenner over buying a pre-assembled unit.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 28, 2015, 09:24:24 AM
Quote from: h106frp on May 28, 2015, 08:19:23 AM
After a bit of research (idle browsing  ;))...
The processor used in edtrack has native HID mouse (and joystick) support libraries so it is possible that the opensource code could be modified to output a mouse stream directly, it might be that if a case for free look (mouse look) could be made the edtrack developers (or some other Arduino developer) would implement it.
I'll ask it to Dan (the EDTracker guy that replied to my questions): that would be likely ideal as no other software would be required. Not sure it's trivial though.
Still OpenTrack probably provides more flexibility in terms of filtering and axis manipulations (scale, mapping, curves etc).

I've filed an issue report on OpenTrack GitHub (https://github.com/opentrack/opentrack/issues/165 (https://github.com/opentrack/opentrack/issues/165)) and it seems other games are currently affected (IL-2 Sturmovik: Battle of Stalingrad), so maybe the dev will have a look.

I'm a tenacious bugger (as you all know) and this thing should just work.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: h106frp on May 28, 2015, 11:48:30 AM
Having native mouse look would open up edtrack to most first person games and 3D modelling apps, seems a worthwhile update to the code if they want a wider user base.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: HornetMaX on May 28, 2015, 11:51:36 AM
Quote from: h106frp on May 28, 2015, 11:48:30 AM
Having native mouse look would open up edtrack to most first person games and 3D modelling apps, seems a worthwhile update to the code if they want a wider user base.
Dan replied that they already have it in their to-do list. Sort of low=priority at the moment: they are working on "productizing" the current model (make it retail sellable) and on a wireless version.

I do believe that having native mouse interface would be a plus for them, but to be honest, having GPB allowing to assign joystick axes to free look (head movements) would probably be even simpler.

MaX.
Title: Re: GPB and OpenTrack/FreeTrack
Post by: h106frp on May 28, 2015, 12:31:59 PM
wireless is nice, or better still for device compatibility bluetooth.

Saw a project where someone had used modified edtrack code with a different processor and supported a wireless edtrack link, claimed up to 100 hrs on a lithium coin cell (3.6v cr2032) type.

Nice to see how well they are supporting this project with friendly email support :)