00001 //=========================================================================== 00002 /* 00003 This file is part of the CHAI 3D visualization and haptics libraries. 00004 Copyright (C) 2003-2009 by CHAI 3D. All rights reserved. 00005 00006 This library is free software; you can redistribute it and/or modify 00007 it under the terms of the GNU General Public License("GPL") version 2 00008 as published by the Free Software Foundation. 00009 00010 For using the CHAI 3D libraries with software that can not be combined 00011 with the GNU GPL, and for taking advantage of the additional benefits 00012 of our support services, please contact CHAI 3D about acquiring a 00013 Professional Edition License. 00014 00015 \author <http://www.chai3d.org> 00016 \author Your Name! 00017 \version 2.0.0 $Rev: 251 $ 00018 */ 00019 //=========================================================================== 00020 00021 //--------------------------------------------------------------------------- 00022 #ifndef CMyCustomDeviceH 00023 #define CMyCustomDeviceH 00024 00025 #if defined(_ENABLE_CUSTOM_DEVICE_SUPPORT) 00026 //--------------------------------------------------------------------------- 00027 #include "devices/CGenericHapticDevice.h" 00028 //--------------------------------------------------------------------------- 00029 00030 //=========================================================================== 00038 //=========================================================================== 00039 00040 //=========================================================================== 00057 //=========================================================================== 00058 class cMyCustomDevice : public cGenericHapticDevice 00059 { 00060 public: 00061 00062 //----------------------------------------------------------------------- 00063 // CONSTRUCTOR & DESTRUCTOR: 00064 //----------------------------------------------------------------------- 00065 00067 cMyCustomDevice(unsigned int a_deviceNumber = 0); 00068 00070 virtual ~cMyCustomDevice(); 00071 00072 00073 //----------------------------------------------------------------------- 00074 // METHODS: 00075 //----------------------------------------------------------------------- 00076 00078 int open(); 00079 00081 int close(); 00082 00084 int initialize(const bool a_resetEncoders = false); 00085 00087 unsigned int getNumDevices(); 00088 00090 int getPosition(cVector3d& a_position); 00091 00093 int getRotation(cMatrix3d& a_rotation); 00094 00096 int getGripperAngleRad(double& a_angle); 00097 00099 int setForce(cVector3d& a_force); 00100 00102 int setTorque(cVector3d& a_torque); 00103 00105 int setGripperTorque(double a_gripperTorque); 00106 00108 int setForceAndTorqueAndGripper(cVector3d& a_force, cVector3d& a_torque, double a_gripperTorque); 00109 00111 int getUserSwitch(int a_switchIndex, bool& a_status); 00112 00113 protected: 00114 00115 /******************************************************************** 00116 If you need to declare any local variables or methods, 00117 you can do it here. 00118 *********************************************************************/ 00120 int m_MyVariable; 00121 }; 00122 00123 //--------------------------------------------------------------------------- 00124 #endif // _ENABLE_CUSTOM_DEVICE_SUPPORT 00125 //--------------------------------------------------------------------------- 00126 #endif 00127 //---------------------------------------------------------------------------