Skip to main content

natnet client for motive applications with pure python

Project description

Poetry PyPI - Python Version PyPI - License Code style: black Statically typed: mypy


natnet client for motive applications with pure python


Installation

python -m pip install new-natnet-client

How's

How it works on the background

  1. When you try to connect to the motive application a background thread is started, in this thread is where all the data is received and unpacked.

  2. A request for connection is send

  3. If the motive application responds then the client starts working as expected. If a timeout value was set and no response was received on time, then the background thread stops.

How is data represented

The data received is converted to frozen and inmutable instances of the corresponding dataclass

How to read Motion Capture Data (MoCap) / frames

How stated before all data is received on the background, this means that reader must be synchronize for reading only when new data is received.

There are 2 ways to read:

1. Synchronous:

def foo():
    with NatNetClient(NatNetParams(...)) as client: # Create client
        if client is None: return # Make sure client connected successfully
        for frame_data in client.MoCap(): # Start reading data
            ...

2. Asynchronous:

async def foo():
    with NatNetClient(NatNetParams(...)) as client:
        if client is None: return
        async for frame_data in client.MoCapAsync():
            ...

From NATNET

This package provides the client for using Optitrack's NatNet tracking system, with type hints for python.

The NatNet SDK is a simple Client/Server networking SDK for sending and receiving data from Motive across networks. NatNet uses the UDP protocol in conjunction with either multicasting or point-to-point unicasting for transmitting data.

A list of changes made in each version can be found at the following website: https://www.optitrack.com/support/downloads/developer-tools.html

More about NatNet: https://docs.optitrack.com/developer-tools/natnet-sdk


Disclaimer: I have no relationship with Optitrack


Project details


Download files

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

Source Distribution

new_natnet_client-5.0.0.tar.gz (12.5 kB view hashes)

Uploaded Source

Built Distribution

new_natnet_client-5.0.0-py3-none-any.whl (13.9 kB view hashes)

Uploaded Python 3

Supported by

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