46 #ifndef CDeltaDevicesH 47 #define CDeltaDevicesH 49 #if defined(C_ENABLE_DELTA_DEVICE_SUPPORT) 68 #if defined(WIN32) | defined(WIN64) 70 #ifndef DOXYGEN_SHOULD_SKIP_THIS 74 #define DHD_DEVICE_NONE 0 75 #define DHD_DEVICE_3DOF 31 76 #define DHD_DEVICE_6DOF 61 77 #define DHD_DEVICE_6DOF_500 62 78 #define DHD_DEVICE_DELTA3 63 79 #define DHD_DEVICE_DELTA6 64 80 #define DHD_DEVICE_OMEGA 32 81 #define DHD_DEVICE_OMEGA3 33 82 #define DHD_DEVICE_OMEGA33 34 83 #define DHD_DEVICE_OMEGA33_LEFT 36 84 #define DHD_DEVICE_OMEGA331 35 85 #define DHD_DEVICE_OMEGA331_LEFT 37 86 #define DHD_DEVICE_FALCON 60 87 #define DHD_DEVICE_CONTROLLER 81 88 #define DHD_DEVICE_CONTROLLER_HR 82 89 #define DHD_DEVICE_CUSTOM 91 90 #define DHD_DEVICE_SIGMA331 104 91 #define DHD_DEVICE_SIGMA331_LEFT 105 92 #define DHD_DEVICE_SIGMA33P 106 93 #define DHD_DEVICE_SIGMA33P_LEFT 107 100 #define DHD_MAX_DEVICE 4 103 #define DHD_TIMEGUARD 1 106 #define DHD_MAX_STATUS 16 109 #define DHD_STATUS_POWER 0 110 #define DHD_STATUS_CONNECTED 1 111 #define DHD_STATUS_STARTED 2 112 #define DHD_STATUS_RESET 3 113 #define DHD_STATUS_IDLE 4 114 #define DHD_STATUS_FORCE 5 115 #define DHD_STATUS_BRAKE 6 116 #define DHD_STATUS_TORQUE 7 117 #define DHD_STATUS_WRIST_DETECTED 8 118 #define DHD_STATUS_ERROR 9 119 #define DHD_STATUS_GRAVITY 10 120 #define DHD_STATUS_TIMEGUARD 11 121 #define DHD_STATUS_ROTATOR_RESET 12 122 #define DHD_STATUS_REDUNDANCY 13 123 #define DHD_STATUS_FORCEOFFCAUSE 14 124 #define DHD_STATUS_LOCKS 15 127 #define DHD_VELOCITY_WINDOWING 0 128 #define DHD_VELOCITY_AVERAGING 1 131 #define DHD_MAX_DOF 8 134 #endif // DOXYGEN_SHOULD_SKIP_THIS 167 cDeltaDevice(
unsigned int a_deviceNumber = 0,
bool a_external =
false);
173 static cDeltaDevicePtr
create(
unsigned int a_deviceNumber = 0,
bool a_external =
false) {
return (std::make_shared<cDeltaDevice>(a_deviceNumber, a_external)); }
186 virtual bool close();
189 virtual bool calibrate(
bool a_forceCalibration =
false);
265 bool setVibration(
double a_freq,
double a_amplitude,
int a_type = 0);
299 #ifndef DOXYGEN_SHOULD_SKIP_THIS 302 static bool s_dhdGetDeviceCount;
303 static bool s_dhdGetDeviceID;
304 static bool s_dhdGetSystemType;
305 static bool s_dhdOpenID;
306 static bool s_dhdClose;
307 static bool s_dhdReset;
308 static bool s_dhdGetButton;
309 static bool s_dhdGetButtonMask;
310 static bool s_dhdGetPosition;
311 static bool s_dhdGetLinearVelocity;
312 static bool s_dhdGetOrientationRad;
313 static bool s_dhdSetTorque;
314 static bool s_dhdGetOrientationFrame;
315 static bool s_dhdSetForce;
316 static bool s_dhdSetForceAndTorque;
317 static bool s_dhdSetForceAndGripperForce;
318 static bool s_dhdSetForceAndTorqueAndGripperForce;
319 static bool s_dhdGetGripperThumbPos;
320 static bool s_dhdGetGripperFingerPos;
321 static bool s_dhdGetGripperAngleRad;
322 static bool s_dhdEnableExpertMode;
323 static bool s_dhdDisableExpertMode;
324 static bool s_dhdEnableForce;
325 static bool s_dhdIsLeftHanded;
326 static bool s_dhdSetBaseAngleZDeg;
327 static bool s_dhdSetVelocityThreshold;
328 static bool s_dhdSetWatchdog;
329 static bool s_drdOpenID;
330 static bool s_drdClose;
331 static bool s_drdIsInitialized;
332 static bool s_drdAutoInit;
333 static bool s_drdStop;
334 static bool s_flagUsingSDK32;
335 static bool s_dhdSetDeviceAngleDeg;
336 static bool s_dhdGetJointAngles;
337 static bool s_dhdSetVibration;
340 #endif // DOXYGEN_SHOULD_SKIP_THIS 349 #endif // C_ENABLE_DELTA_DEVICE_SUPPORT This class implements a 3D vector.
Definition: CVector3d.h:88
virtual bool calibrate(bool a_forceCalibration=false)
This method calibrates the haptic device.
Definition: CDeltaDevices.cpp:1230
int m_userSwitchCount[8]
Data structure for simulating a low-pass filter on user switches.
Definition: CDeltaDevices.h:281
This class implements an interface to all Force Dimension and Novint haptic devices.
Definition: CDeltaDevices.h:158
const int C_MAX_DOF
Maximum number of joint of a haptic device.
Definition: CGenericHapticDevice.h:78
cDeltaDevice(unsigned int a_deviceNumber=0, bool a_external=false)
Constructor of cDeltaDevice.
Definition: CDeltaDevices.cpp:445
bool m_external
Was dhdOpen() called outside CHAI3D?
Definition: CDeltaDevices.h:293
const unsigned int C_MAX_DEVICES
Definition: CGenericDevice.h:65
This class implements a high precision clock.
Definition: CPrecisionClock.h:85
int getDeviceType()
This method returns the type of this haptic device.
Definition: CDeltaDevices.h:256
virtual bool getRotation(cMatrix3d &a_rotation)
This method returns the orientation frame of the haptic device.
Definition: CDeltaDevices.cpp:1357
bool enableForces(bool a_value)
This method enables or disables forces.
Definition: CDeltaDevices.cpp:1711
bool setDeviceAngleDeg(double a_angleDeg)
This method orients the device around the y-axis.
Definition: CDeltaDevices.cpp:1765
virtual bool getPosition(cVector3d &a_position)
This method returns the position of the haptic device.
Definition: CDeltaDevices.cpp:1277
virtual bool open()
This method opens a connection to the haptic device.
Definition: CDeltaDevices.cpp:558
int m_deviceType
Device type among the Force Dimension devices.
Definition: CDeltaDevices.h:278
static cDeltaDevicePtr create(unsigned int a_deviceNumber=0, bool a_external=false)
Shared cDeltaDevice allocator.
Definition: CDeltaDevices.h:173
static unsigned int getNumDevices()
This method returns the number of haptic devices available for this class of devices.
Definition: CDeltaDevices.cpp:410
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:1558
Implements a base class for haptic devices.
static unsigned int s_libraryCounter
Number of instances for this class of devices currently using the libraries.
Definition: CDeltaDevices.h:246
This class implements a 3D matrix.
Definition: CMatrix3d.h:97
int m_userSwitchStatus[8]
Last state of user switch.
Definition: CDeltaDevices.h:284
This class implements a base class for haptic devices.
Definition: CGenericHapticDevice.h:280
virtual bool getJointAnglesRad(double a_jointAnglesRad[C_MAX_DOF])
This method returns the joint angles of the haptic device.
Definition: CDeltaDevices.cpp:1453
std::shared_ptr< cDeltaDevice > cDeltaDevicePtr
Definition: CDeltaDevices.h:140
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:1800
static bool openLibraries()
This method opens libraries for this class of devices.
Definition: CDeltaDevices.cpp:177
bool m_statusEnableForcesFirstTime
Have forces been enable yet since the connection to the device was opened?
Definition: CDeltaDevices.h:290
virtual bool getLinearVelocity(cVector3d &a_linearVelocity)
This method returns the linear velocity of the haptic device.
Definition: CDeltaDevices.cpp:1317
Definition: CAudioBuffer.cpp:56
virtual bool close()
This method closes the connection to the haptic device.
Definition: CDeltaDevices.cpp:1179
static bool closeLibraries()
This method closes libraries for this class of devices.
Definition: CDeltaDevices.cpp:376
virtual ~cDeltaDevice()
Destructor of cDeltaDevice.
Definition: CDeltaDevices.cpp:532
cVector3d m_posWorkspaceOffset
Translational workspace offset.
Definition: CDeltaDevices.h:296
int m_deviceID
Device ID number among the Force Dimension devices connected to the computer.
Definition: CDeltaDevices.h:275
static bool s_allocationTable[C_MAX_DEVICES]
Allocation table for devices of this class. true means that the device has been allocated, false means free.
Definition: CDeltaDevices.h:243
virtual bool getUserSwitches(unsigned int &a_userSwitches)
This method returns the status of all user switches [true = ON / false = OFF].
Definition: CDeltaDevices.cpp:1655
cPrecisionClock m_userSwitchClock[8]
Time guard for user switch.
Definition: CDeltaDevices.h:287
virtual bool getGripperAngleRad(double &a_angle)
This method returns the gripper angle in radian [rad].
Definition: CDeltaDevices.cpp:1489