Homework 1

Due 17 September, 2014

The purpose of this assignment is to program the robot to make some simple motions and estimate distances using the laser rangefinder. The rangefinder performs a horizontal scan across an angle in a forward direction and returns an array of values. In this assignment you'll measure the distance to a wall in front of the robot by using the ten values closest to the forward direction. Your program should print all ten values and use the average, but other applications might process the values differently.

Place the robot facing a blank wall, at least two meters from the wall, with empty space around it. Run a program that does the following:

Measure the distance to the wall using the laser rangefinder. Command the robot to move forward about one meter, then backward the same distance. Measure the distance to the wall again and record the difference between the measurements.

Now command the robot to move in a square trajectory (forward one meter, turn right 90 degrees, repeat these two steps four times). Measure the distance to the wall a third time and record the difference between the second and third measurements.

Run this program at least five times and report the results. The report doesn't need to include the ten raw values from the rangefinder, but it should comment on whether they were all similar or whether there were outliers. Values should be reported to four decimal places.

The robot calls are described in the API linked from the Links page on this web site. There is a sample program and compile script on the robot in each team's directory. In case you'd like to write and compile your program on a different machine, copies of the jar files can be found in ~ablumer/twopi.

Hand in a report in class and submit the program file using the command

provide comp150pr hw1 filename

For this assignment, each team only needs to submit one program and one report.