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
94 #define DHD_DEVICE_SIGMA331S 108
95 #define DHD_DEVICE_SIGMA331S_LEFT 109
102 #define DHD_MAX_DEVICE 4
105 #define DHD_TIMEGUARD 1
108 #define DHD_MAX_STATUS 15
111 #define DHD_STATUS_POWER 0
112 #define DHD_STATUS_CONNECTED 1
113 #define DHD_STATUS_STARTED 2
114 #define DHD_STATUS_RESET 3
115 #define DHD_STATUS_IDLE 4
116 #define DHD_STATUS_FORCE 5
117 #define DHD_STATUS_BRAKE 6
118 #define DHD_STATUS_TORQUE 7
119 #define DHD_STATUS_WRIST_DETECTED 8
120 #define DHD_STATUS_ERROR 9
121 #define DHD_STATUS_GRAVITY 10
122 #define DHD_STATUS_TIMEGUARD 11
123 #define DHD_STATUS_ROTATOR_RESET 12
124 #define DHD_STATUS_REDUNDANCY 13
125 #define DHD_STATUS_FORCEOFFCAUSE 14
128 #define DHD_VELOCITY_WINDOWING 0
129 #define DHD_VELOCITY_AVERAGING 1
132 #endif // DOXYGEN_SHOULD_SKIP_THIS
165 cDeltaDevice(
unsigned int a_deviceNumber = 0,
bool a_external =
false);
171 static cDeltaDevicePtr
create(
unsigned int a_deviceNumber = 0,
bool a_external =
false) {
return (std::make_shared<cDeltaDevice>(a_deviceNumber, a_external)); }
184 virtual bool close();
187 virtual bool calibrate(
bool a_forceCalibration =
false);
285 #ifndef DOXYGEN_SHOULD_SKIP_THIS
288 static bool s_dhdGetDeviceCount;
289 static bool s_dhdGetDeviceID;
290 static bool s_dhdGetSystemType;
291 static bool s_dhdOpenID;
292 static bool s_dhdClose;
293 static bool s_dhdReset;
294 static bool s_dhdGetButton;
295 static bool s_dhdGetButtonMask;
296 static bool s_dhdGetPosition;
297 static bool s_dhdGetLinearVelocity;
298 static bool s_dhdGetOrientationRad;
299 static bool s_dhdSetTorque;
300 static bool s_dhdGetOrientationFrame;
301 static bool s_dhdSetForce;
302 static bool s_dhdSetForceAndTorque;
303 static bool s_dhdSetForceAndGripperForce;
304 static bool s_dhdSetForceAndTorqueAndGripperForce;
305 static bool s_dhdGetGripperThumbPos;
306 static bool s_dhdGetGripperFingerPos;
307 static bool s_dhdGetGripperAngleRad;
308 static bool s_dhdEnableExpertMode;
309 static bool s_dhdDisableExpertMode;
310 static bool s_dhdEnableForce;
311 static bool s_dhdIsLeftHanded;
312 static bool s_dhdSetBaseAngleZDeg;
313 static bool s_dhdSetVelocityThreshold;
314 static bool s_dhdSetWatchdog;
315 static bool s_drdOpenID;
316 static bool s_drdClose;
317 static bool s_drdIsInitialized;
318 static bool s_drdAutoInit;
319 static bool s_drdStop;
320 static bool s_flagUsingSDK32;
322 #endif // DOXYGEN_SHOULD_SKIP_THIS
331 #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:1125
int m_userSwitchCount[8]
Data structure for simulating a low-pass filter on user switches.
Definition: CDeltaDevices.h:270
This class implements an interface to all Force Dimension and Novint haptic devices.
Definition: CDeltaDevices.h:156
cDeltaDevice(unsigned int a_deviceNumber=0, bool a_external=false)
Constructor of cDeltaDevice.
Definition: CDeltaDevices.cpp:423
bool m_external
Was dhdOpen() called outside CHAI3D?
Definition: CDeltaDevices.h:282
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:251
virtual bool getRotation(cMatrix3d &a_rotation)
This method returns the orientation frame of the haptic device.
Definition: CDeltaDevices.cpp:1250
bool enableForces(bool a_value)
This method enables or disables forces.
Definition: CDeltaDevices.cpp:1567
virtual bool getPosition(cVector3d &a_position)
This method returns the position of the haptic device.
Definition: CDeltaDevices.cpp:1172
virtual bool open()
This method opens a connection to the haptic device.
Definition: CDeltaDevices.cpp:536
int m_deviceType
Device type among the Force Dimension devices.
Definition: CDeltaDevices.h:267
static cDeltaDevicePtr create(unsigned int a_deviceNumber=0, bool a_external=false)
Shared cDeltaDevice allocator.
Definition: CDeltaDevices.h:171
static unsigned int getNumDevices()
This method returns the number of haptic devices available for this class of devices.
Definition: CDeltaDevices.cpp:388
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:1414
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:241
This class implements a 3D matrix.
Definition: CMatrix3d.h:97
int m_userSwitchStatus[8]
Last state of user switch.
Definition: CDeltaDevices.h:273
This class implements a base class for haptic devices.
Definition: CGenericHapticDevice.h:274
std::shared_ptr< cDeltaDevice > cDeltaDevicePtr
Definition: CDeltaDevices.h:138
static bool openLibraries()
This method opens libraries for this class of devices.
Definition: CDeltaDevices.cpp:168
bool m_statusEnableForcesFirstTime
Have forces been enable yet since the connection to the device was opened?
Definition: CDeltaDevices.h:279
virtual bool getLinearVelocity(cVector3d &a_linearVelocity)
This method returns the linear velocity of the haptic device.
Definition: CDeltaDevices.cpp:1210
Definition: CAudioBuffer.cpp:56
virtual bool close()
This method closes the connection to the haptic device.
Definition: CDeltaDevices.cpp:1074
static bool closeLibraries()
This method closes libraries for this class of devices.
Definition: CDeltaDevices.cpp:354
virtual ~cDeltaDevice()
Destructor of cDeltaDevice.
Definition: CDeltaDevices.cpp:510
int m_deviceID
Device ID number among the Force Dimension devices connected to the computer.
Definition: CDeltaDevices.h:264
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:238
virtual bool getUserSwitches(unsigned int &a_userSwitches)
This method returns the status of all user switches [true = ON / false = OFF].
Definition: CDeltaDevices.cpp:1511
cPrecisionClock m_userSwitchClock[8]
Time guard for user switch.
Definition: CDeltaDevices.h:276
virtual bool getGripperAngleRad(double &a_angle)
This method returns the gripper angle in radian [rad].
Definition: CDeltaDevices.cpp:1345