% This section could be shortened somewhat
\section{Homeworks}

{\it REWRITE THIS TO BE MORE GENERAL, MORE OF A HOWTO FOR INSTRUCTORS?}

In this section, we briefly describe the rational, requirements,
and grading of the homework assignments in the course. Students
were typically given one to two weeks to complete each assignment.
They worked in groups of 2 or 3 students and
kept the same groups for the entire semester. Assignments were
due at the beginning of the lab period each week, although we
often gave students until the next day. This allowed us to either
have a demonstration session at the beginning of the lab or to
go over the assignment with the students where the TA could look
at the students' code and watch the robot to diagnose problems.
It was vital to have both the robots and source code available
while helping students with problems.

\subsection{HW1: Introduction to Development}

The first homework served as an introduction to the development
environment and brought students up to speed on how to access
the source code from our CVS tree, compile the code using the 
OPEN-R SDK (freely available from Sony), and copy the final
programs to memory sticks for use with an AIBO. This homework
also showed students how to select which behavior runs using
our framework and allowed us to test code submissions using a
dropbox system. Creating a simple first assignment allowed us to
iron out the wrinkles in how we had setup the course and
student lab.

\subsection{HW2: Basic Sensors}

The second homework is designed to familiarize the students with
the sensors on the robot. The background section covers how to
subscribe to sensor messages, specifically, data from the
robot's accelerometer and the touch sensors on its feet. The
students then must use this information to set LEDs on the
robots face every time a foot contacts the ground, to detect
when the robot is lifted off the floor, and to display whether
the robot is level, tilted toward its left side, or tilted to
its right.

This assignment gives the students practical experience with
a sense-think-act loop. They must read [noisy] sensor data
from the robot, determine which actions to take based on
this sensor data, and finally send commands to the robot to
perform these actions. This sequence is repeated with a
frequency of 25 Hz on the robot.

\subsection{HW3: Robot Motion}

Robot motion involves a great deal of trial and error. In the third
homework, students learned how to build up to a complete motion
through incremental, trial and error experimentation. The assignment
was broken down into two parts. In the first part, students created
a set of walk parameters to describe a gait. Robot gaits are specified
by 51 parameters that are used by a walk engine to generate the actual
trajectory that the end of each foot follows over the course of a
single step. The parameters include limits on how high each foot can
rise above the ground, the desired angle of the robot's body, and
other similar factors. Finding an effective walk is an optimization
in this 51~dimensional parameter space. Parameters are often
coupled together in certain portions of the space and there are
many local minima. Typically we optimize for speed and stability,
although other factors such as a walk with a high body height are
possible.

The second part of the assignment required students to create a
new motion from scratch using a key frame animation based
approach. Specifically, students created a motion that made
the robot perform a complete rollover and then climb back
onto its feet. They learned how to convert between the
positions of the robot's limbs in space and the corresponding
angles of the robot's joints in their own coordinate frame.
Since rolling over is a dynamic activity that depends on
building up momentum and moving different legs in concert,
the students also learned how to coordinate different joints
simultaneously. An incremental, experimentation based approach
was also important for being successful with this portion of
the assignment.

\subsection{HW4: Calibrating Vision}

Since the focus of this course was to give students the practical
knowledge that they'd need to program a working robot, we included
an assignment on vision calibration. In this homework, students
used the robot's camera to capture images of the environment. They
transfered these images to a workstation and used standard image
editing software to label the colors in the images. In other words,
they would draw over the orange regions of an image with a solid
orange, replacing the large set of YUV values that appear as orange
with a single, predefined value for that color.
These labeled images serve as training data for a supervised 
learning algorithm that learns a mapping between YUV color
values and symbolic color values such as \emph{yellow},
\emph{orange}, or \emph{blue}.

