Public Member Functions | Private Attributes | Friends | List of all members
SurgSim::Device::SixenseDevice Class Reference

A class implementing the communication with one Sixense controller, for example one of the two on the Razer Hydra. More...

#include <SurgSim/Devices/Sixense/SixenseDevice.h>

Inheritance diagram for SurgSim::Device::SixenseDevice:
SurgSim::Input::CommonDevice SurgSim::Input::DeviceInterface

Public Member Functions

 SixenseDevice (const std::string &uniqueName)
 Constructor. More...
 
virtual ~SixenseDevice ()
 Destructor. More...
 
virtual bool initialize () override
 Fully initialize the device. More...
 
virtual bool finalize () override
 Finalize (de-initialize) the device. More...
 
bool isInitialized () const
 Check wheter this device is initialized. More...
 
- Public Member Functions inherited from SurgSim::Input::CommonDevice
 CommonDevice (const std::string &name)
 Constructor. More...
 
 CommonDevice (const std::string &name, const SurgSim::DataStructures::DataGroup &inputData)
 Constructor. More...
 
 CommonDevice (const std::string &name, SurgSim::DataStructures::DataGroup &&inputData)
 Constructor. More...
 
virtual ~CommonDevice ()
 Destructor. More...
 
virtual std::string getName () const override
 Return a (hopefully unique) device name. More...
 
void setNameForCallback (const std::string &name)
 Set the name used for calling the input consumers and output producer. More...
 
std::string getNameForCallback () const
 Get the name used for calling the input consumers and output producer. More...
 
virtual bool addInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override
 Connect this device to an InputConsumerInterface, which will receive the data that comes from this device. More...
 
virtual bool removeInputConsumer (std::shared_ptr< InputConsumerInterface > inputConsumer) override
 Disconnect this device from an InputConsumerInterface, which will no longer receive data from this device. More...
 
virtual bool setOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override
 Connect this device to an OutputProducerInterface, which will send data to this device. More...
 
virtual bool removeOutputProducer (std::shared_ptr< OutputProducerInterface > outputProducer) override
 Disconnect this device from an OutputProducerInterface, which will no longer send data to this device. More...
 
virtual bool hasOutputProducer () override
 Getter for whether or not this device is connected with an OutputProducerInterface. More...
 
- Public Member Functions inherited from SurgSim::Input::DeviceInterface
virtual ~DeviceInterface ()
 Virtual destructor (empty). More...
 

Private Attributes

std::shared_ptr< SixenseScaffoldm_scaffold
 

Friends

class SixenseScaffold
 

Additional Inherited Members

- Protected Member Functions inherited from SurgSim::Input::CommonDevice
virtual void pushInput ()
 Push application input to consumers. More...
 
virtual bool pullOutput ()
 Pull application output from a producer. More...
 
SurgSim::DataStructures::DataGroupgetInputData ()
 Getter for the input data DataGroup. More...
 
const SurgSim::DataStructures::DataGroupgetOutputData () const
 Getter for the output data DataGroup. More...
 

Detailed Description

A class implementing the communication with one Sixense controller, for example one of the two on the Razer Hydra.

Application input provided by the device:
type name
pose "pose" Device pose (units are meters).
scalar "trigger" State of the analog trigger button (0 = not pressed, 1 = fully pressed).
scalar "joystickX" Joystick X position (0 = center, -1 = fully left, +1 = fully right).
scalar "joystickY" Joystick Y position (0 = center, -1 = fully down/near, +1 = up/far).
bool "buttonTrigger" True if the analog trigger button is pressed, i.e. its value is non-zero.
bool "buttonBumper" True if the bumper button (next to the trigger) is pressed.
bool "button1" True if the button marked "1" is pressed.
bool "button2" True if the button marked "2" is pressed.
bool "button3" True if the button marked "3" is pressed.
bool "button4" True if the button marked "4" is pressed.
bool "buttonStart" True if the "start" button is pressed.
bool "buttonJoystick" True if the joystick is pressed down as a button ("into" the controller).
Application output used by the device: none.
See also
SurgSim::Input::CommonDevice, SurgSim::Input::DeviceInterface

Constructor & Destructor Documentation

SurgSim::Device::SixenseDevice::SixenseDevice ( const std::string &  uniqueName)
explicit

Constructor.

Parameters
uniqueNameA unique name for the device that will be used by the application.
SurgSim::Device::SixenseDevice::~SixenseDevice ( )
virtual

Destructor.

Member Function Documentation

bool SurgSim::Device::SixenseDevice::finalize ( )
overridevirtual

Finalize (de-initialize) the device.

Implements SurgSim::Input::DeviceInterface.

bool SurgSim::Device::SixenseDevice::initialize ( )
overridevirtual

Fully initialize the device.

When the manager object creates the device, the internal state of the device usually isn't fully initialized yet. This method performs any needed initialization.

Implements SurgSim::Input::DeviceInterface.

bool SurgSim::Device::SixenseDevice::isInitialized ( ) const

Check wheter this device is initialized.

Friends And Related Function Documentation

friend class SixenseScaffold
friend

Member Data Documentation

std::shared_ptr<SixenseScaffold> SurgSim::Device::SixenseDevice::m_scaffold
private

The documentation for this class was generated from the following files: