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;
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);
Implements a base class for haptic devices.
This class implements a base class for haptic devices.
Definition CGenericHapticDevice.h:283
This class implements a high precision clock.
Definition CPrecisionClock.h:86
This class implements an interface to the Sixense Razor Hydra magnetic tracker interface.
Definition CSixenseDevices.h:132
bool updateData()
Update data from controllers.
Definition CSixenseDevices.cpp:705
static bool openLibraries()
This method opens the libraries for this class of devices.
Definition CSixenseDevices.cpp:150
static bool s_allocationTable[C_MAX_DEVICES]
Allocation table for devices of this class. true means that the device has been allocated,...
Definition CSixenseDevices.h:207
static bool closeLibraries()
This method closes the libraries for this class of devices.
Definition CSixenseDevices.cpp:291
static sixenseAllControllerData m_data
Data acquired from the controller.
Definition CSixenseDevices.h:223
static cSixenseDevicePtr create(unsigned int a_deviceNumber=0)
Shared cPhantomDevice allocator.
Definition CSixenseDevices.h:146
virtual bool getPosition(cVector3d &a_position)
This method returns the position of the device.
Definition CSixenseDevices.cpp:545
virtual bool getGripperAngleRad(double &a_angle)
This method returns the gripper angle in radian [rad].
Definition CSixenseDevices.cpp:622
virtual bool getUserSwitches(unsigned int &a_userSwitches)
This method returns the status of all user switches [true = ON / false = OFF].
Definition CSixenseDevices.cpp:654
static unsigned int s_libraryCounter
Number of instances for this class of devices currently using the libraries.
Definition CSixenseDevices.h:210
virtual bool calibrate(bool a_forceCalibration=false)
This method calibrates the device.
Definition CSixenseDevices.cpp:523
virtual bool open()
This method opens a connection to the device.
Definition CSixenseDevices.cpp:460
virtual bool close()
This method closes the connection to the device.
Definition CSixenseDevices.cpp:495
virtual ~cSixenseDevice()
Destructor of cSixenseDevice.
Definition CSixenseDevices.cpp:437
static cPrecisionClock m_timeguard
Time guard for data acquisition.
Definition CSixenseDevices.h:220
static unsigned int getNumDevices()
This method returns the number of haptic devices available for this class of devices.
Definition CSixenseDevices.cpp:338
virtual bool getRotation(cMatrix3d &a_rotation)
This method returns the orientation frame of the device end-effector.
Definition CSixenseDevices.cpp:576
Definition CAudioBuffer.cpp:57
std::shared_ptr< cSixenseDevice > cSixenseDevicePtr
Definition CSixenseDevices.h:114
const unsigned int C_MAX_DEVICES
Definition CGenericDevice.h:65
This class implements a 3D matrix.
Definition CMatrix3d.h:98
This class implements a 3D vector.
Definition CVector3d.h:89