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

Tekkotsu Links:   Tutorial Resources Bugs CVS
Reference:

Cognitive Robotics: Lab 9


Part I: Looking Glass "Hello World"

1. In your project/ms directory, create the subdirectory project/ms/lg. Then create the file project/ms/lg/file1.htm with the following content:
<html><body>
<center><font size=+5 color=red>Hello world!</center>
</body></html>
2. Compile the behavior LGdemo:
#include "Behaviors/BehaviorBase.h"
#include "Events/EventRouter.h"
#include "Wireless/LGmixin.h"

class LGdemo : public BehaviorBase, public LGmixin {
 public:
  LGdemo() : BehaviorBase("LGdemo"), LGmixin() {}

  void DoStart() {
    BehaviorBase::DoStart();
    erouter->addListener(this, EventBase::buttonEGID, RobotInfo::HeadButOffset);
  }

  void processEvent(const EventBase &) {
    uploadFile("ms/lg/file1.htm");
    displayHtmlFile("file1.htm");
  }

};

Notice that when you upload a file from the AIBO to the Looking Glass client you must give the path name beginning with the ms directory. The Looking Glass client stores uploaded files in a temporary directory on the PC, and does not know the path they originated from on the memory stick. So when you display a file that has been uploaded this way, (e.g. displayHtmlFile()) do not include path name information.

3. Boot the AIBO and start the LGdemo behavior, but do not push the head button yet.

4. In a separate terminal window, cd to Tekkotsu/tools/mon, then type:
java org.tekkotsu.mon.LGClient <aibo name>
Nothing will happen until the next step.

5. Now make sure the AIBO is un-stopped, and press the head button. A Looking Glass screen should pop up on your PC.

Part II: "Both Sides Now"

In this exercise you are going to take pictures of a landmark configuration viewed from two locations. Start by reviewing the LGmixin::uploadCameraImage function, which takes a snapshot and uploads it to the Looking Glass client as a JPEG file.

Set up two dissimilar landmarks, such as an orange can and a green game piece, so that one is to the left of the other, with a gap in between. Write a behavior to do the following:
  1. Scan for the landmarks, and construct a world map with the landmarks on it.

  2. Look at the landmarks, take a snapshot of the scene, and display it on the Looking Glass.

  3. Walk through the landmarks so that they are now behind the robot. (You can either use the Pilot, or a WalkMC motion command.) Then turn around, and take a picture of the landmarks from this new position. Upload this picture to the Looking Glass client.

  4. Display both landmark scenes side-by-side, so they can be easily compared.
Turn in your answers by Friday, April 6 (extended to April 13).
Dave Touretzky and Ethan Tira-Thompson