![]() |
A class implementing the communication with a SensAble/Geomagic PHANTOM device. More...
#include <SurgSim/Devices/Phantom/PhantomDevice.h>
Public Member Functions | |
PhantomDevice (const std::string &uniqueName, const std::string &initializationName) | |
Constructor. More... | |
virtual | ~PhantomDevice () |
Destructor. More... | |
std::string | getInitializationName () const |
Gets the name used by the Phantom 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... | |
![]() | |
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 Attributes | |
std::shared_ptr< PhantomScaffold > | m_scaffold |
std::string | m_initializationName |
Friends | |
class | PhantomScaffold |
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 SensAble/Geomagic PHANTOM device.
This should support any device that can communicate using the OpenHaptics 3.x toolkit, such as the PHANTOM Omni (a.k.a. Geomagic Touch), PHANTOM Desktop (a.k.a. Geomagic Touch X), and the PHANTOM Premium series devices.
type | name | |
---|---|---|
pose | "pose" | Device pose (units are meters). |
bool | "button1" | State of the first device button. |
bool | "button2" | State of the second device button if present. |
bool | "button3" | State of the third device button (probably doesn't exist). |
bool | "button4" | State of the third device button (probably doesn't exist). |
button1
through 4
correspond to the HD_DEVICE_BUTTON_1
through 4
provided by the OpenHaptics API, but your PHANTOM device likely has fewer than 4 buttons. On one-button PHANTOM devices, the button state can be accessed through button1
. On a PHANTOM Omni or a Geomagic Touch, button1
corresponds to the front (blue) stylus button, and button2
to the rear (white/gray) stylus button.type | name | |
---|---|---|
vector | "force" | Device output force (units are newtons). |
vector | "torque" | Device output torque (units are Nm). |
SurgSim::Device::PhantomDevice::PhantomDevice | ( | const std::string & | uniqueName, |
const std::string & | initializationName | ||
) |
Constructor.
uniqueName | A unique name for the device that will be used by the application. |
initializationName | The name passed to HDAPI when initializing the device. This should match a configured PHANTOM device; alternately, an empty string indicates the default device. |
|
virtual |
Destructor.
|
overridevirtual |
Finalize (de-initialize) the device.
Implements SurgSim::Input::DeviceInterface.
std::string SurgSim::Device::PhantomDevice::getInitializationName | ( | ) | const |
Gets the name used by the Phantom 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.
|
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::PhantomDevice::isInitialized | ( | ) | const |
Check whether this device is initialized.
|
friend |
|
private |
|
private |