Part of the value from this assignment was showing students how
much work goes into calibration. Taken with the fact that fast
color segmentation algorithms that rely on mapping directly from
pixel values to symbolic colors are brittle in the face of
changing lighting conditions, this provides strong motivation to
try other approaches; recalibrating vision for new lighting is
a lot of work! Students also learned the tradeoff between taking
more sample photos to improve accuracy versus the increase time
spent labeling the photos. They learned that this type of lookup
based segmentation is unable to disambiguate between colors that
look different to humans but have the same YUV values to the
camera. Students also learned how to adjust the weights assigned
to the examples for different symbolic colors. For example,
training images often contain fewer examples of colors associated
with small objects and many pixels from larger objects. This
creates a bias in learning where the end classifier wants to
say everything is the same color as large objects. Finally,
students learned to evaluate the final, learned mapping from
pixel values to symbolic colors against a test set of images
rather than against the training set. Realistic evaluation of
how well algorithms will perform is important.

\subsection{HW5: Object Recognition}

Once students understand low level vision concepts such as
color segmentation, they need to learn how to perform higher
level tasks such as object recognition. This was the focus of
the fifth assignment. Students learned to detect a bright orange
ball, a colored bullseye, a small scooter, and a tower built from
colored cylinders using color segmented images. The wheels of the
scooter were the same shade of orange as the ball and additional
towers built from colored cylinders were present so students
needed to filter out false positives as well as avoid false
negatives.

Although the training data was gathered using the robot's camera,
this assignment was completed entirely on workstations using
the same code that runs on the robots with an abstraction layer
to allow it to run under Linux. The exact same vision processing
is done starting with a raw YUV image, but the entire process
can be observed using standard debugging tools. This allowed
students to get under the hood of the vision process and
try many more approaches than embedded development would; the
turnaround time to try new code is much lower on a workstation
and the running program is much easier to observe. Once the
algorithms are fine tuned, they can be ported to the robot by
simply recompiling for a different target platform. This practical
lesson is perhaps as important as teaching the students how
to create heuristics for object detection.

\subsection{HW6: Mounting a Charging Station}

The sixth assignment built on the previous vision assignments.
Students used object detection code to find the colored bullseye
and tower beacon where were positioned on either end of a
charging station. They programmed the robot to search and then
climb onto the charging station before sitting down and shutting
off.

This assignment brought together many of the past assignments and
tied them together into a unified whole. The robot needed to sequence
searching, seeking, and charging behaviors together relying on
vision for sensing. The provided walk for the robots was too low
to step onto the station so students needed to create custom
motions to move the robot into position over the charger and
settle themselves onto the contacts. This assignment tied
vision, behaviors, and motion together into a coherent whole.

\subsection{HW7: Maze Traversal}

Students continued to create unified systems that rely on
several basic components in the seventh assignment. In this
assignment, students used a [provided] egocentric world model
to track regions of free space around the robot. They created
a behavior to traverse a convoluted path while controlling the
robot's head to ensure that the local model contained
accurate and up to date information. The path was not a true
maze as it had no dead ends, but the robots did need to
navigate through several turns without touching walls.

\subsection{HW8: Written Localization}

Localization requires more formal mathematical material than
the rest of the material in the course. In order to give
students experience with manipulating probability distributions
this assignment consisted solely of written work. Students
were given a uniform prior distribution of robot poses in
a grid world and calculated the posterior probability
after several moves through the world. The movements were
nondeterministic and the students wrote out the complete
prior and posterior distributions following each step. Several
markers spaced across the grid gave the students a chance
to incorporate observations using a sensor model as well
as use a movement model to propagate belief forward through
time.

\subsection{HW9: Hands on Localization}

Hands on experience with localization is also important. Students
created a behavior where the robots avoided a large square in
the center of a carpet. When grading, the robot was first moved
to a home position and told to memorize its position with a
button press. Then the robot was picked up and moved to a new
position (typically on the other side of the carpet) and replaced
on the carpet. Evaluation was based on the robot detecting that it
had moved and returning to its original position while avoiding the
square in the center of the carpet by using localization. Six
colored markers around the carpet were used for localization. Students
needed to create behaviors to control the head to seek out and
fixate on these markers in order for the robot to be well
localized. Additionally, students experimented with varying the
number of samples used by the particle filter for localization.
They made observations about the quality of the position
estimates and convergence speed.

