Skip to content

Position Role

Each playing robot is assigned a tactical position with an associated Voronoi region. Furthermore, each robot is also assigned a role that specifies the current duty of the robot. If the assigned role is not an active role (i.e. currently not playing the ball), the default behavior of the position role computes a pose at which the robot should position itself in a tactical way.

PositionRole is an abstract class that specifies an interface for the specific types of position roles. They have to override the position method that returns the pose (position and orientation) where the robot should go.

Rating Role

RatingRole is an abstract specialization of PositionRole that determines the position by optimizing a rating function. A new role using this abstraction only needs to implement said rating function in a way that the returned result is higher the better the position. A common practice is to rate the position based on different metrics in the range [0-1] and multiply them together. The optimization is already implemented by the abstract RatingRole using numerical gradient ascend.

The rating is also used to determine whether it is sufficient to just stay at current position and let the motors cool down. This allows (compared to the classical approach using distance thresholds) to stand still although the found position is far away but not much better than the current one. The decision is implemented by the RatingRole, but the specific implementations can set the parameters.

Common Ratings

This section lists some ratings that are used by most or all of our implementations of the RatingRole but sometimes with different parameterization.

Voronoi Region

Outside the Voronoi region, the rating should be zero to ensure that each position role stays inside the associated region to prevent changes of the tactic. Additionally, positions near the cell border are also rated worse using an exponential function to ensure continuity, which helps the optimization algorithm.

baseRating

This rating ensures that positions near the base pose from the tactic are rated higher. The rating uses a Gaussian function based on the distance to the base pose.

fieldBorderRating

This rates positions near the field border worse using an exponential function.

communicationRating

This rates positions near the last communicated target position better to add a sort of hysteresis to save team messages. It also uses a Gaussian function but combined with a minimum value.

ballDistance

To prevent robots that should not currently play the ball from interfering with the one that should, positions near the ball are rated worse. This is done with one minus a Gaussian function.

Forward

The main subjective of Forward players is to receive a pass and score a goal afterwards. Therefore, the same functions for rating a pass and goal shot (described here) are used additionally to the common ratings.

Midfielder

As we do not reliably know whether we or the opponent is in possession of the ball, the midfielder should spread across the field to cover as much space as possible. On the one hand, this provides diverse pass targets in case we are in ball possession, on the other hand, it ensures that we can quickly reach all positions on the field where an opponent played the ball.

This is implemented by rating the position based on the distance to the next teammate. Positions further from the nearest teammate are rated better. Additionally, a preferred distance to the ball is realized by a shifted Gaussian function based on the distance to the ball together with a minimum value. To enable a fast response to counterattacks, the position used for the baseRating is continuously shifted towards the ball if it is in the opponents half.

In the special case that we have a free kick, we know that we are in ball possession. In that case, a rating based on the pass and goal rating similar to the forward is used.

Defender

The duty of the defenders is to prevent goals for the opponent. For this task, two scenarios have to be considered.

  1. Direct shot at the goal
  2. Priming (e.g. pass) to get in a better position to score.

To counter the first, the defender includes a rating based on the distance to the line between the ball and the center of the goal.

To react to passes to free areas, a rating based on the distance to the nearest teammate similar to the midfielder is used to provide good space coverage. In addition to space coverage, it is also tried to mark opponent players directly. In order to do that, an ideal marking position is computed for each opponent. The ratings based on the distance to that position (weighted with the scoring quality of the opponent) are summed to create a combined rating. This rating favors opponents that are in a good position to score and also clusters where multiple opponents can be marked with just one defender.

Attacking Goalkeeper

The task oft the goalkeeper is to stop direct shots at the goal as a last resort. A specialty of the attacking goalkeeper is that it should stand further out to occupy a larger area and therefore allow more field players to participate during an attack.

In order to block goal shots, the sectors of the goal that are not blocked by the goalkeeper should be small. This is translated in a rating based on the size of the largest free angle from the ball to the goal, considering the position and width of the goalkeeper. The formulation using the angle instead of a line as the defender has two advantages. First, it naturally prefers positions near to the ball as this increases the blocked angle. This fits with the desired behavior of the attacking goalkeeper. Furthermore, it does not change much if the ball is far away, allowing the goalkeeper to rest.

In order to prevent that the goalkeeper is outplayed, a rating is added that penalizes positions in front of the opponent nearest to the ground line.

As in our case the goalkeeper often preferred to stay in the goal although a position up front had been found, we changed the positionRating from a circular Gaussian function to an ellipse.


Last update: October 14, 2024