15-494 Cognitive Robotics Spring 2007 |
|
Part I: Storyboard Tool
Modify the shorthand form of the bark/howl/blink
state machine from the State Machines chapter of the Tekkotsu
tutorial to also wag the tail while the dog is howling, using a
TailWagNode. Call your file BarkHowl.h.fsm. (Note: in
StartupBehavior_SetupModeSwitch.cc you should include BarkHowl.h,
which will be generated for you automatically by the Tekkotsu
Makefile.) Run your modified state machine on the dog.
Briefly review the Storyboard Tool chapter of the Tekkotsu tutorial, which you should have read prior to this lab. Follow the instructions in the Downloading a state machine model section of the Storyboard chapter to download the model of your state machine and create an appropriate layout. Run your state machine on the dog and generate an execution trace using the Storyboard tool. Hand in a screen capture showing your layout and the execution trace. Part II: Rock Paper Scissors Referee
Your answers to this part should be turned in as Homework 5, due Monday, February 25.
In the Rock-Paper-Scissors game, two players independently pick one of rock, paper, and scissors. Then their choices are revealed, and the winner is determined by the following rule: rock is covered by paper, paper is cut by scissors, and scissors is broken by rock. If both players pick the same object, it's a tie. Program the AIBO to referee this game. Each user's choice is represented by a colored easter egg half: orange, yellow, or green. The users make their choices, lay their easter egg halves in front of the AIBO, one next to the other, and press the front head button. The AIBO looks at the choices and then turns its head to the left if the left object is the winner, or to the right if the right object is the winner. It should give a short bark when the head reaches its desired position. In the case of a tie, the AIBO should lay its head down and make a whimpering sound. After announcing the winner and holding its head position for 5 seonds, the AIBO should bring its head back to the neutral position and wait for the next button press. To implement this state machine, you will want to create a subclass of VisualRoutinesStateNode instead of VisualRoutinesBehavior. Inside this behavior you will construct a parent state node, and that parent node will in turn construct your state machine. You will use various node types like SoundNode and HeadPointerNode to perform the desired actions. To determine the winner, you will need to create a new node type that will analyze the scene before it. Because the camera has such a narrow field of view, users may have trouble placing the game pieces within the camera's sight, so you should use the MapBuilder to move the head around, to find the game pieces. The demo code in lab5.h shows how to do this. We will define a series of gaze points for the MapBuilder to visit in order search for game pieces. Note: the gaze points in this demo code are not particularly well chosen for this problem; come up with a better search pattern. The code leaves the polygon object in localShS so you can see the search pattern as well as the shapes the MapBuilder found. The map builder will post a status event when the map is complete. There are several different approaches to solving this state machine problem -- feel free to also create new transition types if desired. Once you have your state machine working properly, use the Storyboard tool to generate a model and an execution trace. Hand in: your source code, a screen capture of your model and execution trace, and a screen capture of the local map space showing your search pattern. Dave Touretzky and Ethan Tira-Thompson |