icub-client
proactiveTagging.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2015 WYSIWYD Consortium, European Commission FP7 Project ICT-612139
3  * Authors: GrĂ©goire Pointeau, Tobias Fischer, Maxime Petit
4  * email: greg.pointeau@gmail.com, t.fischer@imperial.ac.uk, m.petit@imperial.ac.uk
5  * Permission is granted to copy, distribute, and/or modify this program
6  * under the terms of the GNU General Public License, version 2 or any
7  * later version published by the Free Software Foundation.
8  *
9  * A copy of the license can be found at
10  * icub-client/license/gpl.txt
11  *
12  * This program is distributed in the hope that it will be useful, but
13  * WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
15  * Public License for more details
16 */
17 
18 #include <yarp/os/all.h>
19 
20 namespace icubclient {
21  class ICubClient;
22 }
23 
27 class proactiveTagging : public yarp::os::RFModule {
28 protected:
29 
31 
32  double period;
33 
34  std::string SAMRpc;
35  std::string touchDetectorRpc;
36 
37  yarp::os::Port rpcPort;
38  yarp::os::Port portToSAM;
39  yarp::os::Port portToPasar;
40  yarp::os::BufferedPort<yarp::os::Bottle> portFromTouchDetector;
41 
42  std::string GrammarAskNameAgent;
43  std::string GrammarAskNameObject;
44  std::string GrammarAskNameBodypart;
45 
46  std::string babblingArm;
47 
50 
51  //Configure
56  void configureOPC(yarp::os::ResourceFinder &rf);
57  void subPopulateObjects(yarp::os::Bottle* objectList, bool addOrRetrieve);
58  void subPopulateBodyparts(yarp::os::Bottle* bodyPartList, yarp::os::Bottle* bodyPartJointList, bool addOrRetrieve);
59 
60  //objectTagging
65  yarp::os::Bottle recogName(std::string entityType);
66 
72  std::string getBodyPartNameForSpeech(const std::string bodypart);
73 
79  bool setPasarPointing(bool on);
80 
81 public:
87  yarp::os::Bottle exploreUnknownEntity(const yarp::os::Bottle &bInput);
88 
94  yarp::os::Bottle searchingEntity(const yarp::os::Bottle &bInput);
95 
101  std::string getBestEntity(std::string sTypeTarget);
102 
103 
110  yarp::os::Bottle getNameFromSAM(std::string sNameTarget, std::string currentEntityType);
111 
117  yarp::os::Bottle exploreTactileEntityWithName(yarp::os::Bottle bInput);
118 
119  bool configure(yarp::os::ResourceFinder &rf);
120 
121  bool interruptModule();
122 
123  bool close();
124 
125  double getPeriod() {
126  return period;
127  }
128 
129  bool updateModule();
130 
131  bool respond(const yarp::os::Bottle& cmd, yarp::os::Bottle& reply);
132 };
Grants access to high level motor commands (grasp, touch, look, goto, etc) of the robot as well as it...
Definition: icubClient.h:66
std::string GrammarAskNameObject
Name of grammar file when asking for name of object.
yarp::os::Port portToSAM
Port used to communicate with SAM.
double thresholdSalienceDetection
value of saliency needed to detect if 1 object is more salient that the other
std::string GrammarAskNameAgent
Name of grammar file when asking for name of agent.
std::string babblingArm
side of the babbling arm : left or right
std::string touchDetectorRpc
Name of touchDetector RPC port.
double thresholdDistinguishObjectsRatio
ratio of saliency needed to detect if 1 object is more salient that the other
std::string SAMRpc
Name of SAM RPC port.
icubclient::ICubClient * iCub
icubclient
yarp::os::BufferedPort< yarp::os::Bottle > portFromTouchDetector
Port used to communicate with touch detector.
std::string GrammarAskNameBodypart
Name of grammar file when asking for name of bodypart.
yarp::os::Port portToPasar
Port used to communicate with pasar.
yarp::os::Port rpcPort
Response port.