Date: 13.01.2008
Duration of activity: 6 hours
List of participants: Alessandro, Daniela, Samuele
At this point we completed testing and implementing almost every small component for our robot. We then tried to put everything together.
We had already agreed on a motivation-based architecture, because we want our robot to have different behaviors, depending on its wills (i.e. internal states, motivations).
We had still to define implementation details. We discussed many points, and we summarize here our final decisions and their motivations.
Architecture discussionWe defined four behaviors, which can be seen in the chart below, in a subsumption style.
Modules:Each of those four behaviors gives its output to the Navigator, which is an adapter class for motors.
The lowest priority behavior is Party Searcher: its responsibility is to drive the robot toward the nearest sound source. We will use the Braitenberg strategy, already implemented and tested in previous sessions. It only receives input from Sound Sensors.
The second behavior is Party Reacher: it drives the robot toward a known sound source, when a new source is received from other agents. It receives locations from incoming bluetooth communications.
The third behavior is Avoider: it makes the robot go back when encounters some obstacle, helping it keeping track of its position. It uses the Ultrasonic Sensor.

The highest priority behavior is At The Party: it is activated only when the robot is close to a sound source, hence it uses the Sound Sensors and some sound level threshold. It acts by stopping the robot and communicating its coordinates to any other robot in range for a bluetooth communication.
Suppression order:The Party Reacher behavior must have higher priority than the Party Searcher behavior, because if some party location is already known and not visited, there is no need for wandering and looking for sound.
The Avoider behavior has higher priority than the Party Searcher and Party Reacher behaviors, since when moving, the robot must always be careful about obstacles, in order to keep track of its position.
When stopped inside a party, instead, it is better it remains stopped, in order to avoid losing the party position. In addition to this, the only cause of the avoider detecting some obstacle when stopped inside a party is when new robots arrive to the same party. It will be other robots' responsibility to not hit the stopped robots.
The At The Party behavior must have a priority higher than the one of the Party Searcher behavior, to obviously stop the search when successful. It also must be higher of the Party Reacher behavior priority, because even if the party where the Party Reacher is leading the robot is not perfectly reached, and the At The Party behavior recognizes the sound level of a party, it could only be because of some error in Navigation class; if the reasonable sound threshold is reached while driving to some known party coordinates, instead, there is no need to continue going toward the specified location.
As already specified in previous lab sessions, Navigator class we will use is similar to the one from lejos packages, being able of keep track of robot position, but it accepts motor powers as input, instead of simple coordinates, in order to work with our Braitenberg-like sound follower.
In addition to those modules, a Map must be implemented, which is basically a collection of landmarks (in this case party locations) to remember, and some helper methods.
MotivationsAs pointed out before, we want our robot to have a motivation based architecture. In the discussion above the architecture seems to be working and functional only using a simple subsumption architecture. Why do we want then to use motivation functions, instead of simple boolean activation?
What we want to obtain is the behavior of an artificial creature, so we want the motivations be conditioned by some internal state. But after defining the agents' behaviors, we noticed that those four behaviors are not concurrent, in their simple interpretation, but they must be in that precise order, to work coherently.
The idea of building a flock of agents that locates parties must then be explained. It is true that an agent which locates sound must follow a precise deterministic strategy, in order to get to one of its goals. But then, when some party locations are known to the flock, and when many robots are inside a sound source, then a complex flock behavior can be imagined.
After having found a sound source, agents could evaluate their motivation of remaining at that party according to
- the number of mates in the same party and their personal willing of be in company
- the time of having been stopped and their personal willing of walking a bit
- the time spent and the music volume of that party and their personal willing of listening to music
- the kind of music of that party and their personal taste in music (although we already decided that the capability of recognizing some features of a sound is too hard to implement).
In addition to this, not only behavior arbitration could be affected by internal motivations, but also the intensity of behavior actions.
If some agent has a low motivation for walking, it could wander slowly, or stop, even if it is not inside a party.
If some agent has an high willing of listening to music, it could low down the party sound threshold, or speed up motors, in order to more easily end up listening to some music.
Then, although a simple subsumption architecture could be enough for our project, this is why we chose to implement behaviors with motivation functions: we want our architecture to be scalable to further experiments.
Data flowThe diagram below can illustrate better data flows between modules.

Modules are the same as in the previous diagram. Arrows show directions of data flow.
This layout helps to see how inter-agents communication works.
First part of the communication - an agent founds a party:When the "At The Party" behavior receives from Sound Perceiver (an adapter for two sound sensors) a sound level over some threshold, the robot knows it is in the range of a party. Then it tells Navigator to stop, and saves current location inside the Map. The map, then, automatically notifies the Communicator module, which broadcasts the new location to any other agent around.
Second part of the communication - an agent receives a party location:When a Communicator module of some agent receives an incoming communication about some party location, it sends it into the Map.
The Party Reacher behavior, which polls the Map, will notice the new landmark added by some external agent, and will communicate those coordinates to Navigator module, which will drive up to that location.
When arrived to the location, Party Reacher will lose its motivation, and Party Searcher will do the rest of the job to correct possible errors in position tracking, up to when the At The Party behavior will detect a party.
We proceeded then implementing (or adapting some older classes) the most of the discussed architecture, and we left debugging and testing to the following day.