#include <CPhantomDevices.h>
Public Member Functions | |
cPhantomDevice (unsigned int a_deviceNumber) | |
Constructor of cPhantomDevice. | |
~cPhantomDevice () | |
Destructor of cPhantomDevice. | |
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 | 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 | getUserSwitch (int a_switchIndex, bool &a_status) |
read the status of the user switch [true = ON / false = OFF]. |
cPhantomDevice::cPhantomDevice | ( | unsigned int | a_deviceNumber | ) |
Constructor of cPhantomDevice.
Constructor of cPhantomDevice. No servo loop is yet created, encoders are NOT reset.
a_deviceNumber | Index number to the ith Phantom device |
int cPhantomDevice::close | ( | ) | [virtual] |
Close connection to haptic device (0 indicates success).
Close connection to phantom device.
Reimplemented from cGenericHapticDevice.
int cPhantomDevice::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].
a_linearVelocity | Return value. |
Reimplemented from cGenericHapticDevice.
unsigned int cPhantomDevice::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 cPhantomDevice::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].
a_position | Return value. |
Reimplemented from cGenericHapticDevice.
int cPhantomDevice::getRotation | ( | cMatrix3d & | a_rotation | ) | [virtual] |
Read the orientation frame of the device end-effector.
Read the orientation frame of the device end-effector
a_rotation | Return value. |
Reimplemented from cGenericHapticDevice.
int cPhantomDevice::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 cPhantomDevice::initialize | ( | const bool | a_resetEncoders = false |
) | [virtual] |
Initialize or calibrate haptic device (0 indicates success).
Initialize the phantom device.
For desktops and omnis, the a_resetEncoders parameter is ignored. For premiums, if you specify a_resetEncoders as true, you should be holding the Phantom in its rest position when this is called.
a_resetEncoders | Should I re-zero the encoders? (affects premiums only...) |
Reimplemented from cGenericHapticDevice.
int cPhantomDevice::open | ( | ) | [virtual] |
Open connection to haptic device (0 indicates success).
Open connection to phantom device.
Reimplemented from cGenericHapticDevice.
int cPhantomDevice::setForce | ( | cVector3d & | a_force | ) | [virtual] |
Send a force [N] to the haptic device.
Send a force [N] to the haptic device
a_force | Force command to be applied to device. |
Reimplemented from cGenericHapticDevice.
int cPhantomDevice::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.