University of Calgary
Rob Kremer
Group Assignment: Basic Robotic Agents in CASA

CPSC 601.68/599.68: Agent Communication
Fall 2009
Department of Computer Science
Computer
Science

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.

iRobot Create

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:

Startup

At startup, the robot should just acknowledge it's ready by flashing lights, playing a short song, or something appropriate of your choice.

Commands

The agent should accept the following run-time commands:

You may implement other commands as appropriate.

Measurement

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.

Agent Termination

When the agent has completed the task, the robot should acknowledge (in a manner similar to startup) and power down.

Time Limit

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.

Notes

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.

Example scenarios

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 bounds 2000 2000

new object v1 Ellipse2D 500 1000 120 120 paint=true corporeal=false color=0x202020
new object v2 Ellipse2D 1500 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 bounds 2000 2000

new object v1 Ellipse2D 1000 300 120 120 paint=true corporeal=false color=0x202020
new object v2 Ellipse2D 1000 1700 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 bounds 2000 2000

new object v1 Ellipse2D 400 400 120 120 paint=true corporeal=false color=0x202020
new object v2 Ellipse2D 1600 1600 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 bounds 2000 2000

new object v1 Ellipse2D 500 1000 120 120 paint=true corporeal=false color=0x202020
new object v2 Ellipse2D 1500 1000 120 120 paint=true corporeal=false color=0x202020

new object p1 Line2D 500 1000 510 1098 paint=true corporeal=false color=0x202020
new object p2 Line2D 510 1098 538 1192 paint=true corporeal=false color=0x202020
new object p3 Line2D 538 1192 584 1278 paint=true corporeal=false color=0x202020
new object p4 Line2D 584 1278 647 1354 paint=true corporeal=false color=0x202020
new object p5 Line2D 647 1354 722 1416 paint=true corporeal=false color=0x202020
new object p6 Line2D 722 1416 809 1462 paint=true corporeal=false color=0x202020
new object p7 Line2D 809 1462 903 1490 paint=true corporeal=false color=0x202020
new object p8 Line2D 903 1490 1000 1500 paint=true corporeal=false color=0x202020
new object p9 Line2D 1000 1500 1098 1490 paint=true corporeal=false color=0x202020
new object p10 Line2D 1098 1490 1191 1462 paint=true corporeal=false color=0x202020
new object p11 Line2D 1191 1462 1278 1416 paint=true corporeal=false color=0x202020
new object p12 Line2D 1278 1416 1354 1354 paint=true corporeal=false color=0x202020
new object p13 Line2D 1354 1354 1416 1278 paint=true corporeal=false color=0x202020
new object p14 Line2D 1416 1278 1462 1191 paint=true corporeal=false color=0x202020
new object p15 Line2D 1462 1191 1490 1098 paint=true corporeal=false color=0x202020
new object p16 Line2D 1490 1098 1500 1000 paint=true corporeal=false color=0x202020

curve1570.txt

delete all
new bounds 3000 2000

new object v1 Ellipse2D 500 1000 120 120 paint=true corporeal=false color=0x202020
new object v2 Ellipse2D 2500 1000 120 120 paint=true corporeal=false color=0x202020

new object p1 Line2D 500 1000 510 1098 paint=true corporeal=false color=0x202020
new object p2 Line2D 510 1098 538 1192 paint=true corporeal=false color=0x202020
new object p3 Line2D 538 1192 584 1278 paint=true corporeal=false color=0x202020
new object p4 Line2D 584 1278 647 1354 paint=true corporeal=false color=0x202020
new object p5 Line2D 647 1354 722 1416 paint=true corporeal=false color=0x202020
new object p6 Line2D 722 1416 809 1462 paint=true corporeal=false color=0x202020
new object p7 Line2D 809 1462 903 1490 paint=true corporeal=false color=0x202020
new object p8 Line2D 903 1490 1000 1500 paint=true corporeal=false color=0x202020
new object p9 Line2D 1000 1500 1098 1490 paint=true corporeal=false color=0x202020
new object p10 Line2D 1098 1490 1191 1462 paint=true corporeal=false color=0x202020
new object p11 Line2D 1191 1462 1278 1416 paint=true corporeal=false color=0x202020
new object p12 Line2D 1278 1416 1354 1354 paint=true corporeal=false color=0x202020
new object p13 Line2D 1354 1354 1416 1278 paint=true corporeal=false color=0x202020
new object p14 Line2D 1416 1278 1462 1191 paint=true corporeal=false color=0x202020
new object p15 Line2D 1462 1191 1490 1098 paint=true corporeal=false color=0x202020
new object p16 Line2D 1490 1098 1500 1000 paint=true corporeal=false color=0x202020
new object p17 Line2D 1500 1000 1510 902 paint=true corporeal=false color=0x202020
new object p18 Line2D 1510 902 1538 808 paint=true corporeal=false color=0x202020
new object p19 Line2D 1538 808 1584 722 paint=true corporeal=false color=0x202020
new object p20 Line2D 1584 722 1647 646 paint=true corporeal=false color=0x202020
new object p21 Line2D 1647 646 1722 584 paint=true corporeal=false color=0x202020
new object p22 Line2D 1722 584 1809 538 paint=true corporeal=false color=0x202020
new object p23 Line2D 1809 538 1903 510 paint=true corporeal=false color=0x202020
new object p24 Line2D 1903 510 2000 500 paint=true corporeal=false color=0x202020
new object p25 Line2D 2000 500 2098 510 paint=true corporeal=false color=0x202020
new object p26 Line2D 2098 510 2191 538 paint=true corporeal=false color=0x202020
new object p27 Line2D 2191 538 2278 584 paint=true corporeal=false color=0x202020
new object p28 Line2D 2278 584 2354 646 paint=true corporeal=false color=0x202020
new object p29 Line2D 2354 646 2416 722 paint=true corporeal=false color=0x202020
new object p30 Line2D 2416 722 2462 809 paint=true corporeal=false color=0x202020
new object p31 Line2D 2462 809 2490 902 paint=true corporeal=false color=0x202020
new object p32 Line2D 2490 902 2500 1000 paint=true corporeal=false color=0x202020

 


UofC
CPSC 601.68/599.68: Agent Communication
Department of Computer Science

Last updated 2009-10-02 20:53
Rob Kremer