19 #ifndef __ICUBCLIENT_ICUBCLIENT_H__ 20 #define __ICUBCLIENT_ICUBCLIENT_H__ 30 #include <yarp/sig/Vector.h> 82 if (subSystems.find(subSystemName) == subSystems.end())
85 return (T*)subSystems[subSystemName];
94 for(
const auto subSystem : subSystems) {
95 if(std::type_index(
typeid(T)) == std::type_index(
typeid(subSystem))) {
122 ICubClient(
const std::string &moduleName,
const std::string &context =
"icubClient",
123 const std::string &clientConfigFile =
"client.ini",
bool isRFVerbose =
false);
130 bool connect(
const std::string &opcName =
"OPC");
137 bool connectOPC(
const std::string &opcName =
"OPC");
163 bool home(
const std::string &part =
"all");
175 bool release(
const std::string &oLocation,
const yarp::os::Bottle &options = yarp::os::Bottle());
188 bool release(
const yarp::sig::VectorOf<double> &target,
const yarp::os::Bottle &options = yarp::os::Bottle());
201 bool point(
const yarp::sig::VectorOf<double> &target,
const yarp::os::Bottle &options = yarp::os::Bottle());
203 bool point(
const double x,
const double y,
const double z,
const yarp::os::Bottle &options = yarp::os::Bottle()) {
204 yarp::sig::VectorOf<double> target(3);
208 return point(target, options);
222 bool point(
const std::string &oLocation,
const yarp::os::Bottle &options = yarp::os::Bottle());
230 bool waving(
const bool sw);
244 bool push(
const std::string &oLocation,
const yarp::os::Bottle &options = yarp::os::Bottle());
257 bool take(
const std::string &oName,
const yarp::os::Bottle &options = yarp::os::Bottle());
269 bool pushKarmaLeft(
const std::string &objName,
const double &targetPosYLeft,
270 const std::string &armType =
"selectable",
271 const yarp::os::Bottle &options = yarp::os::Bottle());
282 bool pushKarmaRight(
const std::string &objName,
const double &targetPosYRight,
283 const std::string &armType =
"selectable",
284 const yarp::os::Bottle &options = yarp::os::Bottle());
295 bool pushKarmaFront(
const std::string &objName,
const double &targetPosXFront,
296 const std::string &armType =
"selectable",
297 const yarp::os::Bottle &options = yarp::os::Bottle());
308 bool pullKarmaBack(
const std::string &objName,
const double &targetPosXBack,
309 const std::string &armType =
"selectable",
310 const yarp::os::Bottle &options = yarp::os::Bottle());
321 bool pushKarma(
const yarp::sig::VectorOf<double> &targetCenter,
const double &theta,
const double &radius,
322 const yarp::os::Bottle &options = yarp::os::Bottle());
334 bool drawKarma(
const yarp::sig::VectorOf<double> &targetCenter,
const double &theta,
335 const double &radius,
const double &dist,
336 const yarp::os::Bottle &options = yarp::os::Bottle());
345 bool look(
const std::string &target,
const yarp::os::Bottle &options = yarp::os::Bottle());
354 bool look(
const yarp::sig::VectorOf<double> &target,
const yarp::os::Bottle &options = yarp::os::Bottle());
389 bool babbling(
int jointNumber,
const std::string &babblingArm,
double train_dur = -1.0);
400 bool babbling(
const std::string &bpName,
const std::string &babblingArm,
double train_dur = -1.0);
409 bool say(
const std::string &
text,
bool shouldWait =
true);
bool point(const yarp::sig::VectorOf< double > &target, const yarp::os::Bottle &options=yarp::os::Bottle())
Point at a specified location from the iCub.
SubSystem_babbling * getBabblingClient()
void commitAgent()
Commit the local definition of iCub agent to the OPC.
Abstract subSystem for speech management (Text to Speech)
std::list< Action * > actionsKnown
Represent any entity that can be stored within the OPC.
SubSystem to deal with the actionsRenderingEngine module (a.k.a.
bool connectOPC(const std::string &opcName="OPC")
Try to connect to OPC.
Grants access to high level motor commands (grasp, touch, look, goto, etc) of the robot as well as it...
bool connect(const std::string &opcName="OPC")
Try to connect all functionalities.
SubSystem_emotion * getEmotionClient()
bool pushKarmaFront(const std::string &objName, const double &targetPosXFront, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarmaFront: push an object by name to front See the SubSystem_KARMA::pushFront documentation for ...
SubSystem to deal with the experimental affordance learning module (a.k.a.
bool lookAtPartner()
Looks at the agent if present in the scene.
Represent any physical entity (including objects and agents) that can be stored within the OPC...
bool take(const std::string &oName, const yarp::os::Bottle &options=yarp::os::Bottle())
Take (grasp) an object.
T * getSubSystem(const std::string &subSystemName)
SubSystem for agentDetector.
SubSystem_Speech * getSpeechClient()
Represents an action, whether composite or not.
std::list< Object * > getObjectsInSight()
Get the list of object that are in front of the iCub Warning: this will update the local icubAgent...
bool changeName(Entity *e, const std::string &newName)
Change the name of a given entity.
bool babbling(int jointNumber, const std::string &babblingArm, double train_dur=-1.0)
Babbling using a single joint.
bool connectSubSystems()
Try to connect to all sub-systems.
bool home(const std::string &part="all")
Go in home position.
bool isTargetInRange(const yarp::sig::VectorOf< double > &target) const
Check if a given cartesian position is within the reach of the robot This can be adjusted using the r...
std::tuple< std::string, double > getHighestEmotion()
Get the strongest emotion.
bool release(const std::string &oLocation, const yarp::os::Bottle &options=yarp::os::Bottle())
Release the hand-held object on a given location.
T * getSubSystem(T)
get a subsystem by just providing the type untested, just to play around with C++11 ...
Abstract class to handle sub-systems of the icub-client.
bool pushKarma(const yarp::sig::VectorOf< double > &targetCenter, const double &theta, const double &radius, const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarma (KARMA): push to certain position, along a direction See the SubSystem_KARMA::push document...
bool push(const std::string &oLocation, const yarp::os::Bottle &options=yarp::os::Bottle())
Push at a specified location.
bool pushKarmaRight(const std::string &objName, const double &targetPosYRight, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarmaRight: push an object by name to right side See the SubSystem_KARMA::pushAside documentation...
An OPC client using the datastructures defined within the icub-client library.
ICubClient(const std::string &moduleName, const std::string &context="icubClient", const std::string &clientConfigFile="client.ini", bool isRFVerbose=false)
Create an iCub client.
bool look(const std::string &target, const yarp::os::Bottle &options=yarp::os::Bottle())
Look at a specified target object.
void close()
Properly closes all ports which were opened.
bool lookAtBodypart(const std::string &sBodypartName)
Looks at the agent specific bodypart if present in the scene.
Abstract subSystem for speech recognizer.
std::list< Action * > getKnownActions()
Get the list of actions known the iCub.
virtual ~ICubClient()
Destructor.
bool waving(const bool sw)
Enable/disable arms waving.
bool pullKarmaBack(const std::string &objName, const double &targetPosXBack, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pullKarmaBack: pull an object by name back See the SubSystem_KARMA::pullBack documentation for more d...
SubSystem_IOL2OPC * getIOL2OPCClient()
yarp::sig::VectorOf< double > getPartnerBodypartLoc(std::string sBodypartName)
Extract the location of the bodypart name of the partner.
std::string getPartnerName(bool verbose=true)
Extract the name of the agent interaction with the iCub (present, not iCub nor 'unnamed' partner) ...
void updateAgent()
Retrieve fresh definition of the iCub agent from the OPC.
std::list< Object * > getObjectsInRange()
Get the list of objects that are graspable by the iCub See isTargetInRange() for a definition of how ...
bool pushKarmaLeft(const std::string &objName, const double &targetPosYLeft, const std::string &armType="selectable", const yarp::os::Bottle &options=yarp::os::Bottle())
pushKarmaLeft: push an object by name to left side See the SubSystem_KARMA::pushAside documentation f...
bool point(const double x, const double y, const double z, const yarp::os::Bottle &options=yarp::os::Bottle())
bool drawKarma(const yarp::sig::VectorOf< double > &targetCenter, const double &theta, const double &radius, const double &dist, const yarp::os::Bottle &options=yarp::os::Bottle())
drawKarma (KARMA): draw action, along the positive direction of the x-axis (in robot FoR) See the Sub...
SubSystem_SAM * getSAMClient()
std::map< std::string, SubSystem * > subSystems
bool say(const std::string &text, bool shouldWait=true)
Ask the robot to perform speech synthesis of a given sentence.
SubSystem_KARMA * getKARMA()
SubSystem_agentDetector * getAgentDetectorClient()
SubSystem_Recog * getRecogClient()