14.2 The IrCal Utility
To run irCal, type:
cd ~bee/etc irCal > irCal.dat
NOTE: Neither mspterm nor baseServer may be running when you run irCal.
Once the program starts, it waits a short period and then starts keeping track of the largest and smallest values received from each of the robots infrared sensors. Once every second or so, irCal prints the current IR values after normalizing them based on the maximum and minimum values received up until that point.
As IrCal runs, place a highly reflective surface quite close (one or two inches) to each infrared sensor in turn. This will insure that the sensor records the maximum value. Do the same, for each sensor, with a highly non-reflective surface, to capture minimum values. The goal here is to present each IR sensor with a surface that reflects back nothing. (Hint: The back of a mouse pad usually makes a good non-reflective surface.) Place this briefly in front of each side-facing IR, and under each downward-looking IR.
Once you have satisfactorily normalized the data from each IR sensor, press <CTRL-C> to write out the calibration table to stdout and terminate the program. When youre happy with your calibration table, copy it to ~bee/etc/irCal.dat so that baseServer can find it. Be sure to make a backup copy of irCal.dat because the make distclean command in ~bee/src will delete the entire ~bee/etc/ directory.