natnet client for motive applications with pure python
Project description
natnet client for motive applications with pure python
Installation
python -m pip install new-natnet-client
How's
How it works on the background
-
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.
-
A request for connection is send
-
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
Release history Release notifications | RSS feed
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
Hashes for new_natnet_client-5.0.0-py3-none-any.whl
Algorithm | Hash digest | |
---|---|---|
SHA256 | d2124bc06cdf3528a46c3b24eea38f15bdb2e7cb0fed4f1a75884c2ec437b387 |
|
MD5 | b8e57b70cc634d63570ffcf09f8d8296 |
|
BLAKE2b-256 | 75207e7c2d7c721cb18d2c29e4a2ce798c2f71d813ab0dcb6564fe698e48e2cd |