Rafwaffe

Using Opentrack with Android phone for headtracking

Hello!
 
Edit: Please note that I did not do anything new, just used Stanislaw Halik's instructions in below linked blog. So all reputation to him for making the configuration. I just translated it to War Thunder and tried to keep it as simple as possible.
 
Today while browsing internet I found a page explaining how to make your Android phone to track your head movement. I tried it and it works very well. I wrote quickly what I did. If you follow the instructions and find any errors please let me know.
 
All the glory to Stanislaw Halik who in following page explains how to get Smartphone Headtracking to work. You can see the pictures and videos there.
 
 
What you need:
1. Android phone that supports movement tracking
2. LAN with Wifi
3. Something to keep your phone on top of your head
4. Folio hat to protect your brains :-p
 
 
 
Preparations:
 
1. Download "Opentrack 2.3 release candidate 7" and unzip the package somewhere: https://github.com/opentrack/opentrack/releases
2. Copy the file" <path to the folder here>\opentrack-2.3-rc7\install\clientfiles\freepie-udp\com.freepie.android.imu.apk" to your Android phone
3. In your Android phone install the "com.freepie.android.imu.apk". You might need to change some "Allow unknown sources" setting in your phone.
3. Install "Wake Lock" from Android Market to your phone
4. Copy my settings file "Opentrack_iSteel.txt" from here to your computer to following path <path to the folder here>\opentrack-2.3-rc7\install\settings
5. Rename the file to ""Opentrack_iSteel.ini"
 
 
All set. Just need to launch everything.
 
 
Optional:
1. Strap the phone to your headphones/cap/whatever if you want to be ready
 
On your phone:
1. Put your phone to airplane mode and activate WLAN
2. Start FreePIE IMU and set your computer ip-address there
3. Start Wake Lock and choose "PARTIAL_WAKE_LOCK"
 
On your PC:
1. Launch <path to the folder here>\opentrack-2.3-rc7\install\opentrack.exe
2. Press load
3. Choose "Opentrack_iSteel.ini"
4. Press Start
5. You should see the octopus turning now when you move your phone. If not, check your firewall, check all the settings etc and retry.
 
Now launch War Thunder and go to test flight with your favourite plane. You can press Esc and Alt-Tab out to change the settings in Opentrack.
 
Home key is set to center the view. 
 
Enjoy!
 
Disclaimer: You do this on your own risk. If you break your phone or fry your brains, do not blame me :-)
 
EDIT 31.2.2015: For some reason the attached ini file cannot be downloaded. Copy the text from spoiler and save as <nicename>.ini under Opentrack settings folder.
 
 
[spoiler]
[Curves-tx]
point-count=1
point-0-x=100
point-0-y=100
 
[opentrack-ui]
camera-pitch=0
camera-yaw=0
compensate-translation=true
compensate-translation-disable-z-axis=false
filter-dll=Accela
pitch-alt-axis-sign=false
pitch-invert-sign=false
pitch-source-index=4
pitch-zero-pos=0
protocol-dll=freetrack 2.0 Enhanced
roll-alt-axis-sign=false
roll-invert-sign=true
roll-source-index=5
roll-zero-pos=0
tracker-dll=FreePIE UDP receiver
tracker2-dll=
use-system-tray=false
x-alt-axis-sign=false
x-invert-sign=false
x-source-index=0
x-zero-pos=0
y-alt-axis-sign=false
y-invert-sign=false
y-source-index=1
y-zero-pos=0
yaw-alt-axis-sign=false
yaw-invert-sign=false
yaw-source-index=3
yaw-zero-pos=0
z-alt-axis-sign=false
z-invert-sign=false
z-source-index=2
z-zero-pos=0
 
[Curves-tx_alt]
point-count=1
point-0-x=100
point-0-y=100
 
[Curves-ty]
point-count=1
point-0-x=100
point-0-y=100
 
[Curves-ty_alt]
point-count=1
point-0-x=100
point-0-y=100
 
[Curves-tz]
point-count=1
point-0-x=100
point-0-y=100
 
[Curves-tz_alt]
point-count=1
point-0-x=100
point-0-y=100
 
[Curves-rx]
point-count=3
point-0-x=7.19999980926514
point-0-y=8.78048801422119
point-1-x=30.0342864990234
point-1-y=90.4390258789062
point-2-x=50.1942863464355
point-2-y=180
 
[Curves-rx_alt]
point-count=1
point-0-x=180
point-0-y=180
 
