Free online robot simulator
Program a robot in Python, in your browser. It drives round a 3D mat, senses what is around it, and does exactly what your code tells it, mistakes included. Nothing to install.
The program
from bugbot import *
connect()
while clock() < 30:
ahead = distance()
plot("cm ahead", ahead)
if ahead < 25:
turn_right(80)
wait(0.4)
else:
forward(60)
wait(0.1)
stop()
What you can do with it
- Learn Python by driving a robot. 404 lessons, from a first
forward()to machine learning, each with tasks the simulator marks. Browse the lessons. - Practise for GCSE and A level Computer Science. The courses follow OCR, AQA, Edexcel and Eduqas point by point. Python challenges.
- See how real robots work. Guides to PID control, Kalman filters, A*, maze solving and more, each with demos you can change and run. The guides.
- Compete. Robot games on a projector, where the best program wins. The games.
- Put it on your own site. Any task in an iframe, with your own starting program. Build an embed.
The robot
The simulator models BugBot, a small robot that can slide in any direction and spin on the spot. It has a distance sensor and an 8 by 8 depth grid, a camera, a bump sensor, a gyro, a gripper for balls, a piezo and an LED. Readings are noisy and the drive is not perfect, as on a real robot, so programs have to sense and correct. Code written in the simulator runs on the real robot. About the robot.
Questions
Is the robot simulator free?
Yes. The simulator, the lessons, the guides and the games are free, and they run in the browser with nothing to install.
What language do you program the robot in?
Python: the real language, typed, not blocks. The same commands drive BugBot, the robot the simulator models.
What can the simulated robot sense?
A distance sensor and an 8 by 8 depth grid, a camera, a bump sensor, a gyro heading and its own position estimate. It can also carry balls with a gripper, play notes on a piezo and change its LED.
Can I use it with a class?
Yes. The lessons follow the GCSE and A level computer science specifications for OCR, AQA, Edexcel and Eduqas, every task is marked automatically, and teachers can set up a class and follow its progress.
Can I put the simulator on my own website?
Yes. Any task can be embedded in a school website, a VLE page or a blog, with your own starting program.