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 Stephen Sinclair 00017 \author http://www.mpb-technologies.ca/ 00018 \version 2.0.0 $Rev: 256 $ 00019 */ 00020 //=========================================================================== 00021 00022 //--------------------------------------------------------------------------- 00023 #ifndef CFreedom6SDeviceH 00024 #define CFreedom6SDeviceH 00025 //--------------------------------------------------------------------------- 00026 #if defined(_ENABLE_MPB_DEVICE_SUPPORT) 00027 //--------------------------------------------------------------------------- 00028 #include "devices/CGenericHapticDevice.h" 00029 //--------------------------------------------------------------------------- 00030 00031 //=========================================================================== 00039 //=========================================================================== 00040 00041 //=========================================================================== 00050 //=========================================================================== 00051 class cFreedom6SDevice : public cGenericHapticDevice 00052 { 00053 public: 00054 00055 //----------------------------------------------------------------------- 00056 // CONSTRUCTOR & DESTRUCTOR: 00057 //----------------------------------------------------------------------- 00058 00060 cFreedom6SDevice(); 00061 00063 virtual ~cFreedom6SDevice(); 00064 00065 00066 //----------------------------------------------------------------------- 00067 // METHODS: 00068 //----------------------------------------------------------------------- 00069 00071 int open(); 00072 00074 int close(); 00075 00077 int initialize(const bool a_resetEncoders=false); 00078 00080 unsigned int getNumDevices(); 00081 00083 int getPosition(cVector3d& a_position); 00084 00086 int getLinearVelocity(cVector3d& a_linearVelocity); 00087 00089 int getRotation(cMatrix3d& a_rotation); 00090 00092 int getAngularVelocity(cVector3d& a_angularVelocity); 00093 00095 int getGripperAngleRad(double& a_angle); 00096 00098 int setForce(cVector3d& a_force); 00099 00101 int setTorque(cVector3d& a_torque); 00102 00104 int setGripperTorque(double a_gripperTorque); 00105 00107 int setForceAndTorqueAndGripper(cVector3d& a_force, cVector3d& a_torque, double a_gripperTorque); 00108 00110 int getUserSwitch(int a_switchIndex, bool& a_status); 00111 00112 00113 protected: 00114 00116 static int m_activeFreedom6SDevices; 00117 00119 void* m_hf6s; 00120 }; 00121 00122 //--------------------------------------------------------------------------- 00123 #endif // _ENABLE_MPB_DEVICE_SUPPORT 00124 //--------------------------------------------------------------------------- 00125 #endif 00126 //--------------------------------------------------------------------------- 00127