CPSC 601.68/599.68: Agent Communication Fall 2009 |
Note: This is an group assignment. The work is shared among the group members and each member is responsible for all of the work. For example, if there is plagirism is found in the assignment, every member is responsible. The group is expected to do it's own work, and must properly cite any and all work taken from external sources. Each member is responsible to carry their own portion of the workload. To this end, there is a peer assessment process where each member must assess each other member's contribution. Individual marks may differ based on the peer assessment, the instructor's assessment, and other factors. |
Another note: You will need to download the CASA project and the iRobotCreate project to this assignment. For details, see the getting CASA and the iRobot code page. |
Implement a CASA agent that controls an iRobot Create robot to measure the length of a dark line on a light floor. Your robot agent should inherit from iRobotCreate, and should make use of the iRobot commands (see iRobot Create Open Interface) to find the line, then travel along the line, keeping track of the travel distance so that it can discover the length of the line. You should implement several command-line interface commands (specified below) using CASA's RTCommandInterpreter class by modifying the TransientAgent.commandInterpreter object in an override of the TransientAgent.initRTCommandInterface() method. You may implement other interfaces if you wish.
The basic requirements are:
At startup, the robot should just acknowledge it's ready by flashing lights, playing a short song, or something appropriate of your choice.
The agent should accept the following run-time commands:
You may implement other commands as appropriate.
The length of the line is to be reported in meters to the nearest centimeter. If a report is requested before the completion of the task, any unmeasured variable are to be reported as "unknown", but all measured variables should be reported.
When the agent has completed the task, the robot should acknowledge (in a manner similar to startup) and power down.
Your agent will be limited to 5 minutes to complete the task from the time of the robot's startup acknowledgement. If the agent has not completed the task in the alloted time, the robot should signal this by playing a pathetic song, and displaying a red power light before powering down.
The dark line to be measured will be between 2cm and 4cm wide. To make your life easier, the line will be terminated at both ends by an equally dark circular(ish) dot wider than the distance between to the two front cliff sensors, but narrow than the distance between the to lateral cliff sensors. Other than the terminating dark lots, there will no other dark dots or other anomolies on the line. Moreoever, the terminal dots will be distinct from one another, the line will not cross itself, and the line will not curve to pass within one robot diameter of itself.
The line may be straight or curved, but any curve radius will be at least 20cm.
You must account for recovering from bumping into walls or other obstructions in your search for the line. However, it is guaranteed that no part of the dark line you are measuring will be within one robot diameter of any wall or other obstruction.
You should use the cliff sensor signals (packet IDs 28 through 31) to recognize the change in color of the floor to detect the dark line on the floor. However, keep in mind that the cliff sensors are real devices and have no specific calabration, so you need to be sensitive to changes in their values, not absolute values: Even for the same surface, two different cliff sensors may produce radically different absolute values on the same of different robots. In addition, you should note that small changes are probably irrelevant, and you my encounter random transient spikes in the signal as well. Lighting conditions can also affect the cliff sensor signals, so calibrating your threshholds once and for all at the start point could lead to errors as you cross the room. You should therefore be wary of slow changes in the signal strength.
The following scripts should be read in using the run-time command "read file <filename>" in the Environment agent (command tab). The number in the file name indicates it's nominal length in millimeters.
line1000h.txt |
delete all new object v1 Ellipse2D 500 1000 120 120 paint=true corporeal=false color=0x202020 new object p1 Line2D 500 1000 1500 1000 paint=true corporeal=false color=0x202020 |
line1400v.txt |
delete all new object v1 Ellipse2D 1000 300 120 120 paint=true corporeal=false color=0x202020 new object p1 Line2D 1000 300 1000 1700 paint=true corporeal=false color=0x202020 |
line1700d.txt |
delete all new object v1 Ellipse2D 400 400 120 120 paint=true corporeal=false color=0x202020 new object p1 Line2D 400 400 1600 1600 paint=true corporeal=false color=0x202020 |
curve1570.txt |
delete all new object v1 Ellipse2D 500 1000 120 120 paint=true corporeal=false color=0x202020 new object p1 Line2D 500 1000 510 1098 paint=true corporeal=false color=0x202020 |
curve1570.txt |
delete all new object v1 Ellipse2D 500 1000 120 120 paint=true corporeal=false color=0x202020 new object p1 Line2D 500 1000 510 1098 paint=true corporeal=false color=0x202020 |
Last updated 2009-10-02 20:53 |