Public Member Functions | Private Attributes | List of all members
LabJackToPoseFilter Class Reference
Inheritance diagram for LabJackToPoseFilter:
SurgSim::Input::CommonDevice SurgSim::Input::InputConsumerInterface SurgSim::Input::OutputProducerInterface SurgSim::Input::DeviceInterface

Public Member Functions

 LabJackToPoseFilter (const std::string &name, int firstTimerForQuadrature, int plusX, int minusX, double translationPerUpdate, int positiveAnalogDifferential, int analogSingleEnded, int xOut, int loopbackOut)
 
virtual ~LabJackToPoseFilter ()
 
bool initialize ()
 Fully initialize the device. More...
 
bool finalize ()
 Finalize (de-initialize) the device. More...
 
void initializeInput (const std::string &device, const DataGroup &inputData)
 Set the initial input data group. More...
 
void handleInput (const std::string &device, const DataGroup &inputData)
 Notifies the consumer that the application input coming from the device has been updated. More...
 
bool requestOutput (const std::string &device, DataGroup *outputData)
 Asks the producer to provide output state to the device. More...
 
void inputFilter (const DataGroup &dataToFilter, DataGroup *result)
 
void outputFilter (const DataGroup &dataToFilter, DataGroup *result)
 
- 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...
 
- Public Member Functions inherited from SurgSim::Input::InputConsumerInterface
virtual ~InputConsumerInterface ()
 Virtual destructor (empty). More...
 
- Public Member Functions inherited from SurgSim::Input::OutputProducerInterface
virtual ~OutputProducerInterface ()
 Virtual destructor (empty). More...
 

Private Attributes

DataGroup m_outputData
 
DataGroup m_lastInputData
 
RigidTransform3d m_pose
 
double m_translationPerUpdate
 
int m_lineForPlusX
 
int m_lineForMinusX
 
int m_firstTimerForQuadrature
 
int m_analogInputDifferentialPositive
 
int m_analogInputDifferentialNegative
 
int m_analogInputSingleEnded
 
bool m_cachedOutputIndices
 
int m_poseIndex
 
int m_digitalInputPlusXIndex
 
int m_digitalInputMinusXIndex
 
int m_timerInputIndex
 
int m_analogInputDifferentialIndex
 
int m_analogInputSingleEndedIndex
 
int m_analogOutputIndex
 
int m_digitalOutputIndex
 

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...
 

Constructor & Destructor Documentation

LabJackToPoseFilter::LabJackToPoseFilter ( const std::string &  name,
int  firstTimerForQuadrature,
int  plusX,
int  minusX,
double  translationPerUpdate,
int  positiveAnalogDifferential,
int  analogSingleEnded,
int  xOut,
int  loopbackOut 
)
inline
virtual LabJackToPoseFilter::~LabJackToPoseFilter ( )
inlinevirtual

Member Function Documentation

bool LabJackToPoseFilter::finalize ( )
inlinevirtual

Finalize (de-initialize) the device.

Implements SurgSim::Input::DeviceInterface.

void LabJackToPoseFilter::handleInput ( const std::string &  device,
const DataGroup inputData 
)
inlinevirtual

Notifies the consumer that the application input coming from the device has been updated.

Typical input data contents (but note that individual devices may do things differently):

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 (and so on).

Other possible contents includes:

type name
bool "isHomed" Device homing status.
bool "isHomedX" Individual homing status for the X axis (and so on).
bool "isHeld" Safety sensor etc. status.
string "model" Device model description.
string "serial" Serial number string.
(any) "debug:*" Various debugging information
Parameters
deviceThe name of the device that is producing the input. This should only be used to identify the device (e.g. if the consumer is listening to several devices at once).
inputDataThe application input state coming from the device.

Implements SurgSim::Input::InputConsumerInterface.

bool LabJackToPoseFilter::initialize ( )
inlinevirtual

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.

void LabJackToPoseFilter::initializeInput ( const std::string &  device,
const DataGroup inputData 
)
inlinevirtual

Set the initial input data group.

Parameters
deviceThe name of the device that is producing the input. This should only be used to identify the device (e.g. if the consumer is listening to several devices at once).
inputDataThe application input state coming from the device.

Implements SurgSim::Input::InputConsumerInterface.

void LabJackToPoseFilter::inputFilter ( const DataGroup dataToFilter,
DataGroup result 
)
inline
void LabJackToPoseFilter::outputFilter ( const DataGroup dataToFilter,
DataGroup result 
)
inline
bool LabJackToPoseFilter::requestOutput ( const std::string &  device,
DataGroup outputData 
)
inlinevirtual

Asks the producer to provide output state to the device.

Note that devices may never call this method, e.g. because the device doesn't actually have any output capability.

Typical output data contents (but note that individual devices may do things differently):

type name
vector "force" Commanded force for the device (units are newtons).
vector "torque" Commanded torque for the device (units are newton-meters).
bool "isEnabled" Safety switch input.

Other possible contents includes:

type name
bool "led0" Desired state for LED 0.
bool "led1" Desired state for LED 1.
string "toolId" Calibration ID to use, e.g. for camera devices.
Parameters
deviceThe name of the device that is requesting the output. This should only be used to identify the device (e.g. if the producer is listening to several devices at once).
[out]outputDataThe application output state being fed into the device.
Returns
true if the producer has provided some output, false if it refuses to do so. A producer that returns false should leave outputData unmodified.

Implements SurgSim::Input::OutputProducerInterface.

Member Data Documentation

int LabJackToPoseFilter::m_analogInputDifferentialIndex
private
int LabJackToPoseFilter::m_analogInputDifferentialNegative
private
int LabJackToPoseFilter::m_analogInputDifferentialPositive
private
int LabJackToPoseFilter::m_analogInputSingleEnded
private
int LabJackToPoseFilter::m_analogInputSingleEndedIndex
private
int LabJackToPoseFilter::m_analogOutputIndex
private
bool LabJackToPoseFilter::m_cachedOutputIndices
private
int LabJackToPoseFilter::m_digitalInputMinusXIndex
private
int LabJackToPoseFilter::m_digitalInputPlusXIndex
private
int LabJackToPoseFilter::m_digitalOutputIndex
private
int LabJackToPoseFilter::m_firstTimerForQuadrature
private
DataGroup LabJackToPoseFilter::m_lastInputData
private
int LabJackToPoseFilter::m_lineForMinusX
private
int LabJackToPoseFilter::m_lineForPlusX
private
DataGroup LabJackToPoseFilter::m_outputData
private
RigidTransform3d LabJackToPoseFilter::m_pose
private
int LabJackToPoseFilter::m_poseIndex
private
int LabJackToPoseFilter::m_timerInputIndex
private
double LabJackToPoseFilter::m_translationPerUpdate
private

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