Skip to the notes
robocupjunior.org.nz

Junior Robotics Notes

an independent NZ guide to classroom robotics

N-04Competitions explained

How robot soccer works, in general

Infrared balls, compass sensors, attackers and goalies: the general ideas behind school robot soccer, without any one competition's rules.

Robot soccer is the most eye-catching of the school robotics challenges. Two small teams of autonomous robots chase a ball around a walled field and try to push it into a goal, with no remote control once the match starts. It looks chaotic, but underneath it is a tidy set of engineering problems: find the ball, know which way you are facing, get behind the ball, and push it the right way.

This note explains those ideas in general terms. It is not a rulebook. Each competition publishes its own rules, they change from year to year, and teams should always work from the current official version for the event they are entering.

Where it comes from

The best-known robot soccer movement is the international RoboCup initiative, founded in 1997. Its stated long-term goal is that, by the middle of the 21st century, a team of fully autonomous humanoid robots should be able to beat the most recent human World Cup winners under FIFA rules. School leagues are a long way from humanoids, but they share the same spirit: robots have to sense, decide and act entirely on their own.

Finding the ball

Junior robot soccer has long used a ball that emits infrared light, which robots detect with infrared sensors arranged around their body. By comparing which sensors see the strongest signal, the robot can estimate the direction of the ball and roughly how far away it is. Some leagues and newer rule sets use coloured balls tracked with cameras instead, which is harder but closer to how real-world vision works.

Whichever system is used, the first program a soccer team writes is the same as for line following: print the raw sensor readings and walk the ball around the robot to see how they change.

Knowing which way is "forward"

A robot that chases the ball perfectly but scores in its own goal hasn't helped. Robots need a sense of direction, and the usual tool is a compass sensor (magnetometer), sometimes combined with a gyro. The micro:bit, for example, has a built-in compass that measures magnetic fields in three dimensions.

Compasses are easily confused by motors, steel table legs and the reinforcing in concrete floors, so teams calibrate on the actual field and mount the sensor as far from the motors as they can. Some also use the field's walls, coloured goals or lines on the floor as extra clues.

A simplified field with an attacker behind the ball and a goalie in front of its own goal ball attacker goalie
Fig. 1: the attacker gets behind the ball before pushing; the goalie slides along its own goal mouth.

Attacker and goalie

Most school teams split their two robots into roles.

  1. The attacker locates the ball, circles round so the ball sits between the robot and the opponent's goal, then drives forward. "Get behind the ball first" is the single most important behaviour to get right.
  2. The goalie stays near its own goal, sliding sideways to keep itself between the ball and the goal. It only charges out when the ball comes close, then returns.

Simple versions of both can be written as a short list of if/else rules. Better teams add states (for example "searching", "approaching", "pushing", "returning") so the robot behaves sensibly when it loses sight of the ball.

Staying on the field

Fields are usually marked with a white line near the walls, and robots that leave the playing area can be penalised. That means a soccer robot often carries downward-facing light sensors too, and the code that reacts to the boundary line needs to take priority over chasing the ball. It is the same reflected-light idea used in line following, put to a different job.

Mechanical choices

  • Omni-wheels let a robot move sideways without turning, which makes "get behind the ball" much simpler. They are more expensive and more complex to program than a two-wheel drive.
  • A shaped front or small dribbling area helps the robot keep the ball as it pushes.
  • Size and weight limits are set by each competition's rules, so check them before you build anything permanent.

What students learn

Robot soccer is a great teacher of trade-offs. Faster robots are harder to control; more sensors mean more code; heavier robots push better but drain batteries quicker. It also rewards teamwork, because two robots that both chase the ball are usually beaten by a pair with clear, separate jobs.

If your students want to enter a competition, look up the organisers of the event by name and read their current rules and dates. This site does not run events or publish rules, but the general ideas above apply wherever you play.

Practising without a full field

Few schools have a full-size practice field. A corner of the classroom marked out with tape, a couple of boxes for walls and a single ball are enough to practise the most important skill: finding the ball and getting behind it. Time how long the robot takes from a few fixed starting positions, change one thing, and time it again.

Sources: RoboCup Federation: objective; micro:bit features overview (compass).