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

InterSense plug-in

This plug-in provides support for the InterSense family of tracking devices. All devices support orientation data. Position data is only available with the following devices:

 

IS-600

IS-900

IS-1200

 

The IS-900 also supports button and analog data.

Initialization

The InterSense plug-in is implemented as a Vizard extension. Once the InterSense extension is added, the following methods/constants are available on the extension object:

Method

Description

<isense>.addTracker(port=0, station=0)

Returns the next available InterSense sensor connected on specified port and with specified station ID. If port is 0, then the first available InterSense device is used. If station is 0, then the first available station is used.

<isense>.getTrackerList() Returns a list of all detected InterSense trackers.

Note: When connecting to inertial devices, such as the InertiaCube, the device needs to be still while connecting. If the device is moving while trying to connect, there will be some drift in the data.

The InterSense sensor objects have the following methods in addition to the standard extension sensor methods (See the InterSense documentation for a more detailed explanation of all the settings):

Method

Description

<sensor>.resetHeading()

Reset the heading of the sensor so the current heading is 0.

<sensor>.getStationNumber() Returns the station number of the sensor.

<sensor>.getJoystickPosition()

Returns the [x,y,z] position of the attached joystick, if available.

 

X ranges from -1.0 (left) to +1.0 (right). Y ranges from -1 (up) to +1.0 (down). Z is set to 0.0.

<sensor>.setCompass(mode)

<sensor>.getCompass()

Set/Get the compass mode of the sensor.

 

0 or 2 for OFF or ON. Setting 1 is not in use and will have the same result as ON. Compass setting is ignored if station is configured for Fusion Mode operation.

<sensor>.setEnhancement(mode)

<sensor>.getEnhancement()

Set/Get the enhancement mode of the sensor:

 

levels 0, 1, or 2

<sensor>.setPrediction(mode)

<sensor>.getPrediction()

Set/Get the prediction mode of the sensor:

 

0 to 50 ms

<sensor>.setSensitivity(mode)

<sensor>.getSensitivity()

Set/Get the sensitivity mode of the sensor:

 

levels 1 to 4

<sensor>.setCompassCompensation(mode)

<sensor>.getCompassCompensation()

Set/Get the compass compensation mode of the sensor:

 

This setting controls how Magnetic Environment Calibration is applied. This Callibration calculates nominal field strength and dip angle for the environment in which sensor is used. Based on these values system can assign weight to compass measurements, allowing for bad measurements to be rejected. Values from 0 to 3 are accepted. If CompassCompensation is set to 0, the calibration is ignored and all compass data is used. Higher values result in tighter rejection threshold, resulting in more measurements being rejected. If sensor is used in an environment with a lot of magnetic inteference this can result in drift due to insuficient compensation from the compass data. Default setting is 2.

<sensor>.setShockSuppression(mode)

<sensor>.getShockSuppression()

Set/Get the shock suppression mode of the sensor:

 

This setting controls how the system deals with sharp changes in IMU data that can be caused by shock or impact. Sensors may experience momentary rotation rates or accelerations that are outside of the specified range, resulting in undesirable behaviour. By turning on shock suppression you can have the system filter out corrupted data. Values 0 (OFF) to 2 are accepted, with higher values resulting in greated filterring.

<sensor>.setAccelSensitivity(mode)

<sensor>.getAccelSensitivity()

Set/Get the acceleration sensitivity mode of the sensor:

 

AccelSensitivity is used for 3-DOF tracking with InertiaCube products only. It controls how fast tilt correction, using accelerometers, is applied. Valid values are 1 to 4, with 2 as default. Default is best for head tracking in static environment, with user seated. Level 1 reduces the amount of tilt correction during movement. While it will prevent any effect linear accelerations may have on pitch and roll, it will also reduce stability and dynamic accuracy. It should only be used in situations when sensor is not expected to experience a lot of movement. Level 3 allows for more aggressive tilt compensation, appropriate when sensor is moved a lot, for example, when user is walking for long durations of time. Level 4 allows for even greater tilt corrections. It will reduce orientation accuracy by allowing linear accelerations to effect orientation, but increase stability. This level is appropriate for when user is running, or in other situations when sensor experiences a great deal of movement.

Example

The following example shows how to create the InterSense extension:

isense = viz.add('intersense.dle')

This example shows how to connect to an InterSense device on COM1:

tracker = isense.addTracker(port=1)

This example shows how to connect to 2 devices on COM1 and COM2:

tracker1 = isense.addTracker(port=1)
tracker2 = isense.addTracker(port=2)

This example shows how to connect to 2 stations of an IS-900 on COM1:

station1 = isense.addTracker(port=1,station=1)
station2 = isense.addTracker(port=1,station=2)

The following code shows how to get and print analog data from trackers that provide it:

data = tracker.getData()
print(data )

Some trackers provide button data. Here is code that shows how to handle button events from an InterSense tracker:

def onSensorDown(e):
    if e.object is tracker:
        print('Button',e.button,'down')
viz.callback(viz.SENSOR_DOWN_EVENT,onSensorDown)

def onSensorUp(e):
    if e.object is tracker:
        print('Button',e.button,'up')
viz.callback(viz.SENSOR_UP_EVENT,onSensorUp)