# cDeltaDevice Class Reference
[Devices]

cDeltaDevice implements an interface to the omega.x and delta.x haptic devices from Force Dimension. More...

`#include <CDeltaDevices.h>`

Inheritance diagram for cDeltaDevice:

[legend]

List of all members.

## Public Member Functions
| cDeltaDevice (unsigned int a_deviceNumber=0)
| Constructor of cDeltaDevice.
virtual | ~cDeltaDevice ()
| Destructor of cDeltaDevice.
int | open ()
| Open connection to haptic device (0 indicates success).
int | close ()
| Close connection to haptic device (0 indicates success).
int | initialize (const bool a_resetEncoders=false)
| Initialize or calibrate haptic device (0 indicates success).
unsigned int | getNumDevices ()
| Returns the number of devices available from this class of device.
int | getPosition (cVector3d &a_position)
| Read the position of the device. Units are meters [m].
int | getLinearVelocity (cVector3d &a_linearVelocity)
| Read the linear velocity of the device. Units are meters per second [m/s].
int | getRotation (cMatrix3d &a_rotation)
| Read the orientation frame of the device end-effector.
int | getGripperAngleRad (double &a_angle)
| Read the gripper angle in radian.
int | setForce (cVector3d &a_force)
| Send a force [N] to the haptic device.
int | setTorque (cVector3d &a_torque)
| Send a torque [N*m] to the haptic device.
int | setGripperTorque (double a_gripperTorque)
| Send a torque [N*m] to the gripper.
int | setForceAndTorqueAndGripper (cVector3d &a_force, cVector3d &a_torque, double a_gripperTorque)
| Send a force [N] and a torque [N*m] and gripper torque [N*m] to the haptic device.
int | getUserSwitch (int a_switchIndex, bool &a_status)
| read the status of the user switch [true = ON / false = OFF].
int | getDeviceType ()
| Return the Force Dimension type of the current device.
int | enableForces (bool a_value)
| Overrides the force button switch located at the base of the device.
## Protected Member Functions
int | getUserSwitch (int a_deviceID)
| Read user switch from end-effector.
## Protected Attributes
int | m_deviceID
| Device ID number.
int | m_deviceType
| Which FD device is actually instantiated here?
int | m_userSwitchCount [8]
| structure for modeling a low-pass filter user switches.
int | m_userSwitchStatus [8]
| Last state of user switch.
cPrecisionClock | m_userSwitchClock [8]
| Timeguard for user switch.
bool | statusEnableForcesFirstTime
| Have forces been enable yet since the connection to the device was opened?
## Static Protected Attributes
static int | m_activeDeltaDevices
| Reference count used to control access to the dhd dll.

## Detailed Description

cDeltaDevice implements an interface to the omega.x and delta.x haptic devices from Force Dimension.

## Member Function Documentation

int cDeltaDevice::close | ( |  | ) | `[virtual]`

Close connection to haptic device (0 indicates success).

Close connection to the omega.x or delta.x device.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::enableForces | ( | bool | a_value | ) |

Overrides the force button switch located at the base of the device.

Enable/Disable the motors of the omega.x device. This function overrides the force button located at the base of the device or on the controller panel.

Parameters:

  | a_value | force status.

Returns:
  Return 0 if no error occurred.

int cDeltaDevice::getGripperAngleRad | ( | double & | a_angle | ) | `[virtual]`

Read the gripper angle in radian.

Read the gripper angle in radian.

Parameters:

  | a_angle | Return value.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::getLinearVelocity | ( | cVector3d & | a_linearVelocity | ) | `[virtual]`

Read the linear velocity of the device. Units are meters per second [m/s].

Read the linear velocity of the device. Units are in [m/s].

Parameters:

  | a_linearVelocity | Return value.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

unsigned int cDeltaDevice::getNumDevices | ( |  | ) | `[virtual]`

Returns the number of devices available from this class of device.

Returns the number of devices available from this class of device.

Returns:
  Returns the result

Reimplemented from cGenericDevice.

int cDeltaDevice::getPosition | ( | cVector3d & | a_position | ) | `[virtual]`

Read the position of the device. Units are meters [m].

Read the position of the device. Units are meters [m].

Parameters:

  | a_position | Return value.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::getRotation | ( | cMatrix3d & | a_rotation | ) | `[virtual]`

Read the orientation frame of the device end-effector.

Read the orientation frame of the device end-effector

Parameters:

  | a_rotation | Return value.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::getUserSwitch | ( | int | a_deviceID | ) | `[protected]`

Read user switch from end-effector.

Read the user switch of the end-effector. This function implements a small filter to avoid reading glitches.

Parameters:

  | a_deviceID | device ID.

Returns:
  Return 0 if no error occurred.

int cDeltaDevice::getUserSwitch | ( | int | a_switchIndex,
|  | bool & | a_status |
| ) |  |  | `[virtual]`

read the status of the user switch [true = ON / false = OFF].

Read the status of the user switch [1 = ON / 0 = OFF].

Parameters:

  | a_switchIndex | index number of the switch.
  | a_status | result value from reading the selected input switch.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::initialize | ( | const bool | a_resetEncoders = `false` | ) | `[virtual]`

Initialize or calibrate haptic device (0 indicates success).

Calibrate the omega.x or delta.x device.

This function does nothing right now; the a_resetEncoders parameter is ignored.

Parameters:

  | a_resetEncoders | Ignored; exists for forward compatibility.

Returns:
  Always 0

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::open | ( |  | ) | `[virtual]`

Open connection to haptic device (0 indicates success).

Open connection to the omega.x or delta.x device.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::setForce | ( | cVector3d & | a_force | ) | `[virtual]`

Send a force [N] to the haptic device.

Send a force [N] to the haptic device

Parameters:

  | a_force | Force command to be applied to device.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::setForceAndTorqueAndGripper | ( | cVector3d & | a_force,
|  | cVector3d & | a_torque,
|  | double | a_gripperTorque |
| ) |  |  | `[virtual]`

Send a force [N] and a torque [N*m] and gripper torque [N*m] to the haptic device.

Send a force [N] and a torque [N*m] and gripper torque [N*m] to the haptic device.

Parameters:

  | a_force | Force command.
  | a_torque | Torque command.
  | a_gripperTorque | Gripper torque command.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::setGripperTorque | ( | double | a_gripperTorque | ) | `[virtual]`

Send a torque [N*m] to the gripper.

Send a torque [N*m] to the gripper

Parameters:

  | a_gripperTorque | Torque command to be sent to gripper.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cDeltaDevice::setTorque | ( | cVector3d & | a_torque | ) | `[virtual]`

Send a torque [N*m] to the haptic device.

Send a torque [N*m] to the haptic device

Parameters:

  | a_torque | Force command to be applied to device.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

The documentation for this class was generated from the following files:

- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/devices/CDeltaDevices.h
- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/devices/CDeltaDevices.cpp

CHAI3D 2.0.0 documentation
Please address any questions to support@chai3d.org
(C) 2003-2009 - CHAI 3D
All Rights Reserved.