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

Vicon plug-in

This plug-in provides support for the Vicon motion capture device. The Vicon supports both position and rotation data.

Initialization

The Vicon plug-in is implemented as a Vizard extension. When creating the Vicon extension, you must specify the IP address or hostname of the Vicon server as the 'mesg' argument. You can also specify the port number by adding a ':' followed by the port number to the address string. The default port is 800.

 

The Vicon extension object has the following methods:

Method

Description

<vicon>.getMarkerList()

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

<vicon>.getBodyList()

Returns a list of all the 6DOF bodies on the server.

<vicon>.getMarker(val)

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

<vicon>.getBody(val)

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

The Vicon marker/body objects are standard extension sensors.

Example

The following example shows how to connect to a Vicon server and get a handle to the first body and marker. It will also print out the name of the body and marker objects:

vicon = viz.add('vicon.dle',0,'192.168.0.114')
body = vicon.getBody(0)
marker = vicon.getMarker(0)

print( body.getName())
print( marker.getName())

The following example shows how to iterate through all the marker objects and link each one to a node:

for m in vicon.getMarkerList():
    ball = viz.add('white_ball.wrl',color=viz.RED,cache=viz.CACHE_CLONE)
    viz.link(m,ball)

You can also connect to multiple Vicon servers simultaneously. The next example connects to two different servers and prints the body names of each server:

vicon1 = viz.add('vicon.dle',0,'media3')

for b in vicon1.getBodyList():
    print( b.getName())
   
vicon2 = viz.add('vicon.dle',0,'dev15')

for b in vicon2.getBodyList():
    print( b.getName())