Vizard 8 » Reference » Input Devices » Position and Orientation Trackers » OptiTrack
8.1

OptiTrack plug-in

This plug-in provides support for the OptiTrack Motive motion capture system.

Initialization

To use the plug-in with Vizard, you must first configure the OptiTrack Motive software to properly stream data. Within Motive, open the View > Data Streaming Pane and make sure the following settings are applied:

The OptiTrack extension object has the following methods:

Method

Description

<optitrack>.addMotive(address)

Connect to an OptiTrack Motive server at specified IP address or hostname and return a motive object.

The OptiTrack motive object has the following methods:

Method

Description

<motive>.getMarkerList()

Returns a list of all the 3DOF markers on the server.

<motive>.getMarker(val) Returns the marker with the given name or index. The name is case sensitive.
<motive>.getMarkerSetDict() Returns a dictionary mapping a marker set name to the list of markers.
<motive>.getMarkerSet(name) Returns a list of all the 3DOF markers associated with the specified marker set. The name is case sensitive.
<motive>.getBodyList() Returns a list of all the 6DOF bodies on the server.
<motive>.getBody(val)

Returns the body with the given name or index. The name is case sensitive.

<motive>.getSkeletonList() Returns a list of all the skeletons on the server.
<motive>.getSkeleton(val) Returns the skeleton with the given name or index. The name is case sensitive.
<motive>.getFrameNumber() Returns the frame number associated with the last received frame of data.

The OptiTrack marker objects have the following methods in addition to the standard extension sensor methods:

Method

Description

<marker>.getMarkerSetName()

Returns the name of the marker set the marker belongs to.

The OptiTrack body objects have the following methods in addition to the standard extension sensor methods:

Method

Description

<body>.getMarkerList()

Returns a list of all the 3DOF markers belonging to the body.

<body>.getMarker(val) Returns the marker with the given name or index that belongs to the body. The name is case sensitive.

The OptiTrack skeleton objects have the following methods in addition to the standard extension sensor methods:

Method

Description

<skeleton>.getMarkerList()

Returns a list of all the 3DOF markers belonging to the skeleton.

<skeleton>.getMarker(val) Returns the marker with the given name or index that belongs to the skeleton. The name is case sensitive.
<skeleton>.getBodyList() Returns a list of all the 6DOF bodies belonging to the skeleton.
<skeleton>.getBody(val) Returns the body with the given name or index that belongs to the skeleton. The name is case sensitive.

Example

The following example shows how to connect to an OptiTrack Motive server:

#Connect to OptiTrack Motive server
optitrack = viz.add('optitrack.dle')
motive = optitrack.addMotive('192.168.0.114')

The code below shows how to iterate through all the body objects and link each one to a node:

import vizshape

for body in motive.getBodyList():
    axes = vizshape.addAxes(length=0.1)
    viz.link(body, axes)