Lego Rovers

Getting school children excited about the programming challenges of space exploration

Part of NASA International Space Apps Challenge 2013

Learn more »

Meet the Rovers

Lego Rovers is a fun, engaging activity for schools, after-school clubs and science events, which teaches simple programming concepts. Children get to navigate their own space rover, see the effect of the time delay between the Earth, the moon and Mars, and experiment with the effect of different rules and automation options.

View details »

For Developers

Help us extend Lego Rovers with more control options, and make the software more accessible to teachers and students, as part of the International Space Apps Challenge weekend.

Find out more about what we need, the current user-interface and download the specialist software currently used to run the robots.

View details »

Join the Space Apps Challenge
21-22 April 2013

Join project sponsor, Dr Louise Dennis, at the Met Office in Exeter, UK as part of the NASA Space Apps Challenge 2013, a 48-hour hackathon taking place in 75 cities around the world.

Register now »

Lego Rovers

Teaching school children about the programming challenges of remote space exploration.

Lego Rovers is a fantastic, fun activity that teaches school children about the programming challenges involved in space exploration, by experiencing what it's like operating a remote planetary explorer like NASA's Mars Curiosity rover. Children get to try driving their own rover, see how the time delay between the moon or Mars affects its behaviour, and experiment with using simple if-then rules to teach the rover to drive itself.

Dr Louise Dennis of University of Liverpool developed the Lego Rovers to demonstrate her research in artificial intelligence in schools in Manchester, but when teachers asked if there was software available that would allow them to run their own model Lego Rovers in a similar way, Dr Dennis was unable to offer anything accessible.

News Story & Interview »
on University of Liverpool website

Video: Dr Louise Dennis introduces the Lego Rovers © University of Liverpool

The Challenge

Develop a new version of the Lego Rovers that demonstrates more aspects of autonomous control systems and is accessible to teachers and students interested in programming their own robots.

Dr Dennis built the Lego Rovers demonstration on top of complex, specialist software she developed for her own research with autonomous control systems. It's written in an experimental programming language, more heavy-weight than necessary for the Lego Rovers, and too complicated for most teachers and pupils to install and customise themselves.

At NASA Space Apps Challenge 2013, Dr Dennis is looking for help developing the software to be more accessible, and to demonstrate further aspects of autonomous control systems.

Challenge Specification »
on Space Apps website

Meet the Rovers

Noor and Claudia: our simple, two-wheeled Lego Mindstorms robots.

  • Noor and Claudia, the lego rovers
    The current Lego Rovers: Claudia on the left, Noor on the right

The Lego Rovers are simple, two-wheeled robots built in Lego Mindstorms. There are two possible rover configurations: Noor has an ultrasonic sensor which measures the distance to the nearest obstacle, while Claudia has a touch sensor which registers actual collisions.

The rovers are controlled from a laptop using a simple user-interface which demonstrates the challenges of controlling robots over vast space distances, and lets children explore different control and automation options.

Children can experiment with time delays in sending instructions (no time delay, a satellite phone call to Australia, Earth-Moon, and the minimum Earth-Mars delay), the sensitivity of some sensors, the speed of the robot, and try using simple rules to control the robot’s behaviour autonomously. Experimentation takes place with an expert on hand who can answer their questions and explain details of the robot and project.

User interface »   Software »

Challenge notes: although Lego robots are commonly available in schools and interested students may well have their own, they are not the only option. Could Arduino and Raspberry Pis be used instead?

Extending Lego Rovers

What we're looking for from an extended system.

A number of schools and children own their own Lego Robot and want to continue experimenting after the session has ended.

From experience taking the Lego Rover into schools we've found students are particularly engaged by the ability to easily experiment with changes to the robot’s behaviour without the need to program something up from scratch, as is necessary with an off-the-shelf Lego Mindstorms system.

They are engaged enough with the robot that they will spontaneously devise their own questions and “experiments” about the system behaviour they hope to test.

Widening the range of parameters and rules the children can explore when using the robot, as well as making the whole application more portable, would help motivated teachers and students benefit from installing the system on their own robots.

Video: watch a child interacting with the Lego Rovers

Do make…

  • A framework for the remote operation of a Lego robot with simple keyboard and/or mouse/touch controls
  • A simple rule-based system, allowing autonomous rules (e.g. simple if-then rules) to be passed to the robot from the user.
  • An intuitive and simple interface.
  • An entertaining range of parameters that can be changed, and rules that can be added or customised for controlling the robot.
  • A framework to allow some customisation of the rules themselves and what the terms in the rules “mean” - e.g. “detect an obstacle” may mean “the ultrasound sensor has returned a value greater than X” where X can be set by the user
  • Simple, clear instructions for installing the software.

Don't make…

  • The purpose of the demonstration is to illustrate problems and techniques, not to create a highly intelligent autonomous robot.

  • Simplicity and clarity in any rules implemented should be favoured over sophisticated and invisible machinery drawn from AI research.

  • Avoid developing a child-friendly programming language; many already exist.


Read the full background and functional spec on the Space Apps website, and discuss ideas and approaches with other participants and project sponsor, Dr Dennis.

Dr Dennis will be at Space Apps Exeter throughout the hack weekend 21-22 April to discuss the project and answer questions.

Challenge Specification »
on Space Apps website

User Interface

The Lego Rovers are currently controlled by a simple user-interface.

The full user-interface

Manual Controls

Simple controls to manually drive the robot.

Screenshot showing manual controls
  • Go forwards
  • Go backwards
  • Turn left
  • Turn right
  • Stop


