icub-client
subSystem_emotion.h
Go to the documentation of this file.
1 #ifndef SUBSYSTEM_EMOTION_H
2 #define SUBSYSTEM_EMOTION_H
3 
4 /*
5  * Copyright (C) 2014 WYSIWYD Consortium, European Commission FP7 Project ICT-612139
6  * Authors: Daniel Camilleri
7  * email: d.camilleri@sheffield.ac.uk
8  * website: http://wysiwyd.upf.edu/
9  * Permission is granted to copy, distribute, and/or modify this program
10  * under the terms of the GNU General Public License, version 2 or any
11  * later version published by the Free Software Foundation.
12  *
13  * A copy of the license can be found at
14  * icub-client/license/gpl.txt
15  *
16  * This program is distributed in the hope that it will be useful, but
17  * WITHOUT ANY WARRANTY; without even the implied warranty of
18  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU General
19  * Public License for more details
20  */
21 
22 #define SUBSYSTEM_EMOTION "emotion"
23 
24 #include <iostream>
26 
27 namespace icubclient{
34 {
35  friend class ICubClient;
36 
37 protected:
38  virtual bool connect();
39 
40 private:
41  typedef std::map<std::string, std::string> StringMap;
42 
48  bool sendEmotion(std::pair<std::string, std::string> emPair);
49 
50  StringMap mapToEmotion = StringMap {
51  {"neutral", "neu"},
52  {"talking", "tal"},
53  {"happy", "hap"},
54  {"sad", "sad"},
55  {"surprised", "sur"},
56  {"evil", "evi"},
57  {"angry", "ang"},
58  {"shy", "shy"},
59  {"cunning", "cun"}
60  };
61 
62  StringMap mapToPart = StringMap {
63  {"mouth", "mou"},
64  {"eyelids", "eli"},
65  {"left_eyebrow", "leb"},
66  {"right_eyebrow", "reb"},
67  {"all", "all"}
68  };
69 
70  std::pair<std::string, std::string> currentEmotionPair;
71 
72 public:
77  SubSystem_emotion(const std::string &masterName);
78 
79  virtual void Close();
80 
87  bool setEmotion(std::string emotion, std::string part="all");
88 
93  std::pair<std::string, std::string> getEmotion();
94 
95 };
96 }//Namespace
97 
98 #endif // SUBSYSTEM_EMOTION_H
SubSystem_emotion(const std::string &masterName)
Default constructor.
Grants access to high level motor commands (grasp, touch, look, goto, etc) of the robot as well as it...
Definition: icubClient.h:66
virtual void Close()
Clean up resources.
bool setEmotion(std::string emotion, std::string part="all")
Method to switch iCub emotion for different parts of face.
Abstract class to handle sub-systems of the icub-client.
Definition: subSystem.h:43
SubSystem for emotion.
std::pair< std::string, std::string > getEmotion()
Method to get current iCub emotion.