Strategy

Just having good robot hardware won’t score a goal, instead someone has to tell the robots what to do. And that’s where our artificial intelligence comes into play. It’s running on a computer next to the field and uses the vision data, the referee commands and the robot’s feedback to generate orders which are then issued to our robots. To achieve a low reaction time, the strategy decisions have to be revaluated very frequently (in our case up to 100 times per second).

 

AI architecture

Even though the whole strategy code runs on a single computer, we use a distributed AI architecture. In short, that means that each robot makes its own decisions. There is no central module that tells the robots what to do. Technically, each so-called agent (blue box) makes the decision for the robot it is handling.

However, since soccer is a team game, a certain form of coordination has to take place. In our case this is solved by two key elements:

  1. The messaging system is a way to distribute information across the AI. Each agent can announce its decisions, propose attack maneuvers or apply for special roles. The messages are then delivered between two frames.
  2. The trainer is responsible for global decisions, like how many attackers do we need, which robot is allowed to approach the ball or which opponent has to be defended the most. The trainer also communicates with the robots via the messaging system.

Each agent has a list of possible behaviors depending on its type (keeper, defender or attacker).

  • The keeper of course tries to defend the goal, clear the ball or even initiate an attack.
  • A defender either follows an opponent across the field or blocks goal shots.
  • An attacker can dribble the ball, pass, shoot goals, shake off defenders or contest the ball if an opponent is controlling it.

The purpose of the behavior is then to decide, what to do. In case of a man marker, it might be a good strategy to check whether it is possible to intercept opponent passes. Or what if the opponent which the robot is currently marking already received a pass? In this case the defender may try to contest the ball. The same concept is used for the attackers. A striker can either sidestep, accept a pass or just keep the opponent defenders busy. An attacker which possesses the ball can pass it, shoot towards the goal, dribble or stall for a short time.

The task then elaborates how to realize the decision. The task “shoot goal” for example calculates the exact target where to shoot at while the keeper task searches for a position where the robot can reduce the probability of an opponent scoring a goal.

The resulting commands are eventually fed into a path planning algorithm called Rapidly-exploring Random Tree (RRT). The purpose of this stage is to find a path from the robot’s current position to the desired destination without colliding with other robots, accidently touching the ball or moving into no-go areas (like the opposing defense area). A trajectory planner smoothes the path and calculates a velocity curve, which is then sent to the robot via radio, along with shoot and dribbler commands.