#include <CMyCustomDevice.h>
Public Member Functions | |
cMyCustomDevice (unsigned int a_deviceNumber=0) | |
Constructor of cMyCustomDevice. | |
virtual | ~cMyCustomDevice () |
Destructor of cMyCustomDevice. | |
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 | 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]. | |
Protected Attributes | |
int | m_MyVariable |
a short description of my variable |
Simply follow the comments and complete the gaps with your code. Depending of the numbers of degrees of freedom of your device, not all methods will need to be completed. For instance, if your device does not provide any rotation degrees of freedom, simply ignore the getRotation() method. Default values will be returned correctly if these are not implemented on your device
int cMyCustomDevice::close | ( | ) | [virtual] |
Close connection to haptic device (0 indicates success).
Close connection to your device.
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::getGripperAngleRad | ( | double & | a_angle | ) | [virtual] |
Read the gripper angle in radian.
Read the gripper angle in radian.
a_angle | Return value. |
Reimplemented from cGenericHapticDevice.
unsigned int cMyCustomDevice::getNumDevices | ( | ) | [virtual] |
Returns the number of devices available from this class of device.
Returns the number of devices available from this class of device.
Reimplemented from cGenericDevice.
int cMyCustomDevice::getPosition | ( | cVector3d & | a_position | ) | [virtual] |
Read the position of the device. Units are meters [m].
Read the position of your device. Units are meters [m].
a_position | Return value. |
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::getRotation | ( | cMatrix3d & | a_rotation | ) | [virtual] |
Read the orientation frame of the device end-effector.
Read the orientation frame of your device end-effector
a_rotation | Return value. |
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::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 [true = ON / false = OFF].
a_switchIndex | index number of the switch. | |
a_status | result value from reading the selected input switch. |
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::initialize | ( | const bool | a_resetEncoders = false |
) | [virtual] |
Initialize or calibrate haptic device (0 indicates success).
Calibrate your device.
a_resetEncoders | Ignored; exists for forward compatibility. |
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::open | ( | ) | [virtual] |
Open connection to haptic device (0 indicates success).
Open connection to your device.
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::setForce | ( | cVector3d & | a_force | ) | [virtual] |
Send a force [N] to the haptic device.
Send a force [N] to your haptic device
a_force | Force command to be applied to device. |
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::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.
a_force | Force command. | |
a_torque | Torque command. | |
a_gripperTorque | Gripper torque command. |
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::setGripperTorque | ( | double | a_gripperTorque | ) | [virtual] |
Send a torque [N*m] to the gripper.
Send a torque [N*m] to the gripper
a_gripperTorque | Torque command to be sent to gripper. |
Reimplemented from cGenericHapticDevice.
int cMyCustomDevice::setTorque | ( | cVector3d & | a_torque | ) | [virtual] |
Send a torque [N*m] to the haptic device.
Send a torque [N*m] to the haptic device
a_torque | Force command to be applied to device. |
Reimplemented from cGenericHapticDevice.