icub-client
Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
proactiveTagging Class Reference

#include <proactiveTagging.h>

+ Inheritance diagram for proactiveTagging:

Public Member Functions

yarp::os::Bottle exploreUnknownEntity (const yarp::os::Bottle &bInput)
 Explore an unknown entity by asking for the name (response via speech recognition) More...
 
yarp::os::Bottle searchingEntity (const yarp::os::Bottle &bInput)
 Search for the entity corresponding to a certain name in all the unknown entities. More...
 
std::string getBestEntity (std::string sTypeTarget)
 Loop through all objects in the OPC, and check their saliency. More...
 
yarp::os::Bottle getNameFromSAM (std::string sNameTarget, std::string currentEntityType)
 Send request to SAM to use its face recognition to recognise partner. More...
 
yarp::os::Bottle exploreTactileEntityWithName (yarp::os::Bottle bInput)
 Explore an unknown tactile entity (e.g. More...
 
bool configure (yarp::os::ResourceFinder &rf)
 
bool interruptModule ()
 
bool close ()
 
double getPeriod ()
 
bool updateModule ()
 
bool respond (const yarp::os::Bottle &cmd, yarp::os::Bottle &reply)
 

Protected Member Functions

void configureOPC (yarp::os::ResourceFinder &rf)
 Read config file and fill OPC accordingly. More...
 
void subPopulateObjects (yarp::os::Bottle *objectList, bool addOrRetrieve)
 
void subPopulateBodyparts (yarp::os::Bottle *bodyPartList, yarp::os::Bottle *bodyPartJointList, bool addOrRetrieve)
 
yarp::os::Bottle recogName (std::string entityType)
 Recognize the name of an unknown entity (communicate with speech recognizer) More...
 
std::string getBodyPartNameForSpeech (const std::string bodypart)
 Return a "nice" version of a body part name, eg given "index" as input, it returns "index finger". More...
 
bool setPasarPointing (bool on)
 Ask pasar to increase saliency when a human is pointing to an object. More...
 

Protected Attributes

icubclient::ICubClientiCub
 icubclient More...
 
double period
 
std::string SAMRpc
 Name of SAM RPC port. More...
 
std::string touchDetectorRpc
 Name of touchDetector RPC port. More...
 
yarp::os::Port rpcPort
 Response port. More...
 
yarp::os::Port portToSAM
 Port used to communicate with SAM. More...
 
yarp::os::Port portToPasar
 Port used to communicate with pasar. More...
 
yarp::os::BufferedPort< yarp::os::Bottle > portFromTouchDetector
 Port used to communicate with touch detector. More...
 
std::string GrammarAskNameAgent
 Name of grammar file when asking for name of agent. More...
 
std::string GrammarAskNameObject
 Name of grammar file when asking for name of object. More...
 
std::string GrammarAskNameBodypart
 Name of grammar file when asking for name of bodypart. More...
 
std::string babblingArm
 side of the babbling arm : left or right More...
 
double thresholdDistinguishObjectsRatio
 ratio of saliency needed to detect if 1 object is more salient that the other More...
 
double thresholdSalienceDetection
 value of saliency needed to detect if 1 object is more salient that the other More...
 

Detailed Description

Definition at line 27 of file proactiveTagging.h.

Member Function Documentation

◆ close()

bool proactiveTagging::close ( )

Definition at line 109 of file proactiveTagging.cpp.

◆ configure()

bool proactiveTagging::configure ( yarp::os::ResourceFinder &  rf)

Definition at line 30 of file proactiveTagging.cpp.

◆ configureOPC()

void proactiveTagging::configureOPC ( yarp::os::ResourceFinder &  rf)
protected

Read config file and fill OPC accordingly.

Parameters
rf- resourceFinder instance

Definition at line 235 of file helpers.cpp.

◆ exploreTactileEntityWithName()

yarp::os::Bottle proactiveTagging::exploreTactileEntityWithName ( yarp::os::Bottle  bInput)

Explore an unknown tactile entity (e.g.

fingertips), when knowing the name

Parameters
bInputBottle with (exploreTactileEntityWithName entityType entityName) (eg: exploreTactileEntityWithName bodypart index) - entityType must be "bodypart"!
Returns
Bottle with the result (ack skin_patch_number) or (nack error_message)

Definition at line 268 of file proactiveTagging.cpp.

◆ exploreUnknownEntity()

Bottle proactiveTagging::exploreUnknownEntity ( const yarp::os::Bottle &  bInput)

Explore an unknown entity by asking for the name (response via speech recognition)

Parameters
bInputexploreUnknownEntity entityType entityName (eg: exploreUnknownEntity agent unknown_25)
Returns
Bottle with (success entityType) or (nack errorMessage)

Definition at line 360 of file proactiveTagging.cpp.

◆ getBestEntity()

std::string proactiveTagging::getBestEntity ( std::string  sTypeTarget)

Loop through all objects in the OPC, and check their saliency.

Return the name of the object with the highest saliency

Parameters
sTypeTarget- type of the target. For now, only ICUBCLIENT_OPC_ENTITY_OBJECT is supported
Returns
Name of the most salient object

Definition at line 70 of file helpers.cpp.

◆ getBodyPartNameForSpeech()

std::string proactiveTagging::getBodyPartNameForSpeech ( const std::string  bodypart)
protected

Return a "nice" version of a body part name, eg given "index" as input, it returns "index finger".

Parameters
bodypart- "Plain" version of a body part name, eg "index"
Returns
"Nice" version of a body part name for speech synthesis, eg "index finger"

Definition at line 266 of file helpers.cpp.

◆ getNameFromSAM()

Bottle proactiveTagging::getNameFromSAM ( std::string  sNameTarget,
std::string  currentEntityType 
)

Send request to SAM to use its face recognition to recognise partner.

Parameters
sNameTargetname of the entity to detect, typically "partner"
currentEntityTypetype of the entity, typically ICUBCLIENT_OPC_ENTITY_AGENT
Returns
Bottle. In case of success: (success entityType) where entityType = agent, in case of failure: (nack)

Definition at line 219 of file proactiveTagging.cpp.

◆ getPeriod()

double proactiveTagging::getPeriod ( )
inline

Definition at line 125 of file proactiveTagging.h.

◆ interruptModule()

bool proactiveTagging::interruptModule ( )

Definition at line 101 of file proactiveTagging.cpp.

◆ recogName()

Bottle proactiveTagging::recogName ( std::string  entityType)
protected

Recognize the name of an unknown entity (communicate with speech recognizer)

Returns
Bottle with either name of the object or (error errorDescription)

Definition at line 138 of file helpers.cpp.

◆ respond()

bool proactiveTagging::respond ( const yarp::os::Bottle &  cmd,
yarp::os::Bottle &  reply 
)

Definition at line 128 of file proactiveTagging.cpp.

◆ searchingEntity()

Bottle proactiveTagging::searchingEntity ( const yarp::os::Bottle &  bInput)

Search for the entity corresponding to a certain name in all the unknown entities.

Parameters
bInputsearchingEntity entityType entityName [verbose] (eg: searchingEntity object octopus)
Returns
Bottle consisting of two elements. First element is {error; warning; success} Second element is: information about the action

Definition at line 484 of file proactiveTagging.cpp.

◆ setPasarPointing()

bool proactiveTagging::setPasarPointing ( bool  on)
protected

Ask pasar to increase saliency when a human is pointing to an object.

Parameters
on- whether pasar should increase the saliency
Returns
True if communication to pasar was successful, false otherwise

Definition at line 46 of file helpers.cpp.

◆ subPopulateBodyparts()

void proactiveTagging::subPopulateBodyparts ( yarp::os::Bottle *  bodyPartList,
yarp::os::Bottle *  bodyPartJointList,
bool  addOrRetrieve 
)
protected

Definition at line 198 of file helpers.cpp.

◆ subPopulateObjects()

void proactiveTagging::subPopulateObjects ( yarp::os::Bottle *  objectList,
bool  addOrRetrieve 
)
protected

Definition at line 29 of file helpers.cpp.

◆ updateModule()

bool proactiveTagging::updateModule ( )

Definition at line 215 of file proactiveTagging.cpp.

Member Data Documentation

◆ babblingArm

std::string proactiveTagging::babblingArm
protected

side of the babbling arm : left or right

Definition at line 46 of file proactiveTagging.h.

◆ GrammarAskNameAgent

std::string proactiveTagging::GrammarAskNameAgent
protected

Name of grammar file when asking for name of agent.

Definition at line 42 of file proactiveTagging.h.

◆ GrammarAskNameBodypart

std::string proactiveTagging::GrammarAskNameBodypart
protected

Name of grammar file when asking for name of bodypart.

Definition at line 44 of file proactiveTagging.h.

◆ GrammarAskNameObject

std::string proactiveTagging::GrammarAskNameObject
protected

Name of grammar file when asking for name of object.

Definition at line 43 of file proactiveTagging.h.

◆ iCub

icubclient::ICubClient* proactiveTagging::iCub
protected

icubclient

Definition at line 30 of file proactiveTagging.h.

◆ period

double proactiveTagging::period
protected

Definition at line 32 of file proactiveTagging.h.

◆ portFromTouchDetector

yarp::os::BufferedPort<yarp::os::Bottle> proactiveTagging::portFromTouchDetector
protected

Port used to communicate with touch detector.

Definition at line 40 of file proactiveTagging.h.

◆ portToPasar

yarp::os::Port proactiveTagging::portToPasar
protected

Port used to communicate with pasar.

Definition at line 39 of file proactiveTagging.h.

◆ portToSAM

yarp::os::Port proactiveTagging::portToSAM
protected

Port used to communicate with SAM.

Definition at line 38 of file proactiveTagging.h.

◆ rpcPort

yarp::os::Port proactiveTagging::rpcPort
protected

Response port.

Definition at line 37 of file proactiveTagging.h.

◆ SAMRpc

std::string proactiveTagging::SAMRpc
protected

Name of SAM RPC port.

Definition at line 34 of file proactiveTagging.h.

◆ thresholdDistinguishObjectsRatio

double proactiveTagging::thresholdDistinguishObjectsRatio
protected

ratio of saliency needed to detect if 1 object is more salient that the other

Definition at line 48 of file proactiveTagging.h.

◆ thresholdSalienceDetection

double proactiveTagging::thresholdSalienceDetection
protected

value of saliency needed to detect if 1 object is more salient that the other

Definition at line 49 of file proactiveTagging.h.

◆ touchDetectorRpc

std::string proactiveTagging::touchDetectorRpc
protected

Name of touchDetector RPC port.

Definition at line 35 of file proactiveTagging.h.


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