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

An implementation of the Node class that represents the tactile finger. More...

#include <tactileFingers.h>

+ Inheritance diagram for iCub::perception::TactileFinger:

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)
 Not available. More...
 
bool getSensorsData (yarp::os::Value &data) const
 Retrieve tactile data from the ports. More...
 
bool getOutput (yarp::os::Value &out) const
 Retrieve the finger output. More...
 
bool isCalibrated () const
 Not available. More...
 
bool isDirectLogic () const
 Retrieve the status of internal logic. 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) const
 

Protected Attributes

bool directLogic
 
double outputGain
 
- 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 tactile finger.

Definition at line 60 of file tactileFingers.h.

Member Function Documentation

◆ calibrate()

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

Not available.

Returns
true.

Implements iCub::perception::Node.

Definition at line 80 of file tactileFingers.cpp.

◆ extractSensorsData()

bool TactileFinger::extractSensorsData ( yarp::sig::Vector &  in) const
protected

Definition at line 126 of file tactileFingers.cpp.

◆ fromProperty()

bool TactileFinger::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".
logic: it can be "direct" or "inverse". A direct logic indicates that the attached sensors represent the floating condition (no external forces excerted on the tactile patch) with the maximum value (e.g. 255 for a byte).
output_gain: a double that is used to multiply the final output for normalization purpose.
Returns
true/false on success/failure.

Implements iCub::perception::Node.

Definition at line 34 of file tactileFingers.cpp.

◆ getOutput()

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

Retrieve the finger output.

Parameters
outa Value containing the finger output in the form: output_gain*max(f(sensors_data)), where f() can be either 255-sensors_data or sensors_data itself depending on the logic, direct or inverse respectively.
Returns
true/false on success/failure.

Implements iCub::perception::Node.

Definition at line 151 of file tactileFingers.cpp.

◆ getSensorsData()

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

Retrieve tactile data from the ports.

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

Implements iCub::perception::Node.

Definition at line 96 of file tactileFingers.cpp.

◆ isCalibrated()

bool TactileFinger::isCalibrated ( ) const
virtual

Not available.

Returns
true.

Implements iCub::perception::Node.

Definition at line 88 of file tactileFingers.cpp.

◆ isDirectLogic()

bool iCub::perception::TactileFinger::isDirectLogic ( ) const
inline

Retrieve the status of internal logic.

Returns
true if the internal logic is direct.

Definition at line 138 of file tactileFingers.h.

◆ toProperty()

void TactileFinger::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 56 of file tactileFingers.cpp.

◆ toStream()

bool TactileFinger::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 66 of file tactileFingers.cpp.

Member Data Documentation

◆ directLogic

bool iCub::perception::TactileFinger::directLogic
protected

Definition at line 63 of file tactileFingers.h.

◆ outputGain

double iCub::perception::TactileFinger::outputGain
protected

Definition at line 64 of file tactileFingers.h.


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