buttons translation/freetrack rotation? (buttons to TrackIR)

Official forum for open source FreePIE discussion and development.
Post Reply
badfood
One Eyed Hopeful
Posts: 2
Joined: Tue Aug 16, 2016 10:37 am

buttons translation/freetrack rotation? (buttons to TrackIR)

Post by badfood »

Hey all,
First of all let me thank the devs/team behind freepie for the nice piece of software they are providing.
Nice work! Really!

As you can see from the subject im trying to use together, into a game supporting TrackIR (War Thunder), freetrack and freepie to provide respectively rotation and traslation of the point of view. I have a 2 DoF (single point) tracking system, because i think i wouldn't like translating with my body, so i'd like to bind such functionality to some buttons. The issue is that i cannot do it in game, since the game disables physical controls when a headtracking system is detected. So basically freetrack already deals natively with rotation without problems in game but i need to emulate X,Y,Z translations through freepie, making the game believe that they come from the TrackIR itself.

After reading some freepie docs i came up with this simple test example, which uses two mouse buttons to translate on the vertical axis:

Code: Select all

#initializations
if starting:
	Ydelta = 10
	trackIR.y = 0

#main loop updated at every iteration, mouse doesnt need update event handling
if (mouse.getPressed(4)):
	trackIR.y += Ydelta
elif (mouse.getPressed(3)):
	trackIR.y -= Ydelta

diagnostics.watch(mouse.getButton(3))
diagnostics.watch(mouse.getButton(4))
diagnostics.watch(trackIR.y)
Now, from the diagnostics i see that everything is working fine, i.e. the axis is incremented/decremented (even staying in game the buttons are captured by freepie, so its ok), but this has no effect in game. So my questions:
1. I dont know which values and unit of measure TrackIR translation expects, i tried with 10, 100, 1000... always the same... maybe thats not the right way? Do i have to apply some filters?
2. Is it even possible to do so? I mean, how does the application detect the TrackIR device and distinguish between freetrack/freepie?
3. Moreover in the registry i have HKEY_CURRENT_USER\Software\NaturalPoint\NATURALPOINT\NPClient Location with Freepie_RealPath and Path pointing to freetrack, and HKEY_CURRENT_USER\Software\Freetrack\FreetrackClient pointing there too... does it matter?
4. I also tried starting the game with freetrack disabled, just to test if it was going confused with more than one trackir client, but it seems it doesnt detect any TrackIR at all, since i can use some bindings that are usually disabled when a TrackIR is detected. So is freepie output TrackIR interface working in this case?

Ah, freepie is run as Administrator.

Thank you for your suggestions.
CyberVillain
Petrif-Eyed
Posts: 2166
Joined: Mon Jun 22, 2009 8:36 am
Location: Stockholm, Sweden

Re: buttons translation/freetrack rotation? (buttons to Trac

Post by CyberVillain »

trackIR.y -= Ydelta

This makes FreePIE believe you both want to read and write values from / to Trackir, you need to keep yoru own variables and then just set trackIR like

Code: Select all

y -= Ydelta
trackIR.y = y
edit: https://github.com/AndersMalmgren/FreeP ... in.cs#L144


diagnostics.watch(trackIR.y) will also confuse FreePIE because it thinks you want to read values from a real trackir.

edit2: hmm, seems like it can support both reading from a real trackir and fake at the same time, https://github.com/AndersMalmgren/FreeP ... gin.cs#L73
But that sounds confusing
badfood
One Eyed Hopeful
Posts: 2
Joined: Tue Aug 16, 2016 10:37 am

Re: buttons translation/freetrack rotation? (buttons to Trac

Post by badfood »

trackIR.y -= Ydelta

This makes FreePIE believe you both want to read and write values from / to Trackir, you need to keep yoru own variables and then just set trackIR like

Code: Select all

y -= Ydelta
trackIR.y = y
edit: https://github.com/AndersMalmgren/FreeP ... in.cs#L144
Uh didnt imagine there was such an issue... thanks for pointing it out.

Anyways i have fixed the code and keep the value stored in a variable and acces trackIR.y only as 'write'. But it is still not working...
Do you know what kind of unit of measure does trackIR.y expect? Maybe it's that? Im putting simple numbers varying them by one order of magnitude each time but still no results in game.
Also are you sure there is no conflict between the trackIR output exposed by freetrack and the one exposed by freepie? I'm just confused and curious about that... I mean, seems more like a developing question, but would this need something like injecting freepie output into the freetrack trackIR data stream or not? Is the application using trackIR protocol seeing these two inputs as if rotation coming from freetrack and translations coming from freepie were merged together into one unique 'virtual' trackIR input (as if there was just one trackIR device)?


diagnostics.watch(trackIR.y) will also confuse FreePIE because it thinks you want to read values from a real trackir.

edit2: hmm, seems like it can support both reading from a real trackir and fake at the same time, https://github.com/AndersMalmgren/FreeP ... gin.cs#L73
But that sounds confusing
Oh seems legit if i think about it... indeed it should read from a trackIR input, not its faked output, but it was doing it though.


Thanks for your support.
Post Reply

Return to “FreePIE”