Vizard 8 » Tutorials & Examples » Vizconnect » Displays and Trackers » Tutorial: Trackers
8.0

Tutorial: vizconnect Trackers

In this tutorial you'll learn how to access a tracker from the script and apply tracker offsets from the Vizconnect GUI.

Note: This section continues with the configuration and script used in the previous section.

Getting a Tracker

From the Trackers tab, click Add a New Tracker and select the Keyboard option. You can find the full list of keys used to control this 6DoF tracker in the Info pane.

 

Add the following lines of code to the script. This gets a handle to the tracker by the name assigned to it in the GUI and then links an axes model to it:

keyTracker = vizconnect.getTracker('keyboard').getNode3d()

import vizshape
axes = vizshape.addAxes()

viz.link(keyTracker,axes)

Run the script and you will see that the axes model's initial position is beneath the viewpoint. The reason is that the key tracker starts at the origin [0,0,0] while the walking tracker has a fixed Y position to simulate a user's eyeheight and starts at [0,1.82,0]. Use the WASD keys to move the axes forward/backards and left/right.

Tracker Offsets

It certain cases it can be useful to add a position or rotation offset to a tracker. For example, to offset the position of a tracker with an origin off the ground or to cancel the magnetic offset of an inertial orientation sensor.

 

Select the Keyboard tracker in the GUI and open the Offsets dialog box. The following offsets will add 1 meter to the Y data, 4 meters to the Z data, and 30 degrees to the yaw. Click Apply and Exit after changing the values.

Run the script again and the axes model will have a new starting position and orientation.

Tracker and Display Basics

Trackers

Displays