Haptic device settings in H3D

From H3D.org

Jump to: navigation, search

Contents

Device settings

Once H3DAPI is installed, the settings for haptic devices can be accessed from H3DLoad Settings ($H3D_ROOT/settings/SettingsGUI.py or, on Windows, by default it is at Start menu > H3DAPI > H3DLoad settings). The "Haptics device" list contains all devices supported by H3D. Once a device is selected H3D will search and initialize the first matching device connected to the system. The AnyDevice option automatically selects one device from those connected.

Selecting a "Default stylus" option changes the graphical representation of the stylus in an H3D scene.


Customizing look of stylus

To add a custom stylus representation, simply create a model in X3D and save the file in the $H3D_ROOT/settings/common/stylus folder. The file will be added to the list of options in "Device stylus". For examples, open up the files in $H3D_ROOT/settings/common/stylus in a text editor to see how they are written.


Using multiple devices

In an H3D scene, information on haptics devices are stored in the DeviceInfo node. When you select a device from H3DLoad Settings you are actually selecting a pre-written DeviceInfo. All the different DeviceInfos are located in $H3D_ROOT/settings/common/device. To use multiple devices, either define a DeviceInfo directly in the H3D scene, or add a DeviceInfo file to this folder. When the file is added, the new device information will appear in H3DLoad Settings.

The example code below specifies a Novint Falcon and a Force Dimension device. Notice that different renderers may be used for different devices.

 
<DeviceInfo>
  <ForceDimensionDevice positionCalibration="4 0 0 0
                                             0 4 0 0
                                             0 0 4 0
                                             0 0 0 1">
    <RuspiniRenderer/>
  </ForceDimensionDevice>
  <FalconDevice positionCalibration="5 0 0 0
                                     0 5 0 0
                                     0 0 5 0
                                     0 0 0 1">
    <GodObjectRenderer/>
  </FalconDevice>
</DeviceInfo>
 

Using multiple devices from the same manufacturer

The following instructions apply to devices which have been connected and installed.

SensAble

To set up multiple SensAble Phantom devices in H3D, the following steps apply:

  1. Go to PHANToM Configuration > Hardware. From the PHANToM drop-down menu, select a device name. If there are no additional names, or to add your own name, click Add... to do so.
  2. From the Serial number drop-down menu, select a serial number to correspond to the name.
  3. Repeat steps 1 and 2 until all devices correspond to a name.
  4. Click OK.
  5. Create a new text file with DeviceInfo for multiple devices as in Using multiple devices. Set the deviceName field values of PhantomDevice to the device names which were specified with PHANToM Configuration in steps 1 to 4. Example:
     
    <DeviceInfo>
      <PhantomDevice deviceName="P1" positionCalibration="3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 1">
        <OpenHapticsRenderer/>
      </PhantomDevice>
      <PhantomDevice deviceName="P2" positionCalibration="3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 1">
        <OpenHapticsRenderer/>
      </PhantomDevice>
    </DeviceInfo>
     
  6. Save the file to $H3D_ROOT/settings/common/device
  7. Image:Note-tip.pngIt can also be saved to $H3D_ROOT/settings/display/ and in the respective immersive workbench directories.
  8. On H3DLoad Settings, from the Haptics device drop-down menu, select the new device configuration.
  9. Image:Note-tip.pngH3DLoad Settings is found at $H3D_ROOT/settings/SettingsGUI.py or, on Windows, by default it is at Start menu > H3DAPI > H3DLoad settings.)

Force Dimension

Image:Note-warning.pngDual setup for Force Dimension requires HAPI trunk (revision 440) or HAPI branch 1.0.1 (revision 441). This feature is not included in the releases H3DAPI 2.0 and HAPI 1.0.

To set up multiple Force Dimension devices in H3D, the following steps apply:

  1. Create a new text file with DeviceInfo for multiple devices as in Using multiple devices. Example:
     
    <DeviceInfo>
      <ForceDimensionDevice positionCalibration="3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 1">
        <RuspiniRenderer/>
      </ForceDimensionDevice>
      <ForceDimensionDevice positionCalibration="3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 1">
        <GodObjectRenderer/>
      </ForceDimensionDevice>
    </DeviceInfo>
     
  2. Save the file to $H3D_ROOT/settings/common/device
  3. Image:Note-tip.pngIt can also be saved to $H3D_ROOT/settings/display/ and in the respective immersive workbench directories.
  4. On H3DLoad Settings, from the Haptics device drop-down menu, select the new device configuration.
  5. Image:Note-tip.pngH3DLoad Settings is found at $H3D_ROOT/settings/SettingsGUI.py or, on Windows, by default it is at Start menu > H3DAPI > H3DLoad settings.)

Novint

To set up multiple Novint Falcon devices in H3D, the following steps apply:

  1. Make sure only one Falcon device is plugged in.
  2. Go to the Novint installation directory. Run Falcon/TestUtilities/FalconTest/FalconTest.exe. Copy the serial number of the device.
  3. Repeat steps 1 and 2 for all the devices.
  4. Open Falcon/HDAL/config/hdal.ini. Change MANUFACTURER_NAME values to the device serial numbers.
  5. Save and close hdal.ini.
  6. Create a new text file with DeviceInfo for multiple devices as in Using multiple devices, with respective deviceName. Example:
     
    <DeviceInfo>
      <FalconDevice deviceName="FALCON_1" positionCalibration="3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 1">
        <GodObjectRenderer/>
      </FalconDevice>
      <FalconDevice deviceName="FALCON_2" positionCalibration="3 0 0 0 0 3 0 0 0 0 3 0 0 0 0 1">
        <RuspiniRenderer/>
      </FalconDevice>
    </DeviceInfo>
     
  7. Save the file to $H3D_ROOT/settings/common/device
  8. Image:Note-tip.pngIt can also be saved to $H3D_ROOT/settings/display/ and in the respective immersive workbench directories.
  9. On H3DLoad Settings, from the Haptics device drop-down menu, select the new device configuration.
  10. Image:Note-tip.pngH3DLoad Settings is found at $H3D_ROOT/settings/SettingsGUI.py or, on Windows, by default it is at Start menu > H3DAPI > H3DLoad settings.)


Calibrating haptic devices on the immersive workbench

Co-located calibration

Calibration of haptics device on the immersive workbench can done using the Calib tool in the Candy toolkit by Karljohan Lundin Palmerius. Calib is downloadable from H3D.org. Check out this video on how to do the calibration.

Calibrating by editing DeviceInfo

Calibration may also be done by editing the positionCalibration and orientationCalibration fields of the H3DHapticsDevice node. The positionCalibration matrix is multiplied by the devicePosition to obtain the trackerPosition in world coordinates, as orientationCalibration is to trackerOrientation and trackerOrientation.

Hence for a 3-DOF input haptics device, calibration may be done by editing the value of positionCalibration. For example, suppose the user has a 3DOF input device placed directly facing him i.e. the direction of the z-axis of the device space points towards the user. Suppose the original value of positionCalibration is M. When the entire device is placed at a 45 degree angle to this position, the change is reflected by multiplying M by a transformation matrix T1 with 45 degree rotation about the y-axis i.e. T1xM

On the immersive workbench, the screen is tilted at a certain angle. This is a rotation about the x-axis. For the haptics device to behave corresponding to this (e.g. the tracker has to "move out" from the screen when the device is pulled diagonally upwards and toward the user), another transformation matrix has to be applied to M. Suppose we call this rotation matrix about the x-axis T2. The new value of positionCalibration should be T2xT1xM

Reference: H3DHapticsDevice class reference

Personal tools
go to