ALMood API¶
NAOqi Core - Overview | API | Tutorials
Signal list¶
Methods¶
-
bool
ALMood::
subscribe
(const string& subscribedName, const string& operatingMode)¶ Subscribes to ALMood with a specified operating mode. For further details about operating modes, see: Operating Mode.
Parameters: - subscribedName – Name of the subscriber.
- operatingMode – Operating mode for ALMood.
Returns: True if the subscription succeeded, False otherwise.
-
bool
ALMood::
unsubscribe
(const string& subscribedName)¶ Unsubscribes the given subscriber from ALMood.
Parameters: - subscribedName – Name of the subscriber.
Returns: True if the unsubscription succeeded, False otherwise.
-
map<string, string>
ALMood::
getSubscribersInfo
()¶ Gets the list of parameters for all the current subscribers (name and operating mode).
Returns: A struct containing all the subscriber’s information. This is organized as follows:
subscribers = { "subscriber_1" : "Active", "subscriber_2" : "Passive" }
-
PersonState
ALMood::
currentPersonState
()¶ Gets the emotional state of the current focused user through a PersonState struct.
Returns: A struct containing the values of each emotional descriptor of a person. This is organized as follows:
PersonData = { "valence" : { value, confidence }, "attention" : { value, confidence }, "bodyLanguageState" : { "ease" : { level, confidence } }, "smile" : { value, confidence }, "expressions" : { "calm" : { value, confidence }, "anger" : { value, confidence }, "joy" : { value, confidence }, "sorrow" : { value, confidence }, "laughter" : { value, confidence }, "excitement" : { value, confidence }, "surprise" : { value, confidence } } }
Each field contains a value with his confidence, ranged from 0 to 1.
-
PersonState
ALMood::
personStateFromPeoplePerception
(unsigned int ID)¶ Get the emotional state of the user with the identifier ID from PeoplePerception through a PersonState struct.
Parameters: - ID – ALPeoplePerception identifier. Please refer to ALPeoplePerception API for details.
Returns: A struct containing the values of each emotional descriptor of a person. See above.
-
PersonState
ALMood::
personStateFromUserSession
(unsigned int ID)¶ Get the emotional state of the user with the identifier ID from UserSession through a PersonState struct.
Parameters: - ID – ALUserSession identifier. Please refer to ALUserSession - API for details.
Returns: A struct containing the values of each emotional descriptor of a person. See above.
-
std::list<Person>
ALMood::
persons
()¶ Get the list of all the persons present in the memory of the module.
A person is created in this module each time UserSession creates a new user, and is forgotten by the time UserSession deletes this user.
Returns: A struct containing detected persons4 ID and emotional state. This is organized as follows:
Person = { "peoplePerceptionID" : deprecated_ppid, * "userSessionID" : usid, "personState" : { ... *See PersonData in ALMood::currentPersonState* ... } }
* WARNING: “peoplePerceptionID” key is deprecated, do not use it. Next release of ALmood will not manage persons partially detected, i.e. detected by peoplePerception but not by userSession, so “peoplePerceptionID” key will be removed.
-
AmbianceState
ALMood::
ambianceState
()¶ Get the state of the ambient environement through a AmbianceState struct.
Returns: A struct containing the values of each emotional descriptor of an ambiance. This is organized as follows:
AmbianceData = { "agitationLevel" : value, "calmLevel" : value }
Each field contains a value ranged from 0 to 1.
-
std::string
ALMood::
getEmotionalReaction
()¶ Get the emotional reaction of the focused user.
This function looks for the first emotional reaction of the user, and returns when:
- a positive or negative reaction is found, or
- The timeout is reached.
Returns: The detected reaction. For further details, see: Basic Emotions.
Signals¶
-
std::string
ALMood::
currentFocusedUserMood
()¶ Triggered: At each ALMood time period. Returns: The mood of the focused user. For further details, see: Basic Emotions.