Android>FreeTrack/TrackIR>Elite Dangerous

Official forum for open source FreePIE discussion and development.
Post Reply
TheRealBix
One Eyed Hopeful
Posts: 6
Joined: Thu Sep 04, 2014 6:25 am

Android>FreeTrack/TrackIR>Elite Dangerous

Post by TheRealBix »

Hi everyone !

I'm trying to set up my Nexus 5 as a head track device.

I used to launch facetracknoir with the faceapi but the response is really low and it doesn't work in the dark. Anyway, it was working with both freetrack and trackIR protocols.

Now, I want to check if the sensors are ready for this kind of things so i've installed Wireless IMU and FreePIE IMU on the Nexus, and picked up here and there some parts of scripts :

As Wireless IMU doesn't seem to send readable data by FreePIE, I use FreePIE IMU.

Here both scripts for freetrack and trackir protocols.

Code: Select all

def update():
    global yaw
    yaw = android[0].yaw
    global pitch
    pitch = -android[0].roll
    global roll
    roll = android[0].pitch

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

freeTrack.yaw  = yaw - centerYaw
freeTrack.pitch = pitch - centerPitch
freeTrack.roll = roll - centerRoll

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

Code: Select all

def update():
  global yaw
  yaw = filters.deadband(math.degrees(filters.continuousRotation(android[0].googleYaw)), deadband)
  global pitch
  pitch = filters.deadband(math.degrees(-android[0].googlePitch), deadband)
  global roll
  roll = filters.deadband(math.degrees(-android[0].googleRoll), deadband)

if starting:
  deadband = 0.01
  centerYaw = 0
  centerPitch = 0
  centerRoll = 0

  yaw = 0
  pitch = 0
  roll = 0
  android[0].update += update

trackIR.yaw = yaw - centerYaw
trackIR.pitch = pitch - centerPitch
trackIR.roll = roll - centerRoll

if keyboard.getKeyDown(Key.LeftControl) and keyboard.getPressed(Key.C):
  centerYaw = yaw
  centerPitch = pitch
  centerRoll = roll
  
diagnostics.watch(trackIR.yaw)
diagnostics.watch(trackIR.pitch)
diagnostics.watch(trackIR.roll)
Both options work, Freepie can read values.
The problem is that Elite doesn't recognize any of those..

May I have to use opentrack/facetracknoir in an "android>Freepie>opentrack>Elite" thing ?

Thanks for your future answers :)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

It works with the real Freetrack but not with FreePIE?
TheRealBix
One Eyed Hopeful
Posts: 6
Joined: Thu Sep 04, 2014 6:25 am

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by TheRealBix »

I confirm, it works with FTnoIR + faceAPI + Freetrack protocol + Freetrack interface.

edit : I've just checked the freetrack path in the registry and it's good, ProgramFiles/Freepie..
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

Ok, we use the old Freetrack interface directly, we even use their dll
Can you try just the Freetrack interface and play the demo in the Freetrack client, does that work too?
TheRealBix
One Eyed Hopeful
Posts: 6
Joined: Thu Sep 04, 2014 6:25 am

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by TheRealBix »

Sorry for the late answer (holidays :D )

So, no, it doesn't work.
In fact because of you i've searched if it was a known thing, but only with the original freetrack soft, and actually it is.

https://www.youtube.com/watch?feature=p ... Da9c#t=398

I don't really know why, but it works. Maybe it's related to the csv available here, I think you'll understand the weird thing better than me..

And thanks for your time :)
TheRealBix
One Eyed Hopeful
Posts: 6
Joined: Thu Sep 04, 2014 6:25 am

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by TheRealBix »

Here is my final script if someone wanna take a look :

Code: Select all

def update():
    global yaw
    yaw = filters.deadband(filters.simple(filters.continuousRotation(android[0].googleYaw), smooth), dead)
    global pitch
    pitch = filters.deadband(filters.simple(android[0].googlePitch, smooth), dead)
    global roll
    roll = filters.deadband(filters.simple(android[0].googleRoll, smooth), dead)

if starting:
    dead = 0			#Defaut = 0   : Censé diminuer le drift. Ne semble pas marcher pas chez moi, je laisse donc à zéro.
    smooth = 0.9 		#Defaut = 0.9 : Permet de lisser les mouvements de tête. Ajuster de 0 à 1 selon la sensibilité de votre estomac.
    centerYaw = 0
    centerPitch = 0
    centerRoll = 0

    yaw = 0
    pitch = 0
    roll = 0
    android[0].update += update

#Là dessous, c'est les données balancées au jeu avec pour chaque axe une petite équation représentant une courbe. Ajustez les selon votre convenance, celles-ci me paraissent assez bonnes.
#Attention aux torticolis !
freeTrack.yaw  = -1.5*(yaw - centerYaw) - 10*(yaw - centerYaw)**3
freeTrack.pitch = 2*(pitch - centerPitch) + 5*(pitch - centerPitch)**3
freeTrack.roll = -1.3*(roll - centerRoll) - 2*(pitch - centerRoll)**3


