Skip to content

The purpose of this repository is to obtain and process data emitted by the natnet server from opentracking

License

Notifications You must be signed in to change notification settings

lunarring/NatNetSDK_4.1.0

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

22 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Dependencies Status

Security: bandit Pre-commit Semantic Versions License

NatNet-SDK (4.1.0.0)

Motion tracking client for optitracks systems.

Installation

Python

pip install git+https://github.com/lunarring/NatNetSDK_4.1.0.git

Poetry

poetry add git+https://github.com/lunarring/NatNetSDK_4.1.0.git

Documentation

What is NatNet-SDK?

NatNet SDK is a library that allows you to communicate with the NatNet Server and retrieve data from the server. This library has been created to work with the NatNet protocol and is used to retrieve data from the server.

What Function i have in NatNet-SDK?

How to import

from natnetpacket.NatNetClient import NatNetClient

client = NatNetClient()

How to set the connection parameter's ?

client.set_client_address(optionsDict["clientAddress"]) # Set local IPv4 from the machine you are using to communicate to the NatNet Server 
client.set_server_address(optionsDict["serverAddress"]) # Set the server IPv4 from the machine running the NatNet Server
client.set_use_multicast(optionsDict["use_multicast"]) # MultiCast (True) / UniCast (False)

How to receive the data from the Server?

NatNet Client work's based on callback function and to set the function is:

def receive_new_frame(data_dict : Dict) -> None:
    '''
    {
        "frame_number" : int  # Contains the frame ID of the current iteration
        "marker_set_count" : int  # Number of marker sets in the data
        "unlabeled_markers_count" : int  # Number of unlabeled markers in the data
        "rigid_body_count" : int  # Number of rigid bodies in the data
        "skeleton_count" : int  # Number of skeletons in the data
        "asset_count" : int  # Number of assets in the data
        "labeled_marker_count" : int  # Number of labeled markers in the data
        "timecode" : float  # Timecode of the data
        "timecode_sub" : float  # Subtimecode of the data
        "timestamp" : float  # Timestamp of the data
        "is_recording" : bool  # Indicates if the data is being recorded
        "tracked_models_changed" : tracked_models_changed  # Indicates if the tracked models have changed
        "mocap_data" : MoCapData  # Mocap data for the current frame (all the information send by the system)
    }
    '''

client.new_frame_listener = receive_new_frame

How to start retrieving data from the server

is_running = streaming_client.run() # -> bool

Authors

[Coder]

[Lab]

About

The purpose of this repository is to obtain and process data emitted by the natnet server from opentracking

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Python 100.0%