[Curves-ry]
point-count=3
point-0-x=6.99428558349609
point-0-y=8.78048801422119
point-1-x=30.0342864990234
point-1-y=91.3170700073242
point-2-x=49.7828559875488
point-2-y=180
 
[Curves-ry_alt]
point-count=1
point-0-x=180
point-0-y=180
 
[Curves-rz]
point-count=1
point-0-x=180
point-0-y=180
 
[Curves-rz_alt]
point-count=1
point-0-x=180
point-0-y=33.365852355957
 
[Accela]
ewma=2
rotation-threshold=25
translation-threshold=25
 
[freepie-udp-tracker]
add-pitch-degrees=0
add-roll-degrees=0
add-yaw-degrees=0
axis-index-x=0
axis-index-y=1
axis-index-z=2
port=5555
 
[keyboard-shortcuts]
key-alt-center=false
key-alt-toggle=false
key-alt-zero=false
key-ctrl-center=false
key-ctrl-toggle=false
key-ctrl-zero=false
key-index-center=19
key-index-toggle=0
key-index-zero=0
key-shift-center=false
key-shift-toggle=false
key-shift-zero=false
 
[proto-freetrack]
use-memory-hacks=false
used-interfaces=0
[/spoiler]
 
Edited by iSteel
  • Upvote 6

Share this post


Link to post
Share on other sites

Nice! Ill try it but is there any lag or delay between IRL movements and in-game movements?

Also what exactly are the risks for your brain? :P

Share this post


Link to post
Share on other sites

thank you very much!!

 

works good with my MotoG!

no problems with lag, much better then my DIY-track-IR-Kit!

 

setup done in 20 minutes! every android user who is intrested  in simulator should try it!

 

highly recomended!

Share this post


Link to post
Share on other sites

Nice! Ill try it but is there any lag or delay between IRL movements and in-game movements?

Also what exactly are the risks for your brain? :P

 

Hello. I have been away from this forum for a while. Playing one new space sim that was launched on December ;-)

 

I have not noticed any delay even though my WLAN router is about 5-10 meters away from me behind many walls. I ordered a Wi-Fi adapter for my PC from Ebay just to build dedicated WLAN for this purpose. Okay, I needed that 6 euros adapter also for my Raspberry Pi project.

 

If you can root your phone you might succeed on using the USB connection to transfer the communication. In this case you could switch on airplane mode and not to have any radio waves coming out right top of your brain. I have not succeeded rooting my phone (currently ZTE Grand X) but I wish I could to make this wired connection to work. If you are interested on this try to search "reverse tethering" over google With your phone model.

 

One thing that I built for myself was a phone holder that has piece of folio under the phone, i.e. between the phone and my brains. I don't know whether it helps but at least it gives me comfort that I have done something to help my brains not to cook... 

Share this post


Link to post
Share on other sites

Hello i seem to have a problem.

When i launch Opentrack and freepie on my phone, i see the octupus moving, no problem there. However in WT, there aren't any head movements. Any idea what might be causing this??

 

Also any idea if this also works in IL2 1946?

Edited by Aveno

Share this post


Link to post
Share on other sites

Hello i seem to have a problem.

When i launch Opentrack and freepie on my phone, i see the octupus moving, no problem there. However in WT, there aren't any head movements. Any idea what might be causing this??

 

Also any idea if this also works in IL2 1946?

 

-Make sure that you load the attached "Opentrack_iSteel.txt" , rename it to Opentrack_iSteel.ini with an editor.

-Load the file in opentrack

-protokol has to be: "freetrack 2.0 enhanced"

 

you can also change that stuff manualy but ISteel did a very good job with the mapping!

Share this post


Link to post
Share on other sites

When i launch Opentrack and freepie on my phone, i see the octupus moving, no problem there. However in WT, there aren't any head movements. Any idea what might be causing this??

 

Also any idea if this also works in IL2 1946?

 

If I remember correctly there is a setting in War Thunder controls you need to enable, something like "Use headtracking (yes/no)". I cannot check at the moment.

 

This should work in every game that supports Freetrack.

Share this post


Link to post
Share on other sites

Ok i dont know how it happened but my problem got solved ;)

I just restarted Opentrack.

