00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023 #ifndef CDeltaDevicesH
00024 #define CDeltaDevicesH
00025
00026 #if defined(_ENABLE_DELTA_DEVICE_SUPPORT)
00027
00028 #include "devices/CGenericHapticDevice.h"
00029
00030
00031
00039
00040
00041 #if defined(_WIN32)
00042
00043 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00044
00045
00046 #define DHD_DEVICE_NONE 0
00047 #define DHD_DEVICE_SIMULATOR 11
00048 #define DHD_DEVICE_3DOF 31
00049 #define DHD_DEVICE_6DOF 61
00050 #define DHD_DEVICE_6DOF_500 62
00051 #define DHD_DEVICE_OMEGA 32
00052 #define DHD_DEVICE_OMEGA3 33
00053 #define DHD_DEVICE_OMEGA33 34
00054 #define DHD_DEVICE_OMEGA33_LEFT 36
00055 #define DHD_DEVICE_OMEGA331 35
00056 #define DHD_DEVICE_OMEGA331_LEFT 37
00057 #define DHD_DEVICE_CONTROLLER 81
00058 #define DHD_DEVICE_CONTROLLER_HR 82
00059 #define DHD_DEVICE_CUSTOM 91
00060
00061
00062 #define DHD_ON 1
00063 #define DHD_OFF 0
00064
00065
00066 #define DHD_MAX_DEVICE 4
00067
00068
00069 #define DHD_TIMEGUARD 1
00070
00071
00072 #define DHD_MAX_STATUS 13
00073
00074
00075 #define DHD_STATUS_POWER 0
00076 #define DHD_STATUS_CONNECTED 1
00077 #define DHD_STATUS_STARTED 2
00078 #define DHD_STATUS_RESET 3
00079 #define DHD_STATUS_IDLE 4
00080 #define DHD_STATUS_FORCE 5
00081 #define DHD_STATUS_BRAKE 6
00082 #define DHD_STATUS_TORQUE 7
00083 #define DHD_STATUS_WRIST_DETECTED 8
00084 #define DHD_STATUS_ERROR 9
00085 #define DHD_STATUS_GRAVITY 10
00086 #define DHD_STATUS_TIMEGUARD 11
00087 #define DHD_STATUS_ROTATOR_RESET 12
00088
00089
00090 #define DHD_MAX_BUTTONS 8
00091
00092
00093 #define DHD_VELOCITY_WINDOWING 0
00094 #define DHD_VELOCITY_AVERAGING 1
00095
00096 #endif // DOXYGEN_SHOULD_SKIP_THIS
00097 #endif // _WIN32
00098
00099
00100
00101
00110
00111 class cDeltaDevice : public cGenericHapticDevice
00112 {
00113 public:
00114
00115
00116
00117
00119 cDeltaDevice(unsigned int a_deviceNumber = 0);
00120
00122 virtual ~cDeltaDevice();
00123
00124
00125
00126
00127
00128
00130 int open();
00131
00133 int close();
00134
00136 int initialize(const bool a_resetEncoders=false);
00137
00139 unsigned int getNumDevices();
00140
00142 int getPosition(cVector3d& a_position);
00143
00145 int getLinearVelocity(cVector3d& a_linearVelocity);
00146
00148 int getRotation(cMatrix3d& a_rotation);
00149
00151 int getGripperAngleRad(double& a_angle);
00152
00154 int setForce(cVector3d& a_force);
00155
00157 int setTorque(cVector3d& a_torque);
00158
00160 int setGripperTorque(double a_gripperTorque);
00161
00163 int setForceAndTorqueAndGripper(cVector3d& a_force, cVector3d& a_torque, double a_gripperTorque);
00164
00166 int getUserSwitch(int a_switchIndex, bool& a_status);
00167
00168
00169
00170
00171
00172
00174 int getDeviceType() { return m_deviceType; }
00175
00177 int enableForces(bool a_value);
00178
00179 protected:
00180
00182 static int m_activeDeltaDevices;
00183
00185 int m_deviceID;
00186
00188 int m_deviceType;
00189
00191 int m_userSwitchCount[8];
00192
00194 int m_userSwitchStatus[8];
00195
00197 cPrecisionClock m_userSwitchClock[8];
00198
00200 int getUserSwitch(int a_deviceID);
00201
00203 bool statusEnableForcesFirstTime;
00204
00206 #ifndef DOXYGEN_SHOULD_SKIP_THIS
00207 static bool sdhdGetDeviceCount;
00208 static bool sdhdGetDeviceID;
00209 static bool sdhdGetSystemType;
00210 static bool sdhdOpenID;
00211 static bool sdhdClose;
00212 static bool sdhdGetButton;
00213 static bool sdhdReset;
00214 static bool sdhdGetPosition;
00215 static bool sdhdGetLinearVelocity;
00216 static bool sdhdSetForce;
00217 static bool sdhdGetOrientationRad;
00218 static bool sdhdSetTorque;
00219 static bool sdhdGetOrientationFrame;
00220 static bool sdhdSetForceAndGripperForce;
00221 static bool sdhdGetGripperThumbPos;
00222 static bool sdhdGetGripperFingerPos;
00223 static bool sdhdEnableExpertMode;
00224 static bool sdhdDisableExpertMode;
00225 static bool sdhdEnableForce;
00226 static bool sdhdIsLeftHanded;
00227 #endif // DOXYGEN_SHOULD_SKIP_THIS
00228 };
00229
00230
00231 #endif //_DISABLE_DELTA_DEVICE_SUPPORT
00232
00233 #endif
00234