This plug-in provides support for Trackd tracker and controller devices.
The Trackd plug-in is implemented as a Vizard extension, with the following methods/constants:
Method |
Description |
<trackd>.addTracker(key,sensor=0) |
Returns the tracker at the specified shared memory key. If the tracker supports multiple sensors, you can specify which sensor to return. If sensor is set to the <trackd>.SENSOR_ALL flag, then a list of all sensors at the specified key will be returned. |
<trackd>.addController(key) |
Returns the controller at the specified shared memory key. |
<trackd>.SENSOR_ALL |
Flag that can be passed as the sensor argument to the <trackd>.addTracker command, causing it to return all sensors on the specified key. |
The Trackd tracker and controller objects are standard extension sensor objects. The tracker objects contain 6DOF position and orientation data. The controller objects provide raw data and button events.
The following example shows how to create the Trackd extension:
This example shows how to connect to 2 Trackd sensors at key 1000 and one sensor at key 1001:
The next example shows how to connect to all Trackd sensors at key 4000 and print the position of each sensor:
The following code shows how to connect to a Trackd controller at key 2000, print the raw data, and handle button events from the controller: