All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
Public Member Functions | Private Member Functions | Static Private Member Functions | Private Attributes | Friends | List of all members
SurgSim::Device::RawMultiAxisDevice Class Reference

A class implementing the communication with a multi-axis controller input device, for example a 3DConnexion SpaceNavigator. More...

#include <SurgSim/Devices/MultiAxis/RawMultiAxisDevice.h>

Inheritance diagram for SurgSim::Device::RawMultiAxisDevice:
Inheritance graph
[legend]
Collaboration diagram for SurgSim::Device::RawMultiAxisDevice:
Collaboration graph
[legend]

Public Member Functions

 RawMultiAxisDevice (const std::string &uniqueName)
 Constructor. More...
 
virtual ~RawMultiAxisDevice ()
 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 whether this device is initialized. More...
 
void setPositionScale (double scale)
 Sets the position scale for this device. More...
 
double getPositionScale () const
 Gets the position scale for this device. More...
 
void setOrientationScale (double scale)
 Sets the orientation scale for this device. More...
 
double getOrientationScale () const
 Gets the orientation scale for this device. More...
 
void setAxisDominance (bool onOff)
 Turns on or off the axis dominance setting for this device. More...
 
bool isUsingAxisDominance () const
 Gets the axis dominance setting for this device. 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 Member Functions

friend SurgSim::Device::MultiAxisDevice::MultiAxisDevice (const std::string &uniqueName)
 

Static Private Member Functions

static double defaultPositionScale ()
 
static double defaultOrientationScale ()
 

Private Attributes

std::shared_ptr
< RawMultiAxisScaffold
m_scaffold
 
double m_positionScale
 Scale factor for the position axes; stored locally before the device is initialized. More...
 
double m_orientationScale
 Scale factor for the orientation axes; stored locally before the device is initialized. More...
 
bool m_useAxisDominance
 Controls whether dominance will be enabled; stored locally before the device is initialized. More...
 

Friends

class RawMultiAxisScaffold
 

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::DataGroup
getOutputData () const
 Getter for the output data DataGroup. More...
 

Detailed Description

A class implementing the communication with a multi-axis controller input device, for example a 3DConnexion SpaceNavigator.

This object will only generate raw output reported by the controller, which indicates the movement of the controller from its rest state. Normally, that result will need to be integrated to allow the controller to be treated as a differential device, where holding the controller moves the pose and releasing the controller lets the pose hold steady in its new state. The MultiAxisDevice class provides that.

Application input provided by the device:
type name
pose "pose" Absolute device pose (units are ill-defined, but nominally meters).
bool "button1" True if button 1 exists and is pressed.
bool "button2" True if button 2 exists and is pressed.
bool "button3" True if button 3 exists and is pressed.
bool "button4" True if button 4 exists and is pressed.
Application output used by the device:
type name
bool "led1" If the device has at least one LED light, controls the first one.
See also
MultiAxisDevice, SurgSim::Input::CommonDevice, SurgSim::Input::DeviceInterface

Constructor & Destructor Documentation

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

Constructor.

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

Destructor.

Member Function Documentation

static double SurgSim::Device::RawMultiAxisDevice::defaultOrientationScale ( )
inlinestaticprivate
static double SurgSim::Device::RawMultiAxisDevice::defaultPositionScale ( )
inlinestaticprivate
bool SurgSim::Device::RawMultiAxisDevice::finalize ( )
overridevirtual

Finalize (de-initialize) the device.

Implements SurgSim::Input::DeviceInterface.

double SurgSim::Device::RawMultiAxisDevice::getOrientationScale ( ) const

Gets the orientation scale for this device.

double SurgSim::Device::RawMultiAxisDevice::getPositionScale ( ) const

Gets the position scale for this device.

bool SurgSim::Device::RawMultiAxisDevice::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::RawMultiAxisDevice::isInitialized ( ) const

Check whether this device is initialized.

bool SurgSim::Device::RawMultiAxisDevice::isUsingAxisDominance ( ) const

Gets the axis dominance setting for this device.

void SurgSim::Device::RawMultiAxisDevice::setAxisDominance ( bool  onOff)

Turns on or off the axis dominance setting for this device.

When axis dominance is on, only one (the largest) of the 6 pure axis directions is allowed to be active. In other words, the device will be translating in X, or in Y, or in Z, or rotating around X, or around Y, or around Z; but only one of those at a time.

void SurgSim::Device::RawMultiAxisDevice::setOrientationScale ( double  scale)

Sets the orientation scale for this device.

The orientation scale controls how much the pose changes for a given device rotation. The default value for a raw device tries to correspond to the actual physical motion of the device.

void SurgSim::Device::RawMultiAxisDevice::setPositionScale ( double  scale)

Sets the position scale for this device.

The position scale controls how much the pose changes for a given device translation. The default value for a raw device tries to correspond to the actual physical motion of the device.

SurgSim::Device::RawMultiAxisDevice::SurgSim::Device::MultiAxisDevice::MultiAxisDevice ( const std::string &  uniqueName)
private

Friends And Related Function Documentation

friend class RawMultiAxisScaffold
friend

Member Data Documentation

double SurgSim::Device::RawMultiAxisDevice::m_orientationScale
private

Scale factor for the orientation axes; stored locally before the device is initialized.

double SurgSim::Device::RawMultiAxisDevice::m_positionScale
private

Scale factor for the position axes; stored locally before the device is initialized.

std::shared_ptr<RawMultiAxisScaffold> SurgSim::Device::RawMultiAxisDevice::m_scaffold
private
bool SurgSim::Device::RawMultiAxisDevice::m_useAxisDominance
private

Controls whether dominance will be enabled; stored locally before the device is initialized.


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