15-494/694 Cognitive Robotics Lab 10:
Calypso for Cozmo

I. Setting Up Cloud Calypso

  1. You must use the Chrome browser for this lab. Go to calypso-robotics.com. Allow access to your camera and microphone.

  2. Create a free account, then log in.

  3. Swtich from Novice to Normal mode by clicking on the Home icon in the top right corner of the screen, then clicking on "Settings" and "Novice Mode".

  4. Click on the camera icon along the right edge of the screen to expose the camera viewer.

  5. Notice in the camera viewer that Calypso is doing face detection, and also emotion detection. Try smiling, or opening your mouth to look surprised, and see how the display changes.

  6. Plug an Xbox controller into your laptop.

  7. Have a look at the Calypso curriculum. This will come in handy later.

II. Writing Your First Calypso Program

  1. Use the controller to enter the Let Me Drive rule below. Note that controller button help appears in the top left corner of the Calypso window. If you switch to using the keyboard, the help switches to keyboard help.
    WHEN gamepad DO move
        

  2. Run the program by pressing the "back" button on the Controller or the Backspace key on the keyboard (Delete on the Mac), or clicking on the green "play" button along the right edge of the screen.

  3. Use the controller to drive the robot around.

  4. Leave execution mode by pressing the Back button on the controller or the Backspace key on the keyboard (Delete on the Mac), or clicking on the red "stop" button at the right edge of the rules pane.

  5. Add a Pursue and Consume idiom to your program using the following rules:
    WHEN see red cube DO move toward it
    WHEN bumped red cube DO grab it
        WHEN DO say "I have a cube" and then...
            WHEN DO switch to page 2
        
    Note: to indent a rule, put the pencil on the WHEN tile, pick up the rule using the A button, slide it to the right using the left stick, then put it back down. Aternatively, you can click and drag on the WHEN tile with the mouse.

  6. Run the program.

  7. Right click on a cube and change its color to red. See what happens.

  8. Stop the program.

  9. Click on the Home icon in the top right corner of the screen, and save your program as MyFirstProgram.

III. Extending Your Program To A Second Page

  1. In the rule editor, go to page 2 by clicking on the page number or arrows at the top of the screen. You should see a pink background for this page.

  2. Enter the following rules:
    	WHEN see face happy DO say "You have a lovely smile"
    	    WHEN got cube DO glow it none
    	        WHEN DO drop 
    	WHEN hear "Go again" DO switch to page 1
        
  3. Run the program, color one of the cubes red, and wait for the robot to pick it up.

  4. Smile for the camera to get the robot to drop the cube.

  5. Color another one of the cubes red.

  6. Tell the robot "go again" to get it go go back to page 1 and pick up the cube.

  7. Save your program.

IV. Calypso Map Layouts

Our first program used the default map layout, whichh as three cubes and four custom markers. You can make your own map layouts with more advanced features such as walls, rooms, and text.
  1. Click on the Home icon in the top right corner of the screen and select New to begin a new program.

  2. Go to the Map Editor view by clicking on the map button on the right edge of the screen, typing control-DownArrow.

  3. Drag Wall 39 from the palette onto the map layout.

  4. Drag three Wall-A items one at a time from the palette, click on an endpoint to rotate them, and then drag them so that they snap together to form an enclosed "shack", as in the diagram below.

  5. Drag a room from the palette onto the map layout and adjust it (drag the corners) to cover most of the interior of the shack.

  6. Right click on the room and rename it to "shack".

  7. Drag the three cubes from the palette onto the map layout, as shown.


  8. Enter the following program. Note: to make the mini-page 1.1, first create the rules for the mini-page, indent them, and then right click on the first rule's "WHEN" tile and select "Make mini-page". You do not type in the "PAGE 1.1" part. Click on the WHEN tile of the second rule and drag it into the mini-page.
    	PAGE 1:
    	WHEN NOT-got cube DO
    	    WHEN see cube NOT-in "shack" DO move toward it
    	WHEN bumped cube NOT-in "shack" DO grab it
                PAGE 1.1
    	        WHEN DO visit "shack"
    	        WHEN visiting "shack" DO switch to page 2
    
    	PAGE 2:
    	WHEN scored red-score = 0 points DO move ahead 100-mm 50-mm 25-mm
    	    WHEN DO switch to page 3
    	WHEN scored red-score = 1 points DO move ahead 100-mm 25-mm
    	    WHEN DO switch to page 3
    	WHEN scored red-score = 2 points DO move ahead 50-mm
    	    WHEN DO switch to page 3
    
    	PAGE 3:
    	WHEN DO drop
    	WHEN DO (game)+score red-score 1 point
    	WHEN DO switch to page 1
        
    Page 1 of your program should look like this:


  9. Save your program, then run it.

V. Homework: Are You Smarter Than a Fifth Grader?

  1. Watch this video of the Cozmo baking companion for inspiration.

  2. Write your own Cozmo demo in Calypso. It should use a custom map layout, multiple pages of code, plus some of the other features you've learned today, such as speech recognition, facial emotion detection, etc. For example, you might write a demo that has the robot sort cubes by color, putting all the red cubes in one room and all the blue cubes in another. Speaking to a cube could cause it to change color.

  3. Take some photos and screenshots to document your demo.

Note 1: you can "tap" on a cube by left clicking on it while the program is running. Cozmo can detect this via "WHEN feel cube". This is another feature you could choose to use in your demo.

Note 2: besides programming Cozmo, you can also program the cubes with their own rules. Click on the icon just below the Home icon to change characters. For example, you might program a cube to change colors every time the robot picked it up.

Hand In

Hand in the following in a file called handin.zip:

  1. Your Calypso program file.

  2. Screenshots of your Calypso world map when running your program, and a brief description of what the program deos.


Dave Touretzky