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

A class implementing the communication with a generic Novint Falcon device. More...

#include <SurgSim/Devices/Novint/NovintCommonDevice.h>

Inheritance diagram for SurgSim::Device::NovintCommonDevice:
SurgSim::Input::CommonDevice SurgSim::Input::DeviceInterface SurgSim::Device::Novint7DofDevice SurgSim::Device::NovintDevice

Public Member Functions

 NovintCommonDevice (const std::string &uniqueName, const std::string &initializationName)
 Constructor. More...
 
virtual ~NovintCommonDevice ()
 Destructor. More...
 
std::string getInitializationName () const
 Gets the name used by the Novint device configuration to refer to this device. 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...
 
- 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

virtual bool is7DofDevice () const
 Query if this object represents a 7 degree of freedom hardware device. More...
 

Private Attributes

std::shared_ptr< NovintScaffoldm_scaffold
 The scaffold handles all the communication with the SDK. More...
 
std::string m_initializationName
 
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...
 

Friends

class NovintScaffold
 

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 a generic Novint Falcon device.

See also
NovintDevice, Novint7DofHapticDevice
SurgSim::Input::CommonDevice, SurgSim::Input::DeviceInterface

Constructor & Destructor Documentation

SurgSim::Device::NovintCommonDevice::NovintCommonDevice ( const std::string &  uniqueName,
const std::string &  initializationName 
)

Constructor.

Parameters
uniqueNameA unique name for the device that will be used by the application.
initializationNameThe name passed to HDAL when initializing the device. This should match a configured Novint device; alternately, an empty string indicates the default device.
SurgSim::Device::NovintCommonDevice::~NovintCommonDevice ( )
virtual

Destructor.

Member Function Documentation

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

Finalize (de-initialize) the device.

Implements SurgSim::Input::DeviceInterface.

std::string SurgSim::Device::NovintCommonDevice::getInitializationName ( ) const

Gets the name used by the Novint device configuration to refer to this device.

Note that this may or may not be the same as the device name retrieved by getName(). An empty string indicates the default device.

Returns
The initialization name.
double SurgSim::Device::NovintCommonDevice::getOrientationScale ( ) const

Gets the orientation scale for this device.

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

Gets the position scale for this device.

bool SurgSim::Device::NovintCommonDevice::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::NovintCommonDevice::is7DofDevice ( ) const
privatevirtual

Query if this object represents a 7 degree of freedom hardware device.

Returns
true if 7 degree of freedom device, false if not.

Reimplemented in SurgSim::Device::Novint7DofDevice.

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

Check whether this device is initialized.

void SurgSim::Device::NovintCommonDevice::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.

Parameters
scaleThe multiplicative factor to apply to the rotation angles.
void SurgSim::Device::NovintCommonDevice::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.

Parameters
scaleThe multiplicative factor to apply to the position.

Friends And Related Function Documentation

friend class NovintScaffold
friend

Member Data Documentation

std::string SurgSim::Device::NovintCommonDevice::m_initializationName
private
double SurgSim::Device::NovintCommonDevice::m_orientationScale
private

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

double SurgSim::Device::NovintCommonDevice::m_positionScale
private

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

std::shared_ptr<NovintScaffold> SurgSim::Device::NovintCommonDevice::m_scaffold
private

The scaffold handles all the communication with the SDK.


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