FlyDangerous icon indicating copy to clipboard operation
FlyDangerous copied to clipboard

Open Track support (TrackIR / general headtracking etc)

Open jukibom opened this issue 4 years ago • 2 comments

jukibom avatar Jul 08 '21 21:07 jukibom

Freetrack

Here is the relevant source for a freetrack (Opentrack, FaceTrackNoIR, ...) UDP implementation: https://github.com/opentrack/opentrack/blob/master/proto-udp/ftnoir_protocol_ftn.cpp

Some py code to demonstrate consumption:

import socket, struct

sock = socket.socket(socket.AF_INET, socket.SOCK_DGRAM)
sock.bind(("127.0.0.1", 4242))
data = sock.recvfrom(48)[0]
for i, label in enumerate(["X:", "Y:", "Z:", "Yaw:", "Pitch:", "Roll:"]):
    print(label, (struct.unpack('d', data[i*8:(i+1)*8])[0]))

More on the topic and more examples: http://facetracknoir.sourceforge.net/Trackers/UDP.htm

TrackIR

My scribbles on how TrackIR (probably!) works are here - may be of help :-)

The relevant source most of this stems from is https://github.com/pizzaoverhead/KerbTrack/blob/master/KerbTrack/TrackIRClient.cs#L45

Please note that TrackIR v5 uses encrypted data streams that resulted in tools like TrackIRFixer to undo this. I'm not sure on the details but it may be just an option to enable some older compatibility mode. The TrackIRFixer page has a ton of information on the topic but I didn't bother to read it all (yet?) and also many dead links so this may be a waste of time.

bekopharm avatar Jul 09 '21 10:07 bekopharm

Partially reliant on #57 for basic implementation (3dof), this should ideally be a 6dof implementation but regular mouselook would provide at least a simple version

jukibom avatar Jul 09 '21 19:07 jukibom

findings:

  • TrackIR is a massive pain in the ass
  • FreeTrack protocol is a windows thing
  • OpenTrack webcam (and hardware) tracking is insanely good and UDP is brain dead simple (literally x y z pitch roll yaw packetID)

conclusion: OpenTrack UDP for now and hopefully that works with TrackIR or someone else has a go at it (I don't have the hardware to test)

jukibom avatar Oct 17 '22 21:10 jukibom

Update: Managed to get native TrackIR working too

jukibom avatar Oct 18 '22 16:10 jukibom

Works like a charm with OpenTrack (UDP Sender). Thank you so much for embracing open standards :heart:

bekopharm avatar Feb 23 '23 10:02 bekopharm

Works like a charm with OpenTrack (UDP Sender). Thank you so much for embracing open standards ❤️

Great to hear! :D

jukibom avatar Feb 23 '23 11:02 jukibom