Guide for young coders and their grown-ups

How to use RVR Sim Lab

Practice coding a Sphero RVR+ on the screen first. When your program works in the sim, copy it into Sphero Edu and run it on the real robot.

Part 1

A tour of the screen

Tap any part of the map to learn what it does.

Part 2

Your first program in five steps

  1. Pick Mission 1, Free Roam.It already has a starter program, so you can press Run right away and watch what happens.
  2. Open a category and drag a block.Click Movement on the left side of the Blocks panel. Drag a roll heading 0 ° speed 80 for 1 s block and snap it under the others. Blocks only run if they're connected under when program starts.
  3. Change the numbers.Click a white bubble on a block to type a new number. Try heading 90 to drive right.
  4. Press Run and watch.The orange line shows where the robot drove. Press Stop at any time, or Reset robot to put it back at the start.
  5. Look at the code panel.Every block you add shows up as real code. Flip between JavaScript and Python to see the same program in both languages.
Part 3

One program, three ways to write it

Blocks, JavaScript and Python all tell the robot the same thing. Here's a short program that drives until the color sensor sees red.

when program starts set main LED red ▾ set speed 60 repeat until color sensor sees red ▾
delay 0.05 s
stop

Notice the little differences: JavaScript uses setMainLed and curly braces, while Python uses set_main_led, a colon and indentation. In both, await goes in front of commands that take time, like roll, delay and speak.

Part 4

Headings and distance

Heading is the direction the robot faces. 0 is up on the arena, 90 is right, 180 is down and 270 is left. Click the compass to pick a heading, then move the sliders to see how far the robot would go.

90°
100
2 s
Distance118 cm
Grid squares5.9
cm / second59
JavaScript

          Python

        

In the sim, speed 255 is about 150 cm every second, and each arena grid square is 20 cm. Your real RVR+ may be a fair bit faster or slower, so measure it in Part 6 and the sim will match. Negative speeds drive backward.

Part 5

Copy your code into Sphero Edu

When your program works in the sim, move it to the real robot. Check off each step as you go.

0 of 6 done

Tip: If the real robot goes a little too far or not far enough, change the seconds or the speed by a small amount and try again. That's normal: the sim is a practice field, not a perfect copy of your floor.

Part 6

Make the sim match your robot

Every robot, battery and floor is a little different. Measure yours once, and your programs will drive about the same distance in the sim and on the floor.

  1. Open “Match your real robot”.It's under the Run buttons in the Sim Lab.
  2. Run the speed test on your real robot.Press “Copy speed test”, paste it into Sphero Edu, put tape on the floor where the robot starts, and press Start. It waits 2 seconds, then drives for 2 seconds.
  3. Measure and type it in.Measure from the tape to where the robot stopped, type the centimeters, and press “Use this”. The robot in the sim, the mission hints and the numbers on this page will all update. Run it twice and use the middle if the numbers differ.

Check your color cards too. Press “Copy color test”, run it on the robot, and slide a card under it. Your device says the color the robot sees. If it stays quiet or says the wrong color, try a brighter, plainer card or more light.

Your robot right now: the sim is using speed 255 = 150 cm/s, so speed 100 is about 59 cm/s. This page reads your number from the Sim Lab in this web browser.

Part 7

What's the same, and what's different

ThingIn the Sim LabOn the real RVR+
CommandsNamed like Sphero Edu: roll, spin, setMainLed / set_main_led, getColor / get_color.The same commands work, plus the isColor / is_color helper that “Copy for Sphero Edu” adds.
DistanceSpeed 255 ≈ 150 cm/s, perfectly straight, and it starts and stops instantly.Depends on your robot, floor and battery. Use Part 6 to match them. Real robots also take a moment to speed up.
Color sensorReads the colored tiles exactly.Reads real colored cards. Lighting can shift the colors, so try the color test in Part 6.
WallsThe robot stops and the console says “Bump!”The robot pushes into the wall. Give it plenty of space.
Numbers in Python10 / 2 prints 5.10 / 2 prints 5.0. The value is the same.
SpeakShows a speech bubble.Your device says the words out loud.
SavingYour work saves in this web browser automatically.Programs save to your Sphero Edu account.
Part 8

Fixing common problems

My blocks don't do anything when I press Run

Make sure every block is snapped under when program starts. Loose blocks turn gray and don't run.

Python says “This line needs a colon”

Lines that start a block, like if, while, for and def, must end with :. The lines under them need 4 spaces of indentation.

The robot drives past the red tile

Check the color sensor inside a loop, with a very short delay, and stop right after the loop. A lower speed also helps the robot stop closer to the middle of the tile.

I changed the code text, and now my blocks are gone

Your blocks are still saved. When you switch to “Write text”, the blocks pause because they can't read typed code. Press “From blocks” to go back to them. Your typed code is saved too, and it will be there when you come back to “Write text”. Only “Replace with code from blocks” replaces it.

Python says something “isn't supported here”

The sim understands the Python most beginners use: variables, if/elif/else, while, for, functions, lists, tuples, dictionaries, slices, f-strings and print. A few advanced features, like classes, list comprehensions and try/except, only work in real Python.

Python says I need await, or that I shouldn't use it

Commands that take time, like roll, spin, delay and speak, need await in front, and await only works inside an async def. If you write your own async def go():, call it with await go(). The sim checks this so your program will work on the real robot too.

The real robot goes much farther than the sim

Measure your robot with the speed test in Part 6. After that, the sim will drive the same distance.

Where did my missions go?

Progress is saved in the web browser you used. A different browser or device starts fresh.