A class implementing the communication with a multi-axis controller input device, for example a 3DConnexion SpaceNavigator.
More...
#include <SurgSim/Devices/MultiAxis/MultiAxisDevice.h>
A class implementing the communication with a multi-axis controller input device, for example a 3DConnexion SpaceNavigator.
This object will integrate the output of the physical device, treating it as a differential device. In other words, holding the controller moves the pose and releasing the controller lets the pose hold steady in its new state.
- 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
- RawMultiAxisDevice, SurgSim::Input::DeviceInterface
SurgSim::Device::MultiAxisDevice::MultiAxisDevice |
( |
const std::string & |
uniqueName | ) |
|
|
explicit |
Constructor.
- Parameters
-
uniqueName | A unique name for the device that will be used by the application. |
SurgSim::Device::MultiAxisDevice::~MultiAxisDevice |
( |
| ) |
|
|
virtual |
Connect this device to an InputConsumerInterface, which will receive the data that comes from this device.
- Parameters
-
inputConsumer | The InputConsumerInterface to connect with. |
- Returns
- True if successful.
Implements SurgSim::Input::DeviceInterface.
double SurgSim::Device::MultiAxisDevice::defaultOrientationScale |
( |
| ) |
|
|
staticprivate |
Get the default rotation from device ticks to radians.
- Returns
- The default rotation scale, in radians per tick.
double SurgSim::Device::MultiAxisDevice::defaultPositionScale |
( |
| ) |
|
|
staticprivate |
Get the default position scale from device ticks to meters.
- Returns
- The default position scale, in meters per tick.
bool SurgSim::Device::MultiAxisDevice::finalize |
( |
| ) |
|
|
overridevirtual |
std::string SurgSim::Device::MultiAxisDevice::getName |
( |
| ) |
const |
|
overridevirtual |
double SurgSim::Device::MultiAxisDevice::getOrientationScale |
( |
| ) |
const |
Gets the orientation scale for this device.
- Returns
- The orientation scale.
double SurgSim::Device::MultiAxisDevice::getPositionScale |
( |
| ) |
const |
Gets the position scale for this device.
- Returns
- The position scale.
bool SurgSim::Device::MultiAxisDevice::hasOutputProducer |
( |
| ) |
|
|
overridevirtual |
Getter for whether or not this device is connected with an OutputProducerInterface.
- Returns
- True if an OutputProducerInterface is connected.
Implements SurgSim::Input::DeviceInterface.
bool SurgSim::Device::MultiAxisDevice::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.
- Returns
- True on success.
Implements SurgSim::Input::DeviceInterface.
bool SurgSim::Device::MultiAxisDevice::isInitialized |
( |
| ) |
const |
Check whether this device is initialized.
- Returns
- True if initialized.
bool SurgSim::Device::MultiAxisDevice::isUsingAxisDominance |
( |
| ) |
const |
Gets the axis dominance setting for this device.
- Returns
- True if using axis dominance.
Disconnect this device from an InputConsumerInterface, which will no longer receive data from this device.
- Parameters
-
inputConsumer | The InputConsumerInterface to disconnect from. |
- Returns
- True if successful.
Implements SurgSim::Input::DeviceInterface.
Disconnect this device from an OutputProducerInterface, which will no longer send data to this device.
- Parameters
-
outputProducer | The OutputProducerInterface to disconnect from. |
- Returns
- True if successful.
Implements SurgSim::Input::DeviceInterface.
void SurgSim::Device::MultiAxisDevice::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.
- Parameters
-
onOff | Whether or not to use only the dominant axis. |
void SurgSim::Device::MultiAxisDevice::setOrientationScale |
( |
double |
scale | ) |
|
Sets the orientation scale for this device.
The orientation scale controls how much the pose changes for a given device rotation.
- Parameters
-
- Note
- The default value for a raw device tries to correspond to the actual physical motion of the device.
Connect this device to an OutputProducerInterface, which will send data to this device.
- Parameters
-
outputProducer | The OutputProducerInterface to connect with. |
- Returns
- True if successful.
Implements SurgSim::Input::DeviceInterface.
void SurgSim::Device::MultiAxisDevice::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.
void SurgSim::Device::MultiAxisDevice::setReset |
( |
const std::string & |
name | ) |
|
Sets the string name of the boolean entry that will reset the pose to its initial value.
- Parameters
-
name | The name of the NamedData<bool> entry, e.g., SurgSim::DataStructures::Names::BUTTON_1. |
- See also
- PoseIntegrator::setReset
std::shared_ptr<PoseIntegrator> SurgSim::Device::MultiAxisDevice::m_filter |
|
private |
The pose integration filter.
std::string SurgSim::Device::MultiAxisDevice::m_name |
|
private |
The raw underlying device.
The documentation for this class was generated from the following files: