python-optirx /

Filename Size Date modified Message
6 B
Fixed byte order for latency and timestamp (changed from big-endian to native)
1.1 KB
update copyright year and README
34 B
1.5 KB
update copyright year and README
671 B
helper script to dump binary Motive packets for testing
16.1 KB
remove commented print statement left in PR
1.6 KB
Revert "Improved optirx_demo script"
1.4 KB
bump version number 0.2 -> 0.3.dev1
377 B
test only on Python 2.7 and Python 3.4 by default


A pure Python library to receive motion capture data from OptiTrack Streaming Engine.

OptiTrack is a line of motion capture products by NaturalPoint. Their software can broadcast motion capture data via a documented binary protocol. It is supposed to be used together with the proprietary NatNet SDK, which, unfortunately, is not available for Python, nor cannot be used with free toolchains (GCC, Clang). OptiRX is based on the direct depacketization example from the SDK and does not use NatNet SDK.


pip install optirx


Tracking Tools 2.5.0; Motive 1.5.x (NatNet, 1.7.x (NatNet

Build Status

build status


Assuming that Tracking Tools or Motion runs on the same machine and broadcasting is enabled with the default parameters, this code receives and prints all data frames:

import optirx as rx

dsock = rx.mkdatasock()
version = (2, 7, 0, 0)  # NatNet version to use
while True:
    data = dsock.recv(rx.MAX_PACKETSIZE)
    packet = rx.unpack(data, version=version)
    if type(packet) is rx.SenderData:
        version = packet.natnet_version
    print packet


  • use VRPN streaming protocol.
  • use Matlab or Microsoft toolchains.
  • use PyNatNet and NatNet SDK