Just tested it in test flight but i dont have time to play right now :(

Ill give my feedback later on!

Share this post


Link to post
Share on other sites

Hmmmm the camera jiggles everywhere, its not stable at all. Something to do with my Xperia M2? I turned smoothness all the way up....

Share this post


Link to post
Share on other sites

Hmmmm the camera jiggles everywhere, its not stable at all. Something to do with my Xperia M2? I turned smoothness all the way up....

 

Try to put the Accela filter settings like in the picture behind the link in my original post. Seems that my file did have other settings (or maybe Accela settings are not imported). I imported my file and they went to default settings. So try with Accela settings, they should help depending on the phone you have.

Share this post


Link to post
Share on other sites

Ok i figured the camera jiggles because the value my phone sends to Opentrack is always changing in a 10° range.

Dont know if im clear ^^

Basically when i keep my head still it will jiggle between 30° and 40°. I dont really blame my phone gyro, it's not the best out there and frankly everything else works quite well. Any solution to erase this? Can i make my phones gyro more precise as i think thats the main problem.

(Ive already put Accela filter but tweaked it a bit to reduce the jiggling as much as possible)

Edited by Aveno

Share this post


Link to post
Share on other sites

Hey i need some help. I managed to get the octupous to move but it moves so fast, its blinking. in-game, the whole screen is blinking but the view stays the same (its only looking forward, not looking right or left). any suggestions?

Edited by ThisMeansWAR

Share this post


Link to post
Share on other sites

 

Hello!
 
Edit: Please note that I did not do anything new, just used Stanislaw Halik's instructions in below linked blog. So all reputation to him for making the configuration. I just translated it to War Thunder and tried to keep it as simple as possible.
 
Today while browsing internet I found a page explaining how to make your Android phone to track your head movement. I tried it and it works very well. I wrote quickly what I did. If you follow the instructions and find any errors please let me know.
 
All the glory to Stanislaw Halik who in following page explains how to get Smartphone Headtracking to work. You can see the pictures and videos there.
 
 
What you need:
1. Android phone that supports movement tracking
2. LAN with Wifi
3. Something to keep your phone on top of your head
4. Folio hat to protect your brains :-p
 
 
 
Preparations:
 
1. Download "Opentrack 2.3 release candidate 7" and unzip the package somewhere: https://github.com/opentrack/opentrack/releases
2. Copy the file" <path to the folder here>\opentrack-2.3-rc7\install\clientfiles\freepie-udp\com.freepie.android.imu.apk" to your Android phone
3. In your Android phone install the "com.freepie.android.imu.apk". You might need to change some "Allow unknown sources" setting in your phone.
3. Install "Wake Lock" from Android Market to your phone
4. Copy my settings file "Opentrack_iSteel.txt" from here to your computer to following path <path to the folder here>\opentrack-2.3-rc7\install\settings
5. Rename the file to ""Opentrack_iSteel.ini"
 
 
All set. Just need to launch everything.
 
 
Optional:
1. Strap the phone to your headphones/cap/whatever if you want to be ready
 
On your phone:
1. Put your phone to airplane mode and activate WLAN
2. Start FreePIE IMU and set your computer ip-address there
3. Start Wake Lock and choose "PARTIAL_WAKE_LOCK"
 
On your PC:
1. Launch <path to the folder here>\opentrack-2.3-rc7\install\opentrack.exe
2. Press load
3. Choose "Opentrack_iSteel.ini"
4. Press Start
5. You should see the octopus turning now when you move your phone. If not, check your firewall, check all the settings etc and retry.
 
Now launch War Thunder and go to test flight with your favourite plane. You can press Esc and Alt-Tab out to change the settings in Opentrack.
 
Home key is set to center the view. 
 
Enjoy!
 
Disclaimer: You do this on your own risk. If you break your phone or fry your brains, do not blame me :-)

 

I cant download the opentrack_isteel.org

Share this post


Link to post
Share on other sites

I cant download the opentrack_isteel.org

 

Hi,

 

I added the ini file as text to original post. See under spoiler tag. It is only my ini file for my settings, you don't need it if you set everything up yourself.

 

I hope this helps.

 

-iSteel

Share this post


Link to post
Share on other sites

I am developing an app that takes care of pretty much everything, headtracking AND display (so it is basically a very cheap alternative to gadgets like the Oculus Rift). You just need to add a Google Cardboard or better headmount and you can start playing War Thunder in VR using your phone.

 

The app is called Trinus VR, and you can find instructions on how to use (along with download links) here: http://trinusvr.com/games/war-thunder/

 

Give it a try and let me know what you think.

  • Upvote 1

Share this post


Link to post
Share on other sites

Hi,

 

How to setup War  Thunder? The octopus is moving, but I dont know where to see that in WT?

OK I found it ! Just enable "Rotation with head tracking"

 

An other question: Why, when I put my head down/up, raw data are corrects (only pitch is changing) in opentrack, but not the game data. Yaw and Roll are changing too ?!?!?!

