Computing KS1 / KS2: Programming robots to play football

Two young coders find out about the instructions that tell robots what to do, looking at the code that operates both a robot football team and an ICub robot that is capable of learning new things.

Science reporter Minna Kane takes them to Plymouth University to meet the Black Ninjas, a robot football team who play in the robot World Cup.

The programmers show the children how they write the code that tells their players what to do.

The robots can recognise shapes and colour, which means they can find the ball.

They use IF/THEN commands to tell the robots when to move and in which direction.

We see the code that tells the robot goalie to dive left, right or keep still depending on the position of the ball, along with coded functions like WALK TO BALL and LOOKING FOR BALL.

The programmer explains how this very complex code is built up of many small functions and processes.

The children are challenged to try to beat the autonomous robots using players they operate themselves.

They manage easily, because football is such a complex game for a robot to play that humans have the upper hand.

The children then meet the ICub robot, and its programmer Tony.

He shows them how he can teach ICub to recognise objects, using voice recognition commands.

They have a go at commanding the robot themselves.

Tony explains that because ICub learns through recognition and repetition like a human, it makes more mistakes than a robot simply following a set of IF/THEN commands.

This clip is form the series Cracking the Code.

Teacher Notes

This could be used to show how programs can accomplish specific goals or as a demonstration of controlling physical systems.

It could also be used to show how problems can be solved by breaking them down into smaller parts.

Curriculum Notes

This clip will be relevant for teaching Computing at KS1 and KS2 in England and Northern Ireland, Design and Technology KS2 in Wales and Computing Science and ICT at Second Level in Scotland.

More from Cracking the Code

Computing KS1 / KS2: Programming a robot crocodile
Computing KS1 / KS2: Creating a simple automated driving simulator
Computing KS1 / KS2: Creating computer generated visual effects
Computing KS1 / KS2: Programming a computer game
Computing KS1 / KS2: Programming a robotic toy car
Computing KS1 / KS2: Simulating the experience of F1 racing
Computing KS1 / KS2: Programming a webcam
Computing KS1 / KS2: What are bitmap graphics?