FreeTrack Forum

Welcome, you're not connected. ( Log in - Register )

RSS >  Freetrack through home network.., Increasing FPS.. Decreasing CPU load...
Nitro #1 17/01/2008 - 11h26

Class : Apprenti
Posts : 13
Registered on : 17/01/2008

Off line Www

Hi everybody!

I have AMD Barton 2500+ CPU  and some A4Tech webcam. My CPU load is about 40% when Freetrack is active.

Because of low FPS caused by CPU overload in the game (IL2) i was thinking about moving Freetrack and web camera to my notebook computer and send mouse output through the home network using Synergy software.

I succeed to bring movement from my head to my desktop computer in this way:

Head movement -> Web cam -> Freetrack (Notebook) -> Mouse movement (Notebook) -> Synergy server (Notebook) -> Network cable -> Synergy client (Desktop) -> Mouse movement (Desktop)...

In windows.. mouse movement works well, but when enter the game, all mouse movement from notebook given by Freetrack, notebook mouse and touchpad are very raggedly and not precise. :(

So.. does anyone tried something similar? I would like to hear if anybody have some idea why game don't understand both (desktop + notebook) mouse inputs in the same way, with the same precision and smoothing.

Also, is there some chance and useful software to help Freetrack to send its  output through the home network, but using "Direct game interface" option, because it will decrease webcam CPU load to zero. for people with more than one computer, at the same time it will be possible to send full 6DOF output from notebook, not just mouse XY.

Thanks a lot!
~S~
Edited by Nitro on 19/01/2008 at 16h48.
Deimos #2 18/01/2008 - 16h12

Class : Beta Tester
Posts : 120
Registered on : 07/11/2007

Off line

Hehe, i was thinking about the same thing to take the load off the CPU for using two webcams if something like this:
http://forum.free-track.net/index.php?showtopic=492
is implemented.
Anyway, would be great if FT could work in "slave" mode - not doing any actual tracking, but just receiving information from other instance of FT over LAN and generating proper output (direct game interface, ppjoy, mouse emulation) on the local machine.
usr #3 19/01/2008 - 04h09

Class : Apprenti
Posts : 43
Registered on : 30/11/2007

Off line

thanks for bringing that up, i've wanted to do this for quite a while now (IL2 is just way too sensitive to background CPU abuse).

i've always thought about way too complicated programming solutions, but your clever use of synergy made me realize that there had to be a solution around. and there is:

using glovepie (famous for wii controller abuse, it's so damn mighty that it could even be possible to implement a wii-freetrack just with the built-in formula support...) i was able to pipe the freetrack data through OSC (kind of a midi successor for LAN, very good support in glovepie) from one computer to the other, with an instance of glovepie on each side.

laptop (responsible for running freetrack, mine has a freshly hacked totally jitter free yet 100% responsive freetrackfilter mod, but that's another story, partially relevant for this one because it maybe takes a little more CPU) runs this simple script:

// this script takes the input from a real TrackIR
// and sends it through OSC

pie.FrameRate = 120Hz

// The port is a random number between about 50000 and 65000
// Just make sure it is set to the same number on the server
osc.port = 58436
osc.listening=true
osc.ip = "192.168.2.5" // ip of the computer that runs IL-2

// you can use whatever osc names you like here, (we chose netmouse.x)
// just make sure they are the same on the server
osc.TrackIR.x     = TrackIR.x  
osc.TrackIR.y     = TrackIR.y  
osc.TrackIR.z     = TrackIR.z  
osc.TrackIR.pitch = TrackIR.pitch
osc.TrackIR.yaw   = TrackIR.yaw  
osc.TrackIR.roll  = TrackIR.roll


// EDIT: this is the edited part
// here you can change the keys if for some reason you don't want
// freetrack on F11/F12
if(osc.recenter=1) key.f11=true else key.f11=false
if(osc.deactivate=1) key.f12=true else key.f12=false





and the game computer runs this one:
// this script reads input from a remote TrackIR and sends to game

// The Tir Application on this computer is
// controlled from the client computer

pie.FrameRate = 120Hz

// The port is a random number between about 50000 and 65000
// Just make sure it is set to the same number on the client
osc.ListenPort = 58436
osc.Listening = true
osc.ip = "192.168.2.2" // the ip of the computer that runs freetrack

// you can use whatever osc names you like here, (we chose netmouse.x)
// just make sure they are the same on the server
FakeTrackIR.x      = osc.TrackIR.x    
FakeTrackIR.y      = osc.TrackIR.y  
FakeTrackIR.z      = osc.TrackIR.z  
FakeTrackIR.pitch  = osc.TrackIR.pitch
FakeTrackIR.yaw    = osc.TrackIR.yaw  
FakeTrackIR.roll   = osc.TrackIR.roll

// Joystick2.Button3/5 happen to be my favourite freetrack pushthings,
// please replace as desired
if(Joystick2.Button5) osc.recenter=1 else osc.recenter=0
if(Joystick2.Button3) osc.deactivate=1 else osc.deactivate=0
debug = " ("+osc.TrackIR.x+","+osc.TrackIR.y+","+osc.TrackIR.z+") "+osc.TrackIR.pitch+", "+osc.TrackIR.yaw+", "+osc.TrackIR.roll


the IPs are obvious to change, the joystick buttons are for the recenter and (de)activate keys, replace for your favourite configuratoin

enjoy! (i'll do as soon as i hit send)
Edited by usr on 19/01/2008 at 20h25.
Nitro #4 19/01/2008 - 14h52

Class : Apprenti
Posts : 13
Registered on : 17/01/2008

Off line Www

Voila! :)

It took me about 5 mins to download and setup ....and it works great! Game view is now controlled through direct game interface :) GlovePie is very useful software.

Thank you guys for helping me! I hope more people will find this thing useful.

Thanks you usr also for writing this code, you make my day ;)
Edited by Nitro on 19/01/2008 at 14h53.
Nitro #5 19/01/2008 - 17h06

Class : Apprenti
Posts : 13
Registered on : 17/01/2008

Off line Www

Now, I just have a problem with re-centering. For this purpose, i am using F8 key on keyboard, and my stick button for centering is mapped to that key. But, for a some reason that doesn't work through this script. Maybe, there is some minor error in code that i can't see ;)

