Robots aren't justin science-fiction stories,they're already playinga role in our lives,from making cars, toysand electronic gadgets -we've even got them playingtheir own sport now.
WHISTLE
All robots are controlledby a computer,but the question is, how doesthe computer tell them what to do?My hackers and I are goingto find out.
Hi, I'm Sam.
Hi, I'm Saffia.
We've come to Plymouth Universityto meet their robot football team.
Come on, guys!
One, two, three, go!
Today, it's people versus machines.Sam and Saffia are usinggame controllersto control these white robots,but they're up againstPlymouth's Black Ninja robots,who play football in theInternational Robot World Cup.The black robotshave been programmedso they can play by themselves,they don't need anyonecontrolling them with joy pads.It's pretty clever stuff.These are our football robots.The rules state, in the competition,that all the robots have to bewhat's known as autonomous,that means automatic.So they have to doeverything by themselves,without humans controlling.The main thing about these robotsis that they use shapesand colours to define things,but they have to havelittle tricks,like an orange thingon a green background.If you took that orange balland you put it over in a differentcoloured background,it won't think that's the ball.
You have to make very simple rulesto make it understand what to do.
THEY CHEER
'To make robots playfor themselves,'we have to write computer code -'it's this code that makesthe robot do things,'like walk or kick the ball.'Programmers need to think hard'about exactly what actionsthe robot needs to perform,'what things does the programneed to know'and what things doesn't it needto worry about.
'For example, if we wantto programme a robot goalkeeper'we need to know where the ball isand when it's heading for the goal,'so the position isthe most important thing.'We can think of a number linefor our position,'with zero in the middlewhere our goalkeeper starts.'If the ball is headingfor the negative numbers,'then the goalkeeper divesto the right.'If it's positive,'then the goalkeeper divesto the left,'and if it's near the middle,then he stays in the middle.
'But what does the code to controlthe goalkeeper actually look like?'
If the ball is between this far awayand over to the left,then we want you to dive left.'If the position along the goal line'is bigger than 100but less than 2,000,'then the code makesthe goalkeeper dive to the left.'But if the position is betweenminus 100 and minus 2,000,'the goalkeeper dives right.'And also, we have to have a robotthat just stands in the middle,because, otherwise, if he dived leftand the ball was going straightat us, it would be a goal.'If the position is close to zero,'in between minus 100and positive 100,'then the goalkeeperstays in the middle.'So the goalkeeper decideswhat he's going to do'using these "if" conditions.'
How do you write such a longand complicated code?
A long piece of codeis made up of small functions,and the functions do variouslittle things that we want.So "looking for ball"would be a function.Then "walk to ball"would be another function.So that makes itmuch more manageable.So robots break downplaying footballinto a series of differentfunctions, simple tasks.
I wonder how different that isfrom what Sam and Saffia are doingwhen they're controllingtheir robots.
Oh, come on!
BOTH: Yeah!
Once a program has been written,the code gets downloadedonto the robot.Each robot has its own processorboard,a tiny computer that runs the codeso it can decide what the robotshould do.
All right, guys, that's it, OK.
The scores are 2-0to the white team.
THEY CHEER
'With so many things to do,'playing football's actuallya very complicated game'for a robot to play.'Even with all the long code,'the autonomous robotscouldn't always find the ball'or kick it in the right direction,'so they just couldn't winagainst Saffia and Sam.'
Press that button there and he'll doan impression of Usain Bolt.
HE CHUCKLES
It's a pretty good look, right?
So robots can be programmedto play football and other gamesby breaking the tasks down intoa series of simple instructions.But this robot is called iCub,and he doesn't need step by stepinstructions,he can learn what to do for himself.We looked at how children learnand we tried to model that processso that our robot is able to learnin the same way that you or I can.
This is a box.
iCub: Box.
Cool. What is this?
iCub: Box.
This is a stapler, what is this?
iCub: Stapler.
Where is the box?
'So iCub has been programmedin a different way.'His computer programcan learn new things,'and that's a very complicatedprogram to write.'
Does it only recognise one voiceor does it recogniseother people's voices?
We use a commercialsoftware for speech recognition,and that's been trained on my voice.
Does it understand Northern,my accent?
It would if we trained iton your voice, yes. OK.
Getting speech recognition to workwith children is difficultbecause the pitch is much higher.'So the robot really onlyunderstands Tony's voice,'but we're going to give it a goanyway.'
This is a box.
What is this?
'Try speaking deeper,try to sound more like Tony.'
This is a box.
What is this?
iCub: Box.
Yeah, that's cool!
This is a stapler, what is this?
iCub: Box.
Where is the box?
THEY CHEER
'Tony says that iCub's learningthings like children do.
'I wonder how similar it is'to the way peopleactually do learn things.'
Why did it get some things wrong?
If we'd written our programas a series of steps to execute,then it would have gonethrough those stepsand it would have performedperfectly.What's going on here with iCub,because it's learning things in muchthe same way that children do,it does make mistakes,it makes quite a lot of mistakesand that doesn't alwaysmake for the best demo.What iCub's doingthat's different is…it's working in situationsthat the designer can't foresee -you can't lay down a set of rulessaying, you know,"This is what a stapleris going to look like." All right?Because then somebody willbring in some new staplerthat looks a bit differentand iCub's lost.'Learning a few objectsmight not seem like much,'but this is early days.'Programmers like Tony areconstantly developing their programs'and improving themso that one day in the future,'robots will be able to learnto do all sorts of things.'So there's still some way to go,but, like all technologies,it only takes a matter of time.Maybe in the future, you'll beworking on the next generationof robot football players.
Video summary
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.
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.
Computing KS1 / KS2: Programming a robot crocodile. video
A class builds a Lego crocodile and use Raspberry Pi computers and the Scratch programming language to make it snap its jaws!

Computing KS1 / KS2: Creating a simple automated driving simulator. video
A car sprite is programmed to move around a racing track using repetition and selection.

Computing KS1 / KS2: Creating computer generated visual effects. video
How visual effects in film and television use programs to control CGI behaviour.

Computing KS1 / KS2: Programming a computer game. video
Schoolchildren create their own simple games using on screen sprites.

Computing KS1 / KS2: Programming a robotic toy car. video
A toy car is programmed to move between two locations on a town plan.

Computing KS1 / KS2: Simulating the experience of F1 racing. video
How realistic, computer-controlled racing simulators are used for training F1 drivers.

Computing KS1 / KS2: Programming a webcam. video
A small computer and a webcam are programmed to take high altitude weather photographs.

Computing KS1 / KS2: What are bitmap graphics? video
Schoolchildren create large bitmap images using black and white coloured squares.
