How It Works
The UDP protocol:- Creates a UDP socket bound to any local address
- Packages 6DOF tracking data into a binary format
- Sends UDP datagrams to a configured IP address and port
- Data is sent in real-time with minimal overhead
Data Format
Each UDP packet contains 48 bytes of binary data:Use Cases
Custom Applications
Game Development
Integrate head tracking into your own game or application
Research Tools
Collect tracking data for analysis or machine learning
Visualization
Real-time visualization of head movements
Networked Tracking
Run OpenTrack on one PC, game on another
Integration Examples
- Unity/Unreal Engine: Read UDP data for camera control
- Python scripts: Process tracking data for analysis
- Arduino/Raspberry Pi: Control hardware based on head position
- OBS Studio: Dynamic camera control for streaming
- VR applications: Hybrid tracking systems
Setup Instructions
Configure network settings
Click the settings button next to the Output dropdown.Network configuration:
- IP Address: Destination IP (where to send data)
- Default:
192.168.0.2 - For same computer:
127.0.0.1 - For network: Enter target PC’s IP
- Default:
- Port: UDP port number
- Default:
4242 - Choose any available port (1024-65535)
- Default:
Start OpenTrack
Click Start. OpenTrack will:
- Bind a UDP socket
- Begin sending tracking data to configured address
- Send packets at tracking input rate (typically 50-60 Hz)
Configuration
Default Settings
Network Modes
Localhost (same computer):Receiving Data
Python Example
C++ Example
Unity C# Example
Data Interpretation
Coordinate System
Rotation (degrees):- Yaw: Left (-) / Right (+)
- Pitch: Down (-) / Up (+)
- Roll: Left (-) / Right (+)
- X: Left (-) / Right (+)
- Y: Down (-) / Up (+)
- Z: Back (-) / Forward (+)
Typical Value Ranges
| Axis | Typical Range | Units |
|---|---|---|
| Yaw | -180 to +180 | degrees |
| Pitch | -90 to +90 | degrees |
| Roll | -180 to +180 | degrees |
| X | -30 to +30 | cm |
| Y | -20 to +20 | cm |
| Z | -20 to +20 | cm |
Actual ranges depend on OpenTrack mapping settings. Users can configure custom ranges.
Troubleshooting
”Can’t bind socket” Error
Cause: Another application is using the port, or permission denied. Solution:- Check if another program is using the port:
- Windows:
netstat -ano | findstr :4242 - Linux:
netstat -tulpn | grep 4242
- Windows:
- Try a different port number
- Run OpenTrack as administrator
- Check firewall settings
Not Receiving Data
Symptoms: Application receives no UDP packets. Solution:- Verify OpenTrack is sending:
- Check OpenTrack status shows “Running”
- Verify settings show correct IP and port
- Check firewall:
- Add exception for OpenTrack
- Allow inbound UDP on chosen port
- Temporarily disable firewall to test
- Network connectivity:
- Ping target IP to verify connectivity
- Ensure both PCs on same network
- Check router doesn’t block UDP
- Wireshark capture:
- Use Wireshark to verify packets are being sent
- Filter:
udp.port == 4242
Wrong Byte Order
Symptoms: Values are nonsensical or extremely large. Cause: Byte order mismatch between sender and receiver. Solution:- OpenTrack sends in host byte order
- If sender and receiver have different architectures:
High Latency
Cause: Network congestion or WiFi interference. Solution:- Use wired Ethernet instead of WiFi
- Reduce other network traffic
- Check for packet loss with
pingstatistics - Consider lowering OpenTrack update rate
Packet Loss
Symptoms: Intermittent or choppy tracking. Solution:- UDP doesn’t guarantee delivery - this is normal
- For critical applications, implement your own packet numbering
- Monitor packet loss rate
- Consider TCP if reliability is required (custom implementation needed)
Advanced Usage
Multiple Receivers
Send to multiple destinations:- Use broadcast address:
- Or run multiple OpenTrack instances with different ports
- Or implement UDP forwarding in your receiver
Custom Protocol Extension
Add metadata to packets:Data Recording
Record tracking sessions:Performance Characteristics
Bandwidth Usage
At typical 60 Hz update rate:- Packet size: 48 bytes
- Packets per second: 60
- Bandwidth: ~23 Kbps
- With IP/UDP overhead: ~31 Kbps
Latency
Local (127.0.0.1):- Latency: <1ms
- Perfect for same-machine applications
- Latency: 1-3ms
- Excellent for networked setups
- Latency: 5-20ms
- May have jitter and packet loss
- Latency: Varies greatly
- Not recommended for real-time use
The UDP protocol provides maximum flexibility for custom applications and development. For standard gaming use cases, prefer FreeTrack or SimConnect protocols for better game compatibility.