49#if defined(C_ENABLE_DELTA_DEVICE_SUPPORT)
68#ifndef DOXYGEN_SHOULD_SKIP_THIS
106 cDeltaDevice(
unsigned int a_deviceNumber = 0,
bool a_external =
false);
112 static cDeltaDevicePtr create(
unsigned int a_deviceNumber = 0,
bool a_external =
false) {
return (std::make_shared<cDeltaDevice>(a_deviceNumber, a_external)); }
125 virtual bool close();
128 virtual bool calibrate(
bool a_forceCalibration =
false);
204 bool setVibration(
double a_freq,
double a_amplitude,
int a_type = 0);
207 bool presetEnc(
int a_encPreset[DHD_MAX_DOF],
unsigned short a_mask = 0xff);
213 bool getEncPos(
int a_encPos[DHD_MAX_DOF]);
216 bool getEncVel(
double a_encVel[DHD_MAX_DOF]);
219 bool setMot(
unsigned short a_mot[DHD_MAX_DOF],
unsigned short a_mask = 0xff);
265 #ifndef DOXYGEN_SHOULD_SKIP_THIS
268 static bool s_dhdGetDeviceCount;
269 static bool s_dhdGetDeviceID;
270 static bool s_dhdGetSystemType;
271 static bool s_dhdOpenID;
272 static bool s_dhdClose;
273 static bool s_dhdReset;
274 static bool s_dhdGetButton;
275 static bool s_dhdGetButtonMask;
276 static bool s_dhdGetPosition;
277 static bool s_dhdGetLinearVelocity;
278 static bool s_dhdGetOrientationRad;
279 static bool s_dhdSetTorque;
280 static bool s_dhdGetOrientationFrame;
281 static bool s_dhdSetForce;
282 static bool s_dhdSetForceAndTorque;
283 static bool s_dhdSetForceAndGripperForce;
284 static bool s_dhdSetForceAndTorqueAndGripperForce;
285 static bool s_dhdGetGripperThumbPos;
286 static bool s_dhdGetGripperFingerPos;
287 static bool s_dhdGetGripperAngleRad;
288 static bool s_dhdEnableExpertMode;
289 static bool s_dhdDisableExpertMode;
290 static bool s_dhdEnableForce;
291 static bool s_dhdIsLeftHanded;
292 static bool s_dhdSetBaseAngleZDeg;
293 static bool s_dhdSetVelocityThreshold;
294 static bool s_dhdSetWatchdog;
295 static bool s_drdOpenID;
296 static bool s_drdClose;
297 static bool s_drdIsInitialized;
298 static bool s_drdAutoInit;
299 static bool s_drdStop;
300 static bool s_flagUsingSDK32;
301 static bool s_dhdSetDeviceAngleDeg;
302 static bool s_dhdGetJointAngles;
303 static bool s_dhdSetVibration;
304 static bool s_dhdEnableSimulator;
305 static bool s_dhdPreset;
306 static bool s_dhdGetEnc;
307 static bool s_dhdGetEncVelocities;
308 static bool s_dhdSetMot;
309 static bool s_dhdGetDeltaJacobian;
310 static bool s_dhdGetWristJacobian;
311 static bool s_dhdSetJointTorques;
312 static bool s_dhdJointAnglesToGravityJointTorques;
Implements a base class for haptic devices.
This class implements an interface to all Force Dimension and Novint haptic devices.
Definition CDeltaDevices.h:98
virtual bool open()
This method opens a connection to the haptic device.
Definition CDeltaDevices.cpp:701
bool presetEncAll(int a_encPreset=0)
This method presets all encoder values to given value.
Definition CDeltaDevices.cpp:1846
virtual bool getRotation(cMatrix3d &a_rotation)
This method returns the orientation frame of the haptic device.
Definition CDeltaDevices.cpp:1369
cPrecisionClock m_userSwitchClock[8]
Time guard for user switch.
Definition CDeltaDevices.h:253
int m_userSwitchCount[8]
Data structure for simulating a low-pass filter on user switches.
Definition CDeltaDevices.h:247
bool m_external
Was dhdOpen() called outside CHAI3D?
Definition CDeltaDevices.h:259
bool presetEnc(int a_encPreset[DHD_MAX_DOF], unsigned short a_mask=0xff)
This method presets the encoder values given a table of values.
Definition CDeltaDevices.cpp:1812
virtual bool getUserSwitches(unsigned int &a_userSwitches)
This method returns the status of all user switches [true = ON / false = OFF].
Definition CDeltaDevices.cpp:1633
int m_deviceType
Device type among the Force Dimension devices.
Definition CDeltaDevices.h:244
int getDeviceType()
This method returns the type of this haptic device.
Definition CDeltaDevices.h:198
bool getEncPos(int a_encPos[DHD_MAX_DOF])
This method returns the encoder position values of the device.
Definition CDeltaDevices.cpp:1886
virtual bool setForceAndTorqueAndGripperForce(const cVector3d &a_force, const cVector3d &a_torque, double a_gripperForce)
This method sends a force, torque, and gripper force to the haptic device.
Definition CDeltaDevices.cpp:1529
int m_deviceID
Device ID number among the Force Dimension devices connected to the computer.
Definition CDeltaDevices.h:241
virtual bool getGripperAngleRad(double &a_angle)
This method returns the gripper angle in radian [rad].
Definition CDeltaDevices.cpp:1467
static bool openLibraries()
This method opens libraries for this class of devices.
Definition CDeltaDevices.cpp:293
bool setJointTorques(double a_jointTorques[DHD_MAX_DOF])
This method applies joint torques on the device.
Definition CDeltaDevices.cpp:2076
static cDeltaDevicePtr create(unsigned int a_deviceNumber=0, bool a_external=false)
Shared cDeltaDevice allocator.
Definition CDeltaDevices.h:112
bool m_statusEnableForcesFirstTime
Have forces been enable yet since the connection to the device was opened?
Definition CDeltaDevices.h:256
static unsigned int s_libraryCounter
Number of instances for this class of devices currently using the libraries.
Definition CDeltaDevices.h:188
bool getEncVel(double a_encVel[DHD_MAX_DOF])
This method returns the encoder velocity values of the device.
Definition CDeltaDevices.cpp:1920
cVector3d m_posWorkspaceOffset
Translational workspace offset.
Definition CDeltaDevices.h:262
virtual bool calibrate(bool a_forceCalibration=false)
This method calibrates the haptic device.
Definition CDeltaDevices.cpp:1242
virtual ~cDeltaDevice()
Destructor of cDeltaDevice.
Definition CDeltaDevices.cpp:675
bool setVibration(double a_freq, double a_amplitude, int a_type=0)
This method assign a vibration to the devices that support this feature.
Definition CDeltaDevices.cpp:1778
virtual bool getJointAnglesRad(double a_jointAnglesRad[C_MAX_DOF])
This method returns the joint angles of the haptic device.
Definition CDeltaDevices.cpp:1431
bool setMot(unsigned short a_mot[DHD_MAX_DOF], unsigned short a_mask=0xff)
This method sets motor commands to the device.
Definition CDeltaDevices.cpp:1955
bool getJacobianWrist(cMatrix3d &a_jacobian)
This method returns the Jacobian of the wrist.
Definition CDeltaDevices.cpp:2033
virtual bool enableForces(bool a_value)
This method enables or disables forces.
Definition CDeltaDevices.cpp:1689
static unsigned int getNumDevices()
This method returns the number of haptic devices available for this class of devices.
Definition CDeltaDevices.cpp:553
static bool s_allocationTable[C_MAX_DEVICES]
Allocation table for devices of this class. true means that the device has been allocated,...
Definition CDeltaDevices.h:185
virtual bool close()
This method closes the connection to the haptic device.
Definition CDeltaDevices.cpp:1191
virtual bool getLinearVelocity(cVector3d &a_linearVelocity)
This method returns the linear velocity of the haptic device.
Definition CDeltaDevices.cpp:1329
bool getJointTorquesGravityCompensation(double a_jointTorques[DHD_MAX_DOF])
This method returns the joints torques for gravity compensation.
Definition CDeltaDevices.cpp:2110
virtual bool getPosition(cVector3d &a_position)
This method returns the position of the haptic device.
Definition CDeltaDevices.cpp:1289
int m_userSwitchStatus[8]
Last state of user switch.
Definition CDeltaDevices.h:250
bool setDeviceAngleDeg(double a_angleDeg)
This method orients the device around the y-axis.
Definition CDeltaDevices.cpp:1743
static bool closeLibraries()
This method closes libraries for this class of devices.
Definition CDeltaDevices.cpp:519
bool getJacobianDelta(cMatrix3d &a_jacobian)
This method returns the jacobian of the base.
Definition CDeltaDevices.cpp:1989
This class implements a base class for haptic devices.
Definition CGenericHapticDevice.h:283
This class implements a high precision clock.
Definition CPrecisionClock.h:86
Definition CAudioBuffer.cpp:57
std::shared_ptr< cDeltaDevice > cDeltaDevicePtr
Definition CDeltaDevices.h:80
const unsigned int C_MAX_DEVICES
Definition CGenericDevice.h:65
const int C_MAX_DOF
Maximum number of joint of a haptic device.
Definition CGenericHapticDevice.h:78
This class implements a 3D matrix.
Definition CMatrix3d.h:98
This class implements a 3D vector.
Definition CVector3d.h:89