#Ici, vous pouvez modifier le raccourci pour l'ajustement du zéro. Home par défaut.
if keyboard.getPressed(Key.Home):
    centerYaw = yaw
    centerPitch = pitch
    centerRoll = roll


#Décommentez les lignes suivantes pour voir les données transmises par le smartphone et par FreePIE au jeu.

#diagnostics.watch(android[0].googleYaw)
#diagnostics.watch(android[0].googlePitch)
#diagnostics.watch(android[0].googleRoll)

#diagnostics.watch(freeTrack.yaw)
#diagnostics.watch(freeTrack.pitch)
#diagnostics.watch(freeTrack.roll)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

Nice that you got it to work, what was wrong?

edit: Both Freetrack and Android uses absolute cordinate systems so I see no point in doing filters.continuousRotation or deadband
TheRealBix
One Eyed Hopeful
Posts: 6
Joined: Thu Sep 04, 2014 6:25 am

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by TheRealBix »

It seems that Elite need to detect the tracker software before collecting track data. So I had to launch Opentrack or FTnoIR in order to "lock" the game then run the FreePie script. It's weird, but it works. Maybe future updates will correct this. (This is the only game I have to do this)

The deadband filter actually doesn't do anything on me. That's why I've disabled it (tests.. :D )

On the other side, the continuousrotation is required. Without it, the value jumps to negative and "teleport" the vision to the opposite. Maybe I did something wrong but that's what happen to me :?
When I turn my head, once -pi is reached, it jumps to +pi (which correspond to 20 degrees to the left for me)
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

But running FreePIE should do the same? Hmm, there is one thing we do not do however, we do not have a fake freetrack.exe that runs, maybe they check for that.. Dumb check if you ask me
TheRealBix
One Eyed Hopeful
Posts: 6
Joined: Thu Sep 04, 2014 6:25 am

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by TheRealBix »

No, it doesn't work with a freetrack.exe, at least I don't see it in the task manager.
In the interface settings of those softwares it seems that a NPClient.dll is required and used, maybe it's related ?
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

NPClient.dll is for TrackIR, has nothing todo with Freetrack
wax7
One Eyed Hopeful
Posts: 5
Joined: Tue Oct 07, 2014 5:18 pm

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by wax7 »

Hi. i tryed also this. but...

diagnostics.watch(android[0].googleYaw)
diagnostics.watch(android[0].googlePitch)
diagnostics.watch(android[0].googleRoll)

Give nothing out!

only this works then setting the android app to raw data:

diagnostics.watch(android[0].yaw)
diagnostics.watch(android[0].pitch)
diagnostics.watch(android[0].roll)

any problems then using raw data?

Numbers of ra data counting up and deasnt stand still.... :/
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

Have you ticked the Orientation checkbox on the Android app?
If you tick Debug do you see values?
wax7
One Eyed Hopeful
Posts: 5
Joined: Tue Oct 07, 2014 5:18 pm

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by wax7 »

Not Moving Handy.
http://www.youtube.com/watch?v=PW1QCCs5djs
Screenshot_2014-10-08-12-08-50.png
Screenshot_2014-10-08-12-09-02.png
You do not have the required permissions to view the files attached to this post.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

Looks like the phone does not support orientation, that is a bit strange
wax7
One Eyed Hopeful
Posts: 5
Joined: Tue Oct 07, 2014 5:18 pm

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by wax7 »

The Phone is the Brand new "OnePlus One"
wax7
One Eyed Hopeful
Posts: 5
Joined: Tue Oct 07, 2014 5:18 pm

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by wax7 »

mmmh. no Orientation Sensors....
Screenshot_2014-10-08-12-41-36.png
You do not have the required permissions to view the files attached to this post.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

Very strange, maybe call the support?
wax7
One Eyed Hopeful
Posts: 5
Joined: Tue Oct 07, 2014 5:18 pm

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by wax7 »

Tryed now my old Milestone Handy. But its like i have an Earthquake.... not usefull. need more Cell Phones for TEsting ;)
DoomyDoom
One Eyed Hopeful
Posts: 5
Joined: Wed Dec 10, 2014 9:16 pm

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by DoomyDoom »

TheRealBix wrote:It seems that Elite need to detect the tracker software before collecting track data. So I had to launch Opentrack or FTnoIR in order to "lock" the game then run the FreePie script. It's weird, but it works. Maybe future updates will correct this. (This is the only game I have to do this)

I'm having to do this in DCS. I turn on OpenTrack's UDP tracker, turn on the FreePIE script, and then turn off OpenTrack's tracking.
alex8b
One Eyed Hopeful
Posts: 1
Joined: Mon May 25, 2015 8:50 am

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by alex8b »

Code: Select all

        public void Write()
        {
...
            local.CamWidth = 1920;
            local.CamHeight = 1080; 
The reason why it doesn't work is because FreePie doesn't set these two variables on FreeTrack protocol.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

aha, will check that out
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: Android>FreeTrack/TrackIR>Elite Dangerous

Post by CyberVillain »

Does this version work?
You do not have the required permissions to view the files attached to this post.
Post Reply

Return to “FreePIE”