Edited by GeekyFlea

Share this post


Link to post
Share on other sites

@GeekyFlea:
 

Edit:

First check that you have chosen "Freetrack 2.0" in the Protocol selection in Opentrack. This is the protocol that is used to communicate between OT and WT.

/Edit

 

 

Edit2:

I could reproduce this kind of situation by changing the Output remap to Disabled in Mappings. Please do the following to check it:

1. In Opentrack main screen press Stop

2. Lower right corner you see button "Mapping"

3. Choose tap "Options"

4. Check that under Output Remap you have Yaw, Pitch and Roll Enabled (if disabled, there is no tracking)

/Edit2

 

 

 

 

 

 

For me it worked instantly, i.e. no settings needed to be done in WT. Just launch the phone applications and Opentrack. Then go to test flight and it should work when turning your head.

 

If the Octopus is moving in your screen then I assume there is something in Opentrack setting or in War Thunder that prevents the communication.

 

To try that the communication between Opentrack and WT is working I think you could:
1. Configure a "Center view" button in OT settings

2. In WT test flight use the keyboard buttons to turn your view to left or right in a way it stays there

3. Press the Center View button configured above

=> If your view is centered towards the front, the communication works

 

 

It might be that there is setting per each control setup (Mouse aim, Simoplified, Realistic, Full Control) that tells that tracking is used in that particular setup. Check all the WT options and configurations for something like "Use HeadTracking with this configuration Y/N" or similar. I am not by my game PC so cannot check now.

Edited by iSteel

Share this post


Link to post
Share on other sites

I am developing an app that takes care of pretty much everything, headtracking AND display (so it is basically a very cheap alternative to gadgets like the Oculus Rift). You just need to add a Google Cardboard or better headmount and you can start playing War Thunder in VR using your phone.

 

The app is called Trinus VR, and you can find instructions on how to use (along with download links) here: http://trinusvr.com/games/war-thunder/

 

Give it a try and let me know what you think.

 

Nice. Will try and I will update my experience to your thread for Trinus VR:

http://forum.warthunder.com/index.php?/topic/233569-virtual-reality-battles-using-cardboard-and-trinus-vr-try-it/.

 

Edit: Tried it and it works very well ! I put a moment ago short experiences in your thread.

http://forum.warthunder.com/index.php?/topic/233569-virtual-reality-battles-using-cardboard-and-trinus-vr-try-it/#entry4969620

Edited by iSteel

Share this post


Link to post
Share on other sites

Hey, I need help here :(

 

I did everything you said, and the octopus is not moving. I tried checking everything (disable my firewall, making sure the ip is right, making sure the ports matched up) but it still didn't work.

 

I need help :(

 

It would really benefit me in Sim battles

Share this post


Link to post
Share on other sites

Hi,

 

I cannot help so much. Here is what I would do:

 

1. Check you have chosen Freepie UDP tracker in Opentrack window

2. Check that you have pressed Start in Opentrack window

3. Check you have pressed On in FreePIE IMU in your phone. Also "Send orientation" should be on, IP addess of your PC should be correct as well the port number should be same that configured in Opentrack.

 

 

If it does not work now, then the communication with your phone and PC is not working. I.e. FreePIE on your phone cannot communicate to Opentrack in your PC.

 

 

4. Check that you have turned off data connection from your phone. So only network you would use is your Wi-Fi.

5. Check the firewall

6. Check that your phone is connected to your router from your router status web page or such

7. Somehow figure out the IP address of your phone in your Wi-Fi and make sure you can see it from your PC

8. Try some other application that contacts your phone from your PC or other way around.

 

9. Do you know if your phone does not happen to have the movement censors? Turn on the Debug in FreepieIMU in your phone and you should see the numbers changing on your phone screen when you turn around your phone.

 

I hope this helps.

Share this post


Link to post
Share on other sites

I use your .ini setup with Aruco "printed 'computer vision' image" tracker, freetrack 2.0 and the Accela filter and it works amazing. Accela got rid of  all the screen shaking like my webcam was sitting on a vibrating device lol, that almost caused me to trash the project until I read the Accela smoothed out the shaking. 

 

Your .ini seemed to fix all the problems with head tracking I had experienced. I am curious, because I can even use 'Facetrack API or whatever' from FaceTrackNoIR.. what exactly did you change to make the yaw act more like a yaw as opposed to a combination of two or all of the yaw pitch and roll which it was using stock default.ini?

Share this post


Link to post
Share on other sites

  • Recently Browsing   0 members

    No registered users viewing this page.