Skip to main content

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

Project description

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.

Install

pip install optirx

Compatibility

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

Usage

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

Alternatives

  • use VRPN streaming protocol.

  • use Matlab or Microsoft toolchains.

  • use PyNatNet and NatNet SDK

License

MIT

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distributions

optirx-1.9.zip (13.3 kB view details)

Uploaded Source

optirx-0.3.tar.gz (8.5 kB view details)

Uploaded Source

File details

Details for the file optirx-1.9.zip.

File metadata

  • Download URL: optirx-1.9.zip
  • Upload date:
  • Size: 13.3 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for optirx-1.9.zip
Algorithm Hash digest
SHA256 5ffe807e1fe2bd3e30e39c5ccf09447f34ddfafa7e943ec19f4ba318f19d8cba
MD5 aecf9388c0198ddc15c786cde4e1b967
BLAKE2b-256 a46ab796f3b9d5ce0e2a7577ba20864987f6943657e3817dc74bb61db740bbb0

See more details on using hashes here.

File details

Details for the file optirx-0.3.tar.gz.

File metadata

  • Download URL: optirx-0.3.tar.gz
  • Upload date:
  • Size: 8.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No

File hashes

Hashes for optirx-0.3.tar.gz
Algorithm Hash digest
SHA256 360426130bf3d8babaab670b3f96bad0c64d7928dd3206380aaf74cc56966e78
MD5 d64440bb4b3f59ae77574a7f859794e6
BLAKE2b-256 e40fa4259a1abdd6b1b3efa1d00425e04e098a7703ed35972f1fae37054bd7e4

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page