15-494/694 Cognitive Robotics: Lab 1
I. Meet Cozmo
- Get a robot, a charger, a Kindle, and a set of light cubes from the cabinet.
- Plug the charger into a power strip. Turn on the robot by
placing it on the charger.
- Raise and lower the lift to reveal the robot's network name and
- Turn on the Kindle and start the Cozmo app.
- The app may offer you a choice of robots. Choose the one whose network name
matches your robot.
- Let Cozmo run around and see his light cubes, but don't let him fall off the table!
- Use the app to play a game with Cozmo, such as Quick Tap.
II. Introduction to the Cozmo SDK
- Log in to the workstation.
- Clone a copy of the SDK by doing:
$ git clone https://github.com/anki/cozmo-python-sdk
- Edit your PATH variable to include /opt/platform-tools so you can access
the "adb" (Android Debug Bridge) utility. You can
do this by including the following line in your .bashrc file and then doing "source .bashrc":
- Connect the Kindle to the workstation via its USB cable.
- In a shell, type "adb devices" and you should see the Kindle
listed. If the message says "Unauthorized" you need to go to the
Kindle's Settings page, select "Device Options", scroll down to
"Serial Number", and tap the button repeatedly until it reveals the
"Developer Options" button. Then click on that and turn on USB
- Run the Cozmo app, connect to the Cozmo, click on the gear icon
in the top right corner, scroll right, and select "Enter SDK Mode".
You should see a mostly black screen.
- Run the Hello World demo by doing:
$ cd ~/cozmo-python-sdk/examples/tutorials/01_basics
- Examine the source code of 01_hello_world.py.
- Try some of the other tutorials in the 01_basics directory.
- Try the Cozmo remote control app by doing:
$ cd ~/cozmo-python-sdk/examples/apps
- Close the browser window and exit Python when you're done.
III. Introduction to Cozmo-Tools
- Download a private copy of the cozmo-tools package by doing:
$ git clone https://github.com/touretzkyds/cozmo-tools
- Add the cozmo-tools directory to your search path by putting
the following lines in your .bashrc and then doing "source .bashrc":
- Run the simple_cli command line interpreter and display the camera viewer by doing:
>> show viewer
- Try showing Cozmo its cubes and see how they are displayed in the
camera viewer. Also try showing Cozmo a face.
dir(robot) to examine the fields of the variable
robot, and similarly for
- Run the worldmap viewer by typing
show worldmap_viewer. Press
the "h" key in the worldmap viewer window for keyboard command help.
- Let Cozmo watch one of his cubes as you move it around, and
observe how the display changes in the worldmap viewer.
IV. Exploring the Occupancy Grid
- Press the "m" key in the worldmap viewer window to see Cozmo's occupancy grid.
show particle_viewer to display the particle filter that cozmo-tools
uses for localization.
- Type "h" in the particle filter window for keyboard help. Notice that you can
use the WASD keys to drive Cozmo.
- Drive Cozmo around and watch how the occupancy grid representation changes.
- Try picking up Cozmo and putting him down in a position where he
can't see any cubes. What happens?
- Using the WASD keys in the particle viewer window, turn Cozmo so
he can see a cube. What happens in the worldmap viewer?
V. Clean Up
- Exit the Cozmo app. This is very important because as long as the app is running,
Cozmo will be talking to his cubes and running down their batteries.
- Put the robot, charger, Kindle, USB cable, and light cubes back in the
cabinet and set them up so that both the robot and the Kindle are charging.
- Log out of the workstation.