![]() |
A class implementing the communication with a multi-axis controller input device, for example a 3DConnexion SpaceNavigator. More...
#include <SurgSim/Devices/MultiAxis/RawMultiAxisDevice.h>
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... | |
![]() | |
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... | |
![]() | |
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 | |
![]() | |
virtual void | pushInput () |
Push application input to consumers. More... | |
virtual bool | pullOutput () |
Pull application output from a producer. More... | |
SurgSim::DataStructures::DataGroup & | getInputData () |
Getter for the input data DataGroup. More... | |
const SurgSim::DataStructures::DataGroup & | getOutputData () const |
Getter for the output data DataGroup. More... | |
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.
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. |
type | name | |
---|---|---|
bool | "led1" | If the device has at least one LED light, controls the first one. |
|
explicit |
Constructor.
uniqueName | A unique name for the device that will be used by the application. |
|
virtual |
Destructor.
|
inlinestaticprivate |
|
inlinestaticprivate |
|
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.
|
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.
|
private |
|
friend |
|
private |
Scale factor for the orientation axes; stored locally before the device is initialized.
|
private |
Scale factor for the position axes; stored locally before the device is initialized.
|
private |
|
private |
Controls whether dominance will be enabled; stored locally before the device is initialized.