Behaviour-based design. Subsumption architecture
June 3, 2014
One ot the most challenging tasks I planned for Hurby project, was to define its behaviour. It should behaves in an intelligent manner, discriminating between different happiness states according with user (my daughters) interaction.
Basically, I wanted that Hurby's happiness will depend on two main causes:
- My daughters should play with it frequently (once a day or a couple of days)
- They should play with it at least for a minimum period of time (5 to 10 minutes)
Also, independently of that, Hurby must react to different kind of events coming from its sensors, for example:
- Listening and answering to voices or external noises
- Emitting calm sounds and quiet movements when caressed on its head
- Laughing when tickled on its tummy
- Becoming upset when picked and lifted up by its ears
- Going to sleep in the absence of activity during a period of time
After studied different behaviour-based robotics architectures, I decided to use a subsumption one. For those who are not familiar with subsumption architectures, internet is a rich place to look for, but this one from its creator can be the best starting point: "A robust layered control system for a mobile robot" by Rodney A. Brooks (September, 1985) .
What Brooks describes, is a new behaviour-based architecture to let robots operate at difference levels of competence, in a layered architecture, in which some layers can supress or inhibit the function of lower (low-priority) layers. What it calls "subsume the role of lower levels".
The result is a robust and flexible control system in which different goals can be achieved in paralel with independence between layers. This is the classical structure of this kind of architectures:
In the case of Hurby toy, at level 0, there is its most basic behaviour, "happiness". Is the behaviour by default, and will be predominant while higher layers are quiet. The rest of behaviours, will be placed in higher layers, as they are asynchronous and event-driven reactions due to puntual sensor detections.
The Subsumption architecture for Hurby toy, is shown and explained below, and as you can see, different behaviours are translated into eyes, ears and feet movements; and emitting voice or other kind of sounds.
The module which controls these actuators, is what I've called Motor Cortex.
Level 0 (Happiness): As said before, it is the most basic behaviour. When happy, Hurby will move fast, emit sounds and voices continuosly, trying to catch the attention of my daughters to play with it. As it becomes more and more unhappy, it will change its behaviour: slower movements, calm sounds, and so on.
Level 1 (Listen): Hurby can be moving and emiting sounds according with its happiness (level 0), but if it listens a voice from my daughters or other kind of external noise, it inhibits its default behaviour and starts a listening state in which it stops eye movements, place the ears back to listen better and stay quiet. If the voice or noise is identified or it meets some kind of pattern, it reacts accordingly.
Level 2 (Caress): Hurby can be moving freely or listening (level 0, 1) but if it is caressed on its head by one of my daughters, it will behaves as if it was extremely calm and quiet. Soft movements and calm sounds will be predominant against other behaviours.
Level 3 (tickle): Hurby can be happy or unhappy, listening and/or being caressed, but if it is tickled on its tummy it will start laughing. Well, it will laugh if happy, else it can react as if tickling was an uncomfortable situation.
Level 4 (Sorrow): There is one thing above all, which Hurby cannot tolerate, it is when is lifted up by an ear. Its an uncomfortable situation that increase its anger and sorrow.
Level 5 (Sleep): Hurby, needs sleep a lot of time.So if my daughters stop playing with it for a while (5 mins aprox.) it feels the need for sleep. It will close its eyes and stay quiet. Of course, if they touch it during several seconds, can wake it up.
In separate blogs I talk about the fuzzy inference module which controls Hurby's happiness state.