Person Node
This node is responsible for implementing various behavioral events in response to detecting a person:
loading...
The implemented behaviours are detailed below:
Person Detected
This node is listening to the person-detected event raised by the FaceRecognition Node and handles this event in the detected method:
loading...
The event is passed to this node for all known persons detected and will be sent continually while one or more persons are in the video frame. If every detected person was processed, the robot would not know who or what to react to. Because of this, this node passes the detected person through a filter. This filter is used to look for a run of similar events, for example, looking for a sequence of 15 times the same person is detected. A TimeSeriesFilter is used to implement this logic, with setting for threshold, timespan over which the series should be detected and timespan to wait till the next time we look for the same person. These setting are found in Settings and the filter is initialized in the startup of this node:
loading...
As well as filtering the detected person, the event centre-thing is called to attempt to centre the camera on the detected person.
After applying the filter, if a new person has been detected, the newperson method is called:
loading...
On detecting a new person, the greeting for this person is derived from the person object and a speech-node-speak event is raised to greet the newly detected person.
The greeting is based on the person_score for the detected person:
loading...
I'm Lonely
Another feature of the Person Node is to do something if after a given timespan, nothing interesting has been detected. If no new person has been detected for a period of time, the robot is deemed to be lonely (bored). This causes the robot to start looking around for something of interest:
loading...
Here the robot raises a start-looking-around event.