Project 1 -- Reactive Behaviors

Target Object

The original project description described the target object as follows:

This page describes the target object in more detail and with more certainty.

As discussed in class today (Wed., Feb. 27), I will allow groups to choose from one of the four following target objects:

  1. A single AA battery and IR LED.
  2. A single AA battery and "mini lamp."
  3. Two AA batteries and a halogen flashlight lamp.
  4. Four AA batteries and a krypton flashlight lamp.
You will need to tell me, before testing begins on your robot, which one of these four target objects you will be using for all of your tests.

Some characteristics of these target objects that you may wish to consider when selecting your target are:

Target 1.

The IR LED is highly directional and will be aimed at the ceiling. (The box claims that the viewing angle to half intensity is 45°, although my informal testing seemed to indicate it might be narrower.) This may be a disadvantage in that your robot may fail to sense the object from the side as it searches for it. Alternately, this may be an advantage because the orientation of the sensor to the target should be well known when (if) the target is found.

The range at which the robot can sense the IR LED using either the small "light sensors" or the IR proximity sensor is relatively short. This is probably a disadvantage.

Target 2.

The mini lamp is less directional than the IR LED but is still somewhat directional.

The range at which the robot can sense the mini lamp using the small light sensors is greater than the range at which the robot can sense the IR LED.

Target 3.

The halogen flashlight lamp puts out its brightest light in most of the 360° arc parallel to the ground plane (when the target is in an upright position) as well as through the top of the bulb. However, because of the odd shape of the bulb, there is a region between these two in which the light is much less intense.

The halogen flashlight lamp is much brighter than the mini lamp and can be sensed by the robot using the small light sensors from a much greater distance.

This target requires two batteries to power and is, therefore, much heavier than the previous two.

Target 4.

The krypton flashlight lamp is the least directional of the target light sources and produces relatively uniform light above the base.

The krypton flashlight lamp is notably brighter than the halogen flashlight lamp and can be sensed by the robot using the small light sensors from a greater distance.

This target requires four batteries to power and is, therefore, by far the heaviest of the targets.

If you would like to build your own targets for your robot and code development, here are the specifications for what I used for the official targets. (All catalog numbers are for RadioShack parts.)

Target 1.
Parts:
Construction:
Target 2.
Parts:
Construction:
Target 3.
Parts:
Construction:
Target 4.
Parts:
Construction:

As noted above, the RadioShack on Main St. is out of some of the components recommended. They are trying to get their shelves restocked but are under staffed due to illnesses. I haven't tried any other stores in the area.

If you would like to make minor modifications to a target design to make it easier to pick up (such as adding a plate by which it could be lifted or metal to which a magnet could cling), you may do so and create your own target object for use in the official (graded) testing of the robot. You could also choose to use other color and/or blinking bulbs in your target object. You must get approval for any alternate target object before it may be used. Also, if you choose to create your own target object, I recommend soldering all connections, to make sure that they remain solid throughout each test.

Here is the code I was running today in class. It is a modification of the light testing code found in the test directory from your IC installation:

void main()
{
    while (1) {
        float freq, duration;
        int startsens= filtered_light(6);
        
        printf("start= %d\n", startsens);
        freq = 20000.0 / (float) startsens;
        duration = 50.0 / freq;        
        tone(freq, duration);
    }
}

int filtered_light(int channel)
{
    int ret= 
      analog(channel)+
      analog(channel)+
      analog(channel)+
      analog(channel)+
      analog(channel)+
      analog(channel)+
      analog(channel)+
      analog(channel)+
      analog(channel)+
      analog(channel);
    return ret/10;
}