#include <CGenericHapticDevice.h>

Public Member Functions | |
| cGenericHapticDevice () | |
| Constructor of cGenericHapticDevice. | |
| virtual | ~cGenericHapticDevice () |
| Destructor of cGenericHapticDevice. | |
| virtual int | open () |
| Open connection to haptic device (0 indicates success). | |
| virtual int | close () |
| Close connection to haptic device (0 indicates success). | |
| virtual int | initialize (const bool a_resetEncoders=false) |
| Initialize or calibrate haptic device (0 indicates success). | |
| virtual int | command (int a_command, void *a_data) |
| Send a generic command to the haptic device (0 indicates success). | |
| virtual int | getPosition (cVector3d &a_position) |
| Read the position of the device. Units are meters [m]. | |
| virtual int | getLinearVelocity (cVector3d &a_linearVelocity) |
| Read the linear velocity of the device. Units are meters per second [m/s]. | |
| virtual int | getRotation (cMatrix3d &a_rotation) |
| Read the orientation frame of the device end-effector. | |
| virtual int | getAngularVelocity (cVector3d &a_angularVelocity) |
| Read the angular velocity of the device. Units are in radians per second [m/s]. | |
| virtual int | getGripperAngleRad (double &a_angle) |
| Read the gripper angle in radian. | |
| virtual int | getGripperVelocity (double &a_gripperVelocity) |
| Read the angular velocity of the gripper. Units are in radians per second [m/s]. | |
| virtual int | setForce (cVector3d &a_force) |
| Send a force [N] to the haptic device. | |
| virtual int | getForce (cVector3d &a_force) |
| Read a sensed force [N] from the haptic device. | |
| virtual int | setTorque (cVector3d &a_torque) |
| Send a torque [N*m] to the haptic device. | |
| virtual int | getTorque (cVector3d &a_torque) |
| Read a sensed torque [N*m] from the haptic device. | |
| virtual int | setGripperTorque (double a_gripperTorque) |
| Send a torque [N*m] to the gripper. | |
| virtual int | getGripperTorque (double a_gripperTorque) |
| Read a sensed torque [N*m] from the gripper. | |
| virtual int | setForceAndTorqueAndGripper (cVector3d &a_force, cVector3d &a_torque, double a_gripperTorque) |
| Send a force [N], a torque [N*m] and a gripper torque [N*m] to the haptic device. | |
| virtual int | getUserSwitch (int a_switchIndex, bool &a_status) |
| read the status of the user switch [true = ON / false = OFF]. | |
| cHapticDeviceInfo | getSpecifications () |
| Get the specifications of the current device. | |
Protected Member Functions | |
| void | estimateLinearVelocity (cVector3d &a_newPosition) |
| Estimate the linear velocity by passing the latest position. | |
| void | estimateAngularVelocity (cMatrix3d &a_newRotation) |
| Estimate the angular velocity by passing the latest orientation frame. | |
| void | estimateGripperVelocity (double a_newGripperPosition) |
| Estimate the velocity of the gripper by passing the latest gripper position. | |
Protected Attributes | |
| cHapticDeviceInfo | m_specifications |
| Technical specifications of the current haptic device. | |
| cVector3d | m_prevForce |
| Previous sent force to the haptic device. | |
| cVector3d | m_prevTorque |
| Previous sent torque to the haptic device. | |
| double | m_prevGripperTorque |
| Previous sent gripper torque to the haptic device. | |
| cVector3d | m_linearVelocity |
| Last estimated linear velocity. | |
| cVector3d | m_angularVelocity |
| Last estimated angular velocity. | |
| double | m_gripperVelocity |
| Last estimated gripper velocity. | |
| cTimestampPos | m_historyPos [CHAI_DEVICE_HISTORY_SIZE] |
| History position data of the device. | |
| cTimestampRot | m_historyRot [CHAI_DEVICE_HISTORY_SIZE] |
| History orientation data of the device. | |
| cTimestampValue | m_historyGripper [CHAI_DEVICE_HISTORY_SIZE] |
| History position of the device gripper. | |
| int | m_indexHistoryPos |
| Current index position in History data table. | |
| int | m_indexHistoryRot |
| Current index position in History data table. | |
| int | m_indexHistoryGripper |
| Current index position in History data table. | |
| int | m_indexHistoryPosWin |
| Last index position used to compute velocity. | |
| int | m_indexHistoryRotWin |
| Last index position used to compute velocity. | |
| int | m_indexHistoryGripperWin |
| Last index position used to compute velocity. | |
| double | m_linearVelocityWindowSize |
| Window time interval for measuring linear velocity. | |
| double | m_angularVelocityWindowSize |
| Window time interval for measuring angular velocity. | |
| double | m_gripperVelocityWindowSize |
| Window time interval for measuring gripper velocity. | |
| cPrecisionClock | m_clockGeneral |
| General clock when the device was started. | |
| cGenericHapticDevice::cGenericHapticDevice | ( | ) |
Constructor of cGenericHapticDevice.
Constructor of cGenericHapticDevice. Initialize basic parameters of generic haptic device.
| int cGenericHapticDevice::command | ( | int | a_command, | |
| void * | a_data | |||
| ) | [virtual] |
Send a generic command to the haptic device (0 indicates success).
Set command for the haptic device
| a_command | Selected command. | |
| a_data | Pointer to the corresponding data structure. |
Reimplemented from cGenericDevice.
| void cGenericHapticDevice::estimateAngularVelocity | ( | cMatrix3d & | a_newRotation | ) | [protected] |
Estimate the angular velocity by passing the latest orientation frame.
Estimate the angular velocity by passing the latest orientation frame.
| a_newRotation | New orientation frame of the device. |
| void cGenericHapticDevice::estimateGripperVelocity | ( | double | a_newGripperPosition | ) | [protected] |
Estimate the velocity of the gripper by passing the latest gripper position.
Estimate the velocity of the gripper by passing the latest gripper position.
| a_newGripperPosition | New position of the gripper. |
| void cGenericHapticDevice::estimateLinearVelocity | ( | cVector3d & | a_newPosition | ) | [protected] |
Estimate the linear velocity by passing the latest position.
Estimate the linear velocity by passing the latest position.
| a_newPosition | New position of the device. |
| int cGenericHapticDevice::setForceAndTorqueAndGripper | ( | cVector3d & | a_force, | |
| cVector3d & | a_torque, | |||
| double | a_gripperTorque | |||
| ) | [virtual] |
Send a force [N], a torque [N*m] and a gripper torque [N*m] to the haptic device.
Send a force [N] and a torque [N*m] and gripper force [N] to the haptic device.
| a_force | Force command. | |
| a_torque | Torque command. | |
| a_gripperTorque | Gripper torque command. |
Reimplemented in cDeltaDevice, cFreedom6SDevice, and cMyCustomDevice.