45 #ifndef CSixenseDevicesH
46 #define CSixenseDevicesH
48 #if defined(C_ENABLE_SIXENSE_DEVICE_SUPPORT)
67 #ifndef DOXYGEN_SHOULD_SKIP_THIS
70 #define SIXENSE_BUTTON_BUMPER (0x01<<7)
71 #define SIXENSE_BUTTON_JOYSTICK (0x01<<8)
72 #define SIXENSE_BUTTON_1 (0x01<<5)
73 #define SIXENSE_BUTTON_2 (0x01<<6)
74 #define SIXENSE_BUTTON_3 (0x01<<3)
75 #define SIXENSE_BUTTON_4 (0x01<<4)
76 #define SIXENSE_BUTTON_START (0x01<<0)
77 #define SIXENSE_SUCCESS 0
78 #define SIXENSE_FAILURE -1
79 #define SIXENSE_MAX_CONTROLLERS 4
81 typedef struct _sixenseControllerData
89 unsigned char sequence_number;
91 unsigned short firmware_revision;
92 unsigned short hardware_revision;
93 unsigned short packet_type;
94 unsigned short magnetic_frequency;
97 unsigned char is_docked;
98 unsigned char which_hand;
99 unsigned char hemi_tracking_enabled;
100 } sixenseControllerData;
102 typedef struct _sixenseAllControllerData
104 sixenseControllerData controllers[4];
105 } sixenseAllControllerData;
108 #endif // DOXYGEN_SHOULD_SKIP_THIS
146 static cSixenseDevicePtr
create(
unsigned int a_deviceNumber = 0) {
return (std::make_shared<cSixenseDevice>(a_deviceNumber)); }
159 virtual bool close();
162 virtual bool calibrate(
bool a_forceCalibration =
false);
241 #endif //_DISABLE_SIXENSE_DEVICE_SUPPORT
static bool openLibraries()
This method opens the libraries for this class of devices.
Definition: CSixenseDevices.cpp:150
This class implements a 3D vector.
Definition: CVector3d.h:85
virtual bool getRotation(cMatrix3d &a_rotation)
This method returns the orientation frame of the device end-effector.
Definition: CSixenseDevices.cpp:575
static cPrecisionClock m_timeguard
Time guard for data acquisition.
Definition: CSixenseDevices.h:220
virtual bool getPosition(cVector3d &a_position)
This method returns the position of the device.
Definition: CSixenseDevices.cpp:544
const unsigned int C_MAX_DEVICES
Definition: CGenericDevice.h:65
This class implements a high precision clock.
Definition: CPrecisionClock.h:85
static cSixenseDevicePtr create(unsigned int a_deviceNumber=0)
Shared cPhantomDevice allocator.
Definition: CSixenseDevices.h:146
cSixenseDevice(unsigned int a_deviceNumber=0)
Constructor of cSixenseDevice.
Definition: CSixenseDevices.cpp:373
virtual bool close()
This method closes the connection to the device.
Definition: CSixenseDevices.cpp:494
Implements a base class for haptic devices.
bool updateData()
Update data from controllers.
Definition: CSixenseDevices.cpp:704
This class implements a 3D matrix.
Definition: CMatrix3d.h:97
virtual bool getGripperAngleRad(double &a_angle)
This method returns the gripper angle in radian [rad].
Definition: CSixenseDevices.cpp:621
virtual bool calibrate(bool a_forceCalibration=false)
This method calibrates the device.
Definition: CSixenseDevices.cpp:522
static bool closeLibraries()
This method closes the libraries for this class of devices.
Definition: CSixenseDevices.cpp:290
This class implements a base class for haptic devices.
Definition: CGenericHapticDevice.h:273
virtual bool getUserSwitches(unsigned int &a_userSwitches)
This method returns the status of all user switches [true = ON / false = OFF].
Definition: CSixenseDevices.cpp:653
static sixenseAllControllerData m_data
Data acquired from the controller.
Definition: CSixenseDevices.h:223
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: CSixenseDevices.h:207
Definition: CAudioBuffer.cpp:56
virtual bool open()
This method opens a connection to the device.
Definition: CSixenseDevices.cpp:459
std::shared_ptr< cSixenseDevice > cSixenseDevicePtr
Definition: CSixenseDevices.h:113
static unsigned int getNumDevices()
This method returns the number of haptic devices available for this class of devices.
Definition: CSixenseDevices.cpp:337
This class implements an interface to the Sixense Razor Hydra magnetic tracker interface.
Definition: CSixenseDevices.h:131
virtual ~cSixenseDevice()
Destructor of cSixenseDevice.
Definition: CSixenseDevices.cpp:436
static unsigned int s_libraryCounter
Number of instances for this class of devices currently using the libraries.
Definition: CSixenseDevices.h:210