Settings simulate the delay in sending manual commands to a rover on the Moon or Mars, demonstrating the challenge of manually controlling a robot over such vast distances, and therefore the importance of autonomous control systems.

Screenshot showing custom settings
  • Delay
    Choose from:
    • 500ms
      - the time it takes for a satellite call between the UK and Australia
    • 1s (1000ms)
    • 1.3s (1300ms)
      - the time it takes for a signal to travel between the Earth and the Moon
    • 3m (180,000ms)
      - the minimum possible time for a signal to travel between the Earth and Mars
  • Change the travel speed
  • Change the turning speed

Ultrasonic Sensor (Noor only)

Noor has an extra panel showing the incoming values from the ultrasonic sensor.

Screenshot showing ultrasonic sensor settings and display

By default Noor assumes that there is an obstacle if the incoming value is 50 or less. Children can experiment with the effect of changing this value.

Autonomous Controls

These let children experiment with simple automation and learn more about programming automonous control systems.

Screenshot showing autonomous control options

The current programme offers three simple rules which tell the rover what to do if it detects an obstacle in its path:

  1. If you believe there is an obstacle, stop
  2. If you believe there is an obstacle, stop and then turn right
  3. If you believe there is an obstacle, reverse and then turn right

Challenge notes: the current autonomous ruleset is very basic. How could we extend it to demonstrate more complex automation approaches? How can teachers and students with existing programming skills create their own rules?

Ideas for more autonomous controls
  1. Allow rules to be chained together (basic inference)
  2. Allow more than one rule to be active at once (illustrating potential side effects of combinations of rules)
  3. Allow rules to be modified by the child in some way
  4. Allow the meanings of terms in the rules (e.g. what does “detect an obstacle” mean in terms of sensor input) to be changed by the child
  5. Make more extensive use of sensors (in the existing demonstrator each robot only has one sensor),
  6. Goal-based planning (e.g. explore an area, locate an item)


Custom control software for Windows, Mac and Linux.

While the two Lego robots run on the standard Lego Mindstorms leJOS Java-based operating system, the interface for the rovers and the agent-based code and configuration files for the behaviour of the Claudia and Noor robots are written in an experimental programming language. This is both more heavy-weight than is really needed for the demonstration, and too complicated for most teachers and pupils to install and customise themselves.

The Lego Rover demonstration controls are built on top of a complex piece of custom research software developed at University of Liverpool. This open-source MCAPL (Model Checking Agent Programming Languages) software is designed to explore agent-based control of autonomous systems, and provide guarantees of agent behaviour via a technique called model checking. Only a small sub-set of this code is used in the Lego Rover demonstration system.

You can download the software below. The software should run on Windows, Mac or Linux, although the demonstration has been mainly developed and tested on a MAc.

Challenge notes: the current software is too complicated, even for teachers and pupils with programming skills. Can it be redeveloped in something more familiar, perhaps leJOS itself, and in a way that would enable pupils to experiment with programming their own simple autonomous rover?

Installation and Setup

Code organisation and configuration

The organisation of the code follows that used by NASA's java-pathfinder model-checking system, and may seem unintuitive for applications, like the Lego Rover demonstration, which do not actually use the model checker.

The interface for the rovers and agent-based code and configuration files for the behaviour of the Claudia and Noor robots are in src/examples/eass/nxt/legorover . This is written in an experimental programming language which is probably more heavy-weight than is really needed for the demonstration.

It also contains an agent environment which sets up the Java classes for the two robot configurations, and handles forwarding commands either from the user interface or from the agent programs to the actual robots. The robots run the standard leJOS Java-based operating system for Lego Mindstorms. The specialised sub-classes of classes provided for the robot's leJOS operating system, which integrate these with the agent-based system, are in src/classes/mas/nxt.

The leJOS classes for sensors operate on a call-response mechanism (i.e. the program must explicitly call the relevant method in order to get the sensor value). One of the things the agent environment code does is to poll these sensors on a regular basis and then store the result in a field called "percepts" in the environment which is regularly checked for changes by the agents. This allows the rules used in the demonstration to be event-driven based on observing changes in the sensor values.

Setting up your robots

The configuration files for the Claudia and Noor robots are in src/examples/eass/nxt/legorover

To set up a particular robot you need to edit either Noor.ail or Claudia.ail (as appropriate) with the robot's address as the value for nxt.robotAddress. If the main method in LegoRoverUI is called with no arguments then it assumes it is working with a Noor robot configured as in Noor.ail. To use it with a Claudia type robot then the class should be invoked with "claudia" as an argument.

Dr Louise Dennis

Dr Louise Dennis is a Research Associate at the University of Liverpool working on agent-based autonomous control systems for space exploration and satellite systems. She is currently working on a major EPSRC funded Reconfigurable Autonomy project at the University’s Centre for Autonomous Systems Technology. She originally developed the Lego Rovers as a research tool for her work on artificial intelligence, before adapting them into an educational activity for schools as part of the STEM Ambassador Programme.

Louise studied Maths and Philosophy at the University of Oxford before completing an MSc and PhD in Artificial Intelligence at the University of Edinburgh. She specialises in automated reasoning and the development of automated reasoning and theorem proving tools, most notably the Agent JPF model checker for BDI agent languages, the lambda-clam proof planning system, and the PROSPER Toolkit for integrating an interactive theorem prover (HOL) with automated reasoning tools (such as SAT solvers) and Case/CAD tools.

Research Groups


Website & Blog