Giter Club home page Giter Club logo

poapi's Introduction

Poapi

Python module and shell interface for the NDI Optotrak API

Python usage

Example usage of the module:

#!/usr/bin/env python
import poapi

optotrak = poapi.Poapi()
print optotrak.OAPIGetVersionString()

a fully functional script:

#!/usr/bin/env python
import poapi, time

optotrak = poapi.Poapi()
optotrak.TransputerInitializeSystem()
optotrak.OptotrakLoadCameraParameters("standard")
optotrak.OptotrakActivateMarkers()
time.sleep(1)
print (optotrak.DataGetLatest3D())

Usually the python functions are called the same way as the original C functions. Sometimes we use the additional capabilities of Python. A few examples:

C:

char s[1024]
OptoGetLastError(s, 1024)
// nu bevat s de error string

Python:

s = OptoGetLastError()

C:

float a = 1.0, b = 2.0;
OdauSetAnalogOutputs(ODAU2, a, b, 0)
// nu zijn  a en b gewijzigd in de nieuwe waarden, bijvoorbeeld 3.0 en 4.0

Python:

a, b = OdauSetAnalogOutputs(2, 1.0, 2.0, 0) 

Shell usage

You can also use the shell directly, without python. Execute the poapi program from the command line and start typing your functions. Function output will appear on the next line.

terra:Poapi> ./poapi
TransputerDetermineSystemCfg()
0
TransputerLoadSystem()
0

Ethernet

An additional script is present to find the ip-address of the optotrak scu for use in the optotrak ini file:

terra:Poapi> ./findScu.pl
scan range: 131.174.111.26/24 for Northern Digital
Northern Digital SCU, IP: 131.174.111.1, MAC: e8:39:35:39:03:d1

poapi's People

Contributors

wilberth avatar

Watchers

 avatar  avatar

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.