Vizard 7 » Reference » Input Devices » Position and Orientation Trackers » DTrack
7.6

DTrack plug-in

This plug-in provides support for the A.R.T. DTrack motion tracking system.

Initialization

To use the plug-in with Vizard, you must first configure the DTrack software to send data to the IP address of the machine running Vizard, Settings > Output. The DTrack software can be configured to output the data into different coordinate systems, so you must specify in Vizard which coordinate system the DTrack is outputting. Within DTrack, open the Calibration > Room Adjustment dialog and take note of the right, up, and forward axes as seen in the image below:

The DTrack extension object has the following methods:

Method

Description

<dtrack>.addClient(address)

Connect to a DTrack server at specified IP address or hostname and return a DTrack client object.

The DTrack client object has the following methods:

Method

Description

<client>.setCoordinateSystem(axisRight, axisUp, axisForward)

Specify the right, up, and forward axes that DTrack is outputting. The axis values can be one of the following strings:

  • x
  • -x
  • y
  • -y
  • z
  • -z
<client>.getMarkerList() Returns a list of all the 3DOF markers on the server.
<client>.getBodyList() Returns a list of all the 6DOF bodies on the server.
<client>.getFlyStickList() Returns a list of all the 6DOF FlyStick input devices on the server.

The DTrack FlyStick objects have the following methods in addition to the standard extension sensor methods for providing position, orientation, and button values:

Method

Description

<flystick>.getThumbstick()

Returns the [x,y] thumbstick position. Each axis is in the [-1,1] range.

Example

The following example shows how to connect to a DTrack server and specify an X right, Z up, and Y forward coordinate system:

# Connect to DTrack server
dtrack = viz.add('dtrack.dle')
client = dtrack.addClient('192.168.0.10')
client.setCoordinateSystem('x', 'z', 'y')

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

import vizshape

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