The objective of this lab is to get familiar with the functionality provided by the Cozmo SDK.
Lab Checkpoint [25 points] (complete individually): For successful completion of this course,
each person must have the ability to run code on the robot. To ensure this, the first part of the
assignment is a checkpoint to check for this functionality. We have set aside the entire class time
on September 6th to both grade the checkpoint and to help anyone having trouble with the install.
1. Complete the installation of the Cozmo SDK and cozmo_sdk_examples on your laptop,
then demonstrate that you can run code on the robot using one of the example tutorials, or
part (2) below. (10 points)
2. Next, we want to collect many images to help improve the image recognition performance
of the robot under different lighting conditions. Each person will collect 8 images with the
robot using the provided collectImages.py script and upload the images to Canvas.
We will share the entire collection of images with the whole class once they have been
uploaded. Each image should correspond to one of the eight image classes we want the
robot to recognize (the seven symbols, and “none”). The script expects a subdirectory
called imgs/ to be available, and takes the following arguments:
collectImages numImgPerLabel label1 label2 …
To collect 8 images in a row, containing one of each image type, run
collectImages 1 drone inspection order plane truck hands place none
The script will cause the robot to take 8 pictures, with a 4-second pause in between. The
resulting images will be automatically assigned a unique filename; do not change the
filename. Note that you have to show the robot symbols in the order specified in the script
arguments. The above list corresponds to the following symbols:
3. Upload the images as a zip file on Canvas under AssignmentsLab2 Checkpoint. (15 pts)
Main Lab [75 points] (complete with partner): Write a Finite State Machine that encodes the
RBE 2001-C10 Revised: 5-Sep-18 1
following robot states and behavior:
State: Idle (this is the starting state)
Activity: Monitor stream of images from the camera. Classify each image using the model you
developed in Lab1. If one of the symbols is recognized (i.e. not “none”), use the built-in text-tospeech functionality to have the robot say the name of the recognized symbol, then switch to the
appropriate state (see below). Note that the SDK can provide both grayscale and color images, at
resolutions of 320 × 240 and 160 × 240, respectively. More specifically, the SDK reduces the
width resolution of color images by half, transfers them from the robot, then resizes color to match
the grayscale at 320 × 240. You are welcome to use the color images if you find it helpful, but be
aware that as a result of rescaling they are not as detailed as the grayscale images.
State: drone (activated by showing “drone” symbol)
Activity: The robot should locate one of the cubes (one will be placed in front of it within view),
pick up the cube, drive forward with the cube for 10cm, put down the cube, and drive backward
10cm. Then return to Idle state.
State: order (activated by showing “order” symbol)
Activity: Use the drive_wheels function to have the robot drive in a circle with an
approximate radius of 10cm. Then return to Idle state.
State: inspection (activated by showing “inspection” symbol)
Activity: Have the robot drive in a square, where each side of the square is approximately 20 cm.
While driving, the robot must continuously raise and lower the lift, but do so slowly (2-3 seconds
to complete lowering or raising the lift). Lower the lift at the end of the behavior, and return to
Submission: Both the checkpoint and the main lab are due on the date listed at the top of the
document. The checkpoint is submitted separately and individually (see above). The main lab will
be graded as a demo in class on September 18th. Please also submit your code by the end of class
by uploading a zip file named Last1First1_Last2First2.py, corresponding to the first
and last names of partner 1 and 2, respectively. The zip file can contain just a single python file,
but turning it into a zip file with prevent Canvas from renaming the file. Also make sure you enter
the names of both partners in a comment at the top of the file. Only one partner needs to upload
the submission on Canvas.
Say recognized symbol 5 pts
Pick up the cube when drone picture is shown 14 pts
Drive the cube forward and put it down 14 pts
Drive in a circle when order picture is shown 14 pts
Drive in a square when inspection picture is shown 14 pts
Raise lift up and down while driving in square 14 pts