kinematics-dynamics
Public Member Functions | Private Attributes | List of all members
roboticslab::LeapMotionSensorDevice Class Reference

Represents a LeapMotion device wrapped as an analog sensor by YARP.

#include <LeapMotionSensorDevice.hpp>

Inheritance diagram for roboticslab::LeapMotionSensorDevice:
roboticslab::StreamingDevice

Public Member Functions

 LeapMotionSensorDevice (yarp::os::Searchable &config, bool usingPose)
 Constructor.
 
bool acquireInterfaces () override
 Acquires plugin interfaces. More...
 
bool initialize (bool usingStreamingPreset) override
 Perform any custom initialization needed. This method is called after the successful creation of the device and once all interface handles are acquired. More...
 
bool acquireData () override
 Acquires data from remote device. More...
 
bool transformData (double scaling) override
 Performs required operations on stored data. More...
 
int getActuatorState () override
 If actuator command data is available, return its current state. More...
 
void sendMovementCommand (double timestamp) override
 Sends movement command to the cartesian controller. More...
 
void stopMotion () override
 Sends a movement command that would stop motion.
 
- Public Member Functions inherited from roboticslab::StreamingDevice
 StreamingDevice (yarp::os::Searchable &config)
 Constructor. More...
 
virtual ~StreamingDevice ()
 Destructor.
 
virtual bool hasValidMovementData () const
 Checks whether the device may forward acquired and processed data to the controller. More...
 
void setCartesianControllerHandle (ICartesianControl *iCartesianControl)
 Stores handle to an ICartesianControl instance. More...
 

Private Attributes

yarp::dev::IAnalogSensor * iAnalogSensor
 
bool usingPose
 
std::vector< double > initialTcpOffset
 
std::vector< double > initialLeapOffset
 
KDL::Frame frame_base_leap
 
KDL::Frame frame_ee_leap
 
KDL::Frame frame_leap_ee
 
KDL::Frame previousPose
 
double previousTimestamp
 
bool hasActuator
 
bool grab
 
bool pinch
 

Additional Inherited Members

- Protected Attributes inherited from roboticslab::StreamingDevice
ICartesianControliCartesianControl
 
std::vector< double > data
 
std::vector< bool > fixedAxes
 
int actuatorState
 

Member Function Documentation

◆ acquireData()

bool LeapMotionSensorDevice::acquireData ( )
overridevirtual
Returns
true on success, false otherwise

Implements roboticslab::StreamingDevice.

◆ acquireInterfaces()

bool LeapMotionSensorDevice::acquireInterfaces ( )
overridevirtual
Returns
true on success, false otherwise

Implements roboticslab::StreamingDevice.

◆ getActuatorState()

int LeapMotionSensorDevice::getActuatorState ( )
overridevirtual
Returns
integer value describing current actuator state

Reimplemented from roboticslab::StreamingDevice.

◆ initialize()

bool LeapMotionSensorDevice::initialize ( bool  usingStreamingPreset)
overridevirtual
Parameters
usingStreamingPresetWhether the cartesian controller supports streaming command presets or not.
Returns
true on success, false otherwise

Reimplemented from roboticslab::StreamingDevice.

◆ sendMovementCommand()

void LeapMotionSensorDevice::sendMovementCommand ( double  timestamp)
overridevirtual
Parameters
timestampCurrent timestamp.

Implements roboticslab::StreamingDevice.

◆ transformData()

bool LeapMotionSensorDevice::transformData ( double  scaling)
overridevirtual
Parameters
scalingScaling factor applied to each data value.
Returns
true on success, false otherwise

Reimplemented from roboticslab::StreamingDevice.


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