FlyDangerous
FlyDangerous copied to clipboard
Open Track support (TrackIR / general headtracking etc)
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.
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
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)
Update: Managed to get native TrackIR working too
Works like a charm with OpenTrack (UDP Sender). Thank you so much for embracing open standards :heart:
Works like a charm with OpenTrack (UDP Sender). Thank you so much for embracing open standards ❤️
Great to hear! :D