i made changes to code for centering in this way, hope it's ok:


...
if(Keyboard.F8) osc.recenter=1 else osc.recenter=0
if(Keyboard.F7) osc.deactivate=1 else osc.deactivate=0
...
usr #6 19/01/2008 - 20h16

Class : Apprenti
Posts : 43
Registered on : 30/11/2007

Off line

Two things:

#1: when both glovepie and your joystick profile try to juggle around with virtual keystrokes i would not be too surprised if one could fail to read the virtual keystrokes of the other. i went straight to reading joystick buttons, but had to disable my joybutton->keystroke profile before it worked.

#2: do the keys "pressed" by glovepie and the keys that freetrack listens to both match on your laptop?

#3: i only announced two things, but i found a third issue, and this it's quite likely that it is the only one:  i botched when copying the "laptop" script to my forum post,  it's an outdated version that happened to live on my main computer and does not really work.

please replace (on the "laptop" side) the lines

if(osc.recenter) say("received")
if(osc.recenter=1) debug="recenter" else debug="nichts"


with

if(osc.recenter) key.f11=true else key.f11=false
if(osc.deactivate) key.f12=true else key.f12=false


this is also where you would change the keys if you want your freetrack to listen to some other keys.

sorry for the inconvenience  :gene:
Edited by usr on 19/01/2008 at 20h21.
Nitro #7 20/01/2008 - 19h12

Class : Apprenti
Posts : 13
Registered on : 17/01/2008

Off line Www

Everything is perfectly now ;)

Thanks again! :)
francoistarlier #8 23/01/2008 - 00h19

Class : Habitué
Posts : 121
Registered on : 16/08/2007

Off line Www

this is really smart !!
Kestrel, are you thinking about this in the wishing list ? I'm also thinking about WideView User (maybe it's working allready with it though)
Nitro #9 24/01/2008 - 00h29

Class : Apprenti
Posts : 13
Registered on : 17/01/2008

Off line Www

There is the video I made, where you can see it in action.

Also, I replaced LEDs with reflective textile points on hat in combination with 6 IR illuminating LEDs mounted on A4Tech webcam.

http://veljovic.blogspot.com/2008/01/head-tracking-update.html
Nitro #10 12/02/2008 - 00h30

Class : Apprenti
Posts : 13
Registered on : 17/01/2008

Off line Www

Me again   :)

After a short time period, i found setup discussed above still working perfectly in IL2.

But i have question for usr, or someone else who knows, is there some code i should add to this script on local computer script to make this Freetrack emulation work with MS FSX?

Thanks a lot!
Edited by Nitro on 12/02/2008 at 00h31.
usr #11 12/02/2008 - 20h30

Class : Apprenti
Posts : 43
Registered on : 30/11/2007

Off line

sorry, i have absolutely no idea how fsx does the looking thing. my microsoft flight simulator experience lies almost exclusively in abusing the FS4 "airplane designer"  in attempts to build canard configurations that would make it off meigs peninsula in one piece or "roadworthy" supersonic jet cars (i was 12 or so)
Nitro #12 12/02/2008 - 23h21

Class : Apprenti
Posts : 13
Registered on : 17/01/2008

Off line Www

:D

everything is ok! i have tested freetrack on local machine and it works with no problems ;)
dimothy #13 16/12/2008 - 22h19

Class : Apprenti
Posts : 2
Registered on : 09/09/2008

Off line

Hey guys, there's one problem here - the script will only work with GlovePIE 0.30. As of this date the "official" webpage lacks a download link for this version, stating that Version 0.30 has serious bugs in the Wiimote code that prevent it from reading the Wiimote motion sensor calibration when IR is also used in the script. Please use version 0.29. A new version of GlovePIE should be released shortly. So, the solution is simply to download it from another place while the author comes up with an update.

The exact issue is that in previous versions, the "FakeTrackIR" variable is not defined, so you get "compile" errors on the respective lines in the script.

Cheers.
ginkgo #14 17/12/2008 - 12h08

Class : Apprenti
Posts : 28
Registered on : 11/07/2007

Off line

Thanks to dimothy for that new...i almost lost half of my hair trying to set it up.
eisenfpferd #15 17/01/2009 - 20h11

Class : Apprenti
Posts : 15
Registered on : 25/01/2008

Off line

Hi Folks,

this sounds very easy but it isn´t with FS2004.

I tried it and I can see the changing values in the debug line at the FS-part of glovepie but nothing happens in FS2004.

Did somebody test this with FS9?

Do I have to install something at the FS-side PC? Perhaps TrackIR or tirviews.dll or something with OSC?

It would be great to have a fiew fps more with this constallation.

Thanks for any answer

/eisenfpferd/

 >  Fast reply

Message

 >  Stats

1 user(s) connected during the last 10 minutes (0 member(s) and 1 guest(s)).