15-494 Cognitive Robotics
Spring 2006
Course Links:  Main Lectures Labs Homeworks

Tekkotsu Links:  Tutorials Bugs CVS
Reference:

Cognitive Robotics: Lab 6


Part I: Find A Soda Can

Your mission for this lab is to find an orange soda can and knock it over by walking into it. In order to find the soda can, you will need to construct a local map. Program the local map builder to look for orange blobs, and set minBlobAreas for orange blobs to 50 pixels. (Refer to Lab 4 to review use of the local map builder, and look at MapBuilder.cc to understand how minBlobAreas works.)

You will need to do localmap.setAuto(true) to tell the local map builder that it is free to move the head around in order to construct the map automatically. Do this before you call localmap.scan(). Wait for a status event with mapbuilderEGID to indicate that the map is complete.

Examine the shapes in localShS and find an orange blob. If there are no orange blobs visible, you will need to rotate the body in order to look in other directions. To do this, you will have to issue a Pilot request. First, construct a PilotRequest::Rotate request to rotate the body by some reasonable angle. (The constructor for PilotRequest::Rotate takes two arguments: an arbitrary unsigned integer request id that will serve as the SID for status events, and a rotation angle in radians.) Then, use pilot.executeRequest(req) to execute your request. Wait for an event with pilotEGID to signal that the motion is complete. Then clear the local shape space before invoking the local map builder again.

If you do find an orange blob in the local shape space, print out its coordinates relative to the body.

Part II: Knock It Down

Once you've found an orange blob, you need to tell the Pilot to take the robot to that location. You can do this by calling Pilot.gotoShape(s), where s is the Shape<BlobData> you extracted from the local shape space. (Eventually there will be a special PilotRequest type to handle this, but for now, gotoShape must be used.)

The Pilot will post a deactivate event when it has completed its motion. Play an appropriate sound to indicate that the mission is now complete.

Hand in your code before leaving the lab.


Dave Touretzky and Ethan Tira-Thompson