Skip to main content
The UDP protocol transmits raw head tracking data over a network using UDP packets. This is useful for custom applications, development, external tools, or networked tracking setups.

How It Works

The UDP protocol:
  1. Creates a UDP socket bound to any local address
  2. Packages 6DOF tracking data into a binary format
  3. Sends UDP datagrams to a configured IP address and port
  4. Data is sent in real-time with minimal overhead

Data Format

Each UDP packet contains 48 bytes of binary data:
Byte order: Native (host) byte order Packet size: 48 bytes No header or checksum - pure tracking 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

1

Select UDP protocol

In OpenTrack, go to the Output dropdown and select “UDP over network”.
2

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
  • Port: UDP port number
    • Default: 4242
    • Choose any available port (1024-65535)
3

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)
4

Receive data in your application

Implement UDP receiver in your application. See code examples below.

Configuration

Default Settings

Network Modes

Localhost (same computer):
Local network:
Remote/Internet:
For internet transmission:
  • Configure port forwarding on router
  • Use firewall exceptions
  • Consider security implications of exposing UDP port
  • Data is sent unencrypted

Receiving Data

Python Example

C++ Example

Unity C# Example

Data Interpretation

Coordinate System

Rotation (degrees):
  • Yaw: Left (-) / Right (+)
  • Pitch: Down (-) / Up (+)
  • Roll: Left (-) / Right (+)
Position (centimeters):
  • X: Left (-) / Right (+)
  • Y: Down (-) / Up (+)
  • Z: Back (-) / Forward (+)

Typical Value Ranges

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:
  1. Check if another program is using the port:
    • Windows: netstat -ano | findstr :4242
    • Linux: netstat -tulpn | grep 4242
  2. Try a different port number
  3. Run OpenTrack as administrator
  4. Check firewall settings

Not Receiving Data

Symptoms: Application receives no UDP packets. Solution:
  1. Verify OpenTrack is sending:
    • Check OpenTrack status shows “Running”
    • Verify settings show correct IP and port
  2. Check firewall:
    • Add exception for OpenTrack
    • Allow inbound UDP on chosen port
    • Temporarily disable firewall to test
  3. Network connectivity:
    • Ping target IP to verify connectivity
    • Ensure both PCs on same network
    • Check router doesn’t block UDP
  4. 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 ping statistics
  • 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:
  1. Use broadcast address:
  2. Or run multiple OpenTrack instances with different ports
  3. 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
Very low bandwidth - suitable for network transmission.

Latency

Local (127.0.0.1):
  • Latency: <1ms
  • Perfect for same-machine applications
LAN (wired):
  • Latency: 1-3ms
  • Excellent for networked setups
LAN (WiFi):
  • Latency: 5-20ms
  • May have jitter and packet loss
Internet:
  • 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.