Vizard 8 » Reference » Input Devices » Position and Orientation Trackers » PhaseSpace
8.0

PhaseSpace plug-in

This plug-in provides support for the PhaseSpace motion capture device. The PhaseSpace supports only position data.

Initialization

The PhaseSpace plug-in is implemented as a Vizard extension. When creating the PhaseSpace extension, you must specify the IP address or hostname of the PhaseSpace server as the mesg argument. You can also connect to the PhaseSpace server in slave mode by passing 1 as the command argument. Examples:

# Connect to server in Master mode
phasespace = viz.add('phasespace.dle', 0, '192.168.0.114')
# Connect to server in Slave mode
phasespace = viz.add('phasespace.dle', 1, '192.168.0.114')

The PhaseSpace extension object has the following methods:

Method

Description

<phasespace>.addMarker(id=-1)

Returns a 3DOF sensor with the specified id. If id is -1, the next available marker will be returned.

Example

The following example shows how to connect to a PhaseSpace server and retrieve the first marker:

#Connect to server at specified IP address
phasespace = viz.add('phasespace.dle',0,'192.168.0.114')

#Add first marker
marker = phasespace.addMarker()

The following example shows how to add 10 markers and link them to a node

for x in range(10):
    marker = phasespace.addMarker()
    ball = viz.add('white_ball.wrl',color=viz.RED,cache=viz.CACHE_CLONE)
    viz.link(marker,ball)