iCub-main
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
iCub::perception::SpringyFinger Class Reference

#include <springyFingers.h>

+ Inheritance diagram for iCub::perception::SpringyFinger:

Public Member Functions

bool fromProperty (const yarp::os::Property &options)
 Configure the finger taking its parameters from a Property object. More...
 
void toProperty (yarp::os::Property &options) const
 Return a Property representation of all the node parameters. More...
 
bool toStream (std::ostream &str) const
 Similar to the toProperty() method but it operates on output streams (e.g. More...
 
bool calibrate (const yarp::os::Property &options)
 Allow to send calibration commands to the finger. More...
 
bool getSensorsData (yarp::os::Value &data) const
 Retrieve data finger from the joints used both for calibration and normal operation. More...
 
bool getOutput (yarp::os::Value &out) const
 Retrieve the finger output. More...
 
bool isCalibrated () const
 Return the internal status of the calibration. More...
 
void setCalibVel (const double vel)
 Set the finger actuation velocity used while calibrating. More...
 
double getCalibVel () const
 Return the finger actuation velocity used while calibrating. More...
 
- Public Member Functions inherited from iCub::perception::Node
 Node ()
 Constructor. More...
 
std::string getName () const
 Retrieve the node name. More...
 
void attachSensor (Sensor &sensor)
 Attach a sensor object to the node. More...
 
void attachCallback (EventCallback &callback)
 Attach an event callback to the node. More...
 
void addNeighbor (Node &node)
 Add a node as a neighbor for the process of building the architecture. More...
 
bool removeNeighbor (const std::string &name)
 Remove a node previously added as neighbor. More...
 
NodegetNeighbor (const std::string &name) const
 Retrieve a neighbor node by its name. More...
 
virtual ~Node ()
 Destructor. More...
 

Protected Member Functions

bool extractSensorsData (yarp::sig::Vector &in, yarp::sig::Vector &out) const
 

Protected Attributes

iCub::learningmachine::FixedRangeScaler scaler
 
iCub::learningmachine::LSSVMLearner lssvm
 
double calibratingVelocity
 
double outputGain
 
bool calibrated
 
- Protected Attributes inherited from iCub::perception::Node
std::string name
 
std::map< std::string, Sensor * > sensors
 
std::map< std::string, EventCallback * > callbacks
 
std::map< std::string, Node * > neighbors
 

Detailed Description

An implementation of the Node class that represents the springy finger.

Definition at line 84 of file springyFingers.h.

Member Function Documentation

◆ calibrate()

bool SpringyFinger::calibrate ( const yarp::os::Property &  options)
virtual

Allow to send calibration commands to the finger.

Parameters
optionsa Property containing the calibration parameters. Available options are:
reset: resets the internal machine.
feed: feeds the internal machine with the current couple of input-output data for calibration purpose.
train: issues the final training stage after having collected a sufficient number of input-output data couples through the "feed" command.
Returns
true/false on success/failure.

Implements iCub::perception::Node.

Definition at line 230 of file springyFingers.cpp.

◆ extractSensorsData()

bool SpringyFinger::extractSensorsData ( yarp::sig::Vector &  in,
yarp::sig::Vector &  out 
) const
protected

Definition at line 179 of file springyFingers.cpp.

◆ fromProperty()

bool SpringyFinger::fromProperty ( const yarp::os::Property &  options)
virtual

Configure the finger taking its parameters from a Property object.

Parameters
optionsa Property containing the configuration parameters. Available options are:
name: the name of the finger; it can be "thumb", "index", "middle", "ring" or "little".
calib_vel: a double that specifies the velocity [deg/s] with which the finger is actuated during calibration.
output_gain: a double that is used to multiply the final output for normalization purpose.
calibrated: it can be "true" or "false" and indicates whether the configured finger has to be considered calibrated or not.
scaler: the string that configures the internal scaler used by the learning machine.
lssvm: the string that configures the Least-Squares SVM machine.
Returns
true/false on success/failure.
See also
iCub::learningmachine::FixedRangeScaler
iCub::learningmachine::LSSVMLearner

Implements iCub::perception::Node.

Definition at line 43 of file springyFingers.cpp.

◆ getCalibVel()

double iCub::perception::SpringyFinger::getCalibVel ( ) const
inline

Return the finger actuation velocity used while calibrating.

Returns
the velocity [deg/s].

Definition at line 190 of file springyFingers.h.

◆ getOutput()

bool SpringyFinger::getOutput ( yarp::os::Value &  out) const
virtual

Retrieve the finger output.

Parameters
outa Value containing the finger output in the form: output_gain*norm(out-pred).
Returns
true/false on success/failure.

Implements iCub::perception::Node.

Definition at line 211 of file springyFingers.cpp.

◆ getSensorsData()

bool SpringyFinger::getSensorsData ( yarp::os::Value &  data) const
virtual

Retrieve data finger from the joints used both for calibration and normal operation.

Parameters
dataa Value containing the representation of the data in the format: ((in (1.0)) (out (2.0 3.0))).
Returns
true/false on success/failure.

Implements iCub::perception::Node.

Definition at line 126 of file springyFingers.cpp.

◆ isCalibrated()

bool iCub::perception::SpringyFinger::isCalibrated ( ) const
inlinevirtual

Return the internal status of the calibration.

Returns
true/false on calibrated/uncalibrated-failure.

Implements iCub::perception::Node.

Definition at line 172 of file springyFingers.h.

◆ setCalibVel()

void iCub::perception::SpringyFinger::setCalibVel ( const double  vel)
inline

Set the finger actuation velocity used while calibrating.

Parameters
velthe velocity [deg/s].

Definition at line 181 of file springyFingers.h.

◆ toProperty()

void SpringyFinger::toProperty ( yarp::os::Property &  options) const
virtual

Return a Property representation of all the node parameters.

Parameters
optionsa Property filled with the configuration parameters.

Implements iCub::perception::Node.

Definition at line 99 of file springyFingers.cpp.

◆ toStream()

bool SpringyFinger::toStream ( std::ostream &  str) const
virtual

Similar to the toProperty() method but it operates on output streams (e.g.

string, ofstream, ...). It allows to better manage the storing of the configuration over files.

Parameters
strthe reference to the output stream.
Returns
true/false on success/failure.
See also
toProperty

Implements iCub::perception::Node.

Definition at line 112 of file springyFingers.cpp.

Member Data Documentation

◆ calibrated

bool iCub::perception::SpringyFinger::calibrated
protected

Definition at line 91 of file springyFingers.h.

◆ calibratingVelocity

double iCub::perception::SpringyFinger::calibratingVelocity
protected

Definition at line 89 of file springyFingers.h.

◆ lssvm

iCub::learningmachine::LSSVMLearner iCub::perception::SpringyFinger::lssvm
mutableprotected

Definition at line 88 of file springyFingers.h.

◆ outputGain

double iCub::perception::SpringyFinger::outputGain
protected

Definition at line 90 of file springyFingers.h.

◆ scaler

iCub::learningmachine::FixedRangeScaler iCub::perception::SpringyFinger::scaler
mutableprotected

Definition at line 87 of file springyFingers.h.


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