# cFreedom6SDevice Class Reference
[Devices]

cFreedom6SDevice describes an interface to the Freedom6S haptic device from MPB Technologies Inc. More...

`#include <CFreedom6SDevice.h>`

Inheritance diagram for cFreedom6SDevice:

[legend]

List of all members.

## Public Member Functions
| cFreedom6SDevice ()
| Constructor of cFreedom6SDevice.
virtual | ~cFreedom6SDevice ()
| Destructor of cFreedom6SDevice.
int | open ()
| Open connection to MPB device.
int | close ()
| Close connection to MPB device.
int | initialize (const bool a_resetEncoders=false)
| Initialize MPB device.
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 in meters per second [m/s].
int | getRotation (cMatrix3d &a_rotation)
| Read the orientation frame of the device end-effector.
int | getAngularVelocity (cVector3d &a_angularVelocity)
| Read the angular velocity of the device. Units are in radians per second [m/s].
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].
## Protected Attributes
void * | m_hf6s
| Handle to device.
## Static Protected Attributes
static int | m_activeFreedom6SDevices
| Reference count used to control access to the DLL.

## Detailed Description

cFreedom6SDevice describes an interface to the Freedom6S haptic device from MPB Technologies Inc.

## Constructor & Destructor Documentation

cFreedom6SDevice::cFreedom6SDevice | ( |  | ) |

Constructor of cFreedom6SDevice.

Constructor of cFreedom6SDevice. Loads interface DLL.

## Member Function Documentation

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

Close connection to MPB device.

Close connection to Freedom6S device.

Returns:
  Return 0 is operation succeeds, -1 if an error occurs.

Reimplemented from cGenericHapticDevice.

int cFreedom6SDevice::getAngularVelocity | ( | cVector3d & | a_angularVelocity | ) | `[virtual]`

Read the angular velocity of the device. Units are in radians per second [m/s].

Read the angular velocity of the device. Units are in radians per second [m/s].

Parameters:

  | a_angularVelocity | Return value.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

int cFreedom6SDevice::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 cFreedom6SDevice::getLinearVelocity | ( | cVector3d & | a_linearVelocity | ) | `[virtual]`

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

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

Parameters:

  | a_linearVelocity | Return value.

Returns:
  Return 0 if no error occurred.

Reimplemented from cGenericHapticDevice.

unsigned int cFreedom6SDevice::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 cFreedom6SDevice::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 cFreedom6SDevice::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 cFreedom6SDevice::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 cFreedom6SDevice::initialize | ( | const bool | a_resetEncoders = `false` | ) | `[virtual]`

Initialize MPB device.

Calibrate Freedom6S device. Initializes the driver, loading appropriate settings according to current Freedom6S configuration.

Parameters:

  | a_resetEncoders | Ignored; exists for forward compatibility.

Returns:
  Return 0 is operation succeeds, -1 if an error occurs.

Reimplemented from cGenericHapticDevice.

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

Open connection to MPB device.

Open connection to Freedom6S device.

Returns:
  Return 0 is operation succeeds, -1 if an error occurs.

Reimplemented from cGenericHapticDevice.

int cFreedom6SDevice::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 cFreedom6SDevice::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 cFreedom6SDevice::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 cFreedom6SDevice::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/CFreedom6SDevice.h
- D:/CHAI3D/build-2-0-0/2.0.0/win32/src/devices/CFreedom6SDevice.cpp

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