Skip to content

Python client for Optitrack cameras. Support for local and remote server.

License

Notifications You must be signed in to change notification settings

toinsson/pynatnetclient

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

27 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

pynatnetclient

Python client for Optitrack cameras.

Adapted from the sample provided in the NatNet client SDK, this client also includes an option for Optitrack servers running on remote machines, which was developed based on the feedback from this forum thread.

usage

When the Optitrack server is running on the same machine as the data consumer:

from pynatnetclient import NatNetClient

nnc = NatNetClient()  # connect to a local server by default
nnc.run()             # start the listening thread

with nnc.ed.lock:     # access thread-safe data
    print(nnc.ed.frameNumber)

nnc.close()           # close the listening thread

When the Optitrack server is streaming over the network, the server and client address are required:

client_address = 192.168.0.10
server_address = 192.168.0.11

nnc = NatNetClient(client_address, server_address)  # connect to a remote server

OBS: The data that is currently exposed through the class ExposedData only relates to labeled markers:

class ExposedData(object):

    frameNumber
    labeledMarkerCount
    labeledMarker
    timestamp
    stampCameraExposure
    stampDataReceived
    stampTransmit

changes

  • split the code in separate classes
  • create a package and add a setup.py file
  • replace the tracing function with logging
  • add remote server functionality
  • remove callback function for data access
  • implement a local datastore

The original files from the SDK are included in the legacy folder.

About

Python client for Optitrack cameras. Support for local and remote server.

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages