Home -> Teaching -> CSAS 3085/PSYC 3698 -> Task: Houdini, or "The Great Escape"

### Task: Houdini, or "The Great Escape"

In this challenge your robot is in a rectangular room. Somewhere is an open door; your robot needs to escape from the room.

You may assume that your robot starts out parallel to a wall, with the wall on the left side of the robot.

Note that this challenge is similar to escaping a maze: a maze is simply a nested sequence of rooms with walls at right angles. If your robot can escape one room, it should be able to escape an entire maze. However, asking your robot to escape only one room simplifies your task a little, since you do not need to build an actual maze to test your robot.

Hints: Your robot needs to drive parallel to a wall on its left. Thus, it should have a distance sensor pointing to the left to ensure it remains parallel to the wall as well as to detect the opening. In addition, there could be a wall in front of the robot so it needs to have a touch sensor to detect any obstacles ahead. With those sensors in place, one possible way to solve this challenge would be to program your robot to exhibit the following behaviors:

• If it is parallel to the wall on the left, drive forward straight
• If it gets too close to the wall, drive forward and curve slightly away from the wall
• If it gets too far away from the wall, drive forward and curve slightly towards the wall
• If its path in front is blocked, it should turn right by 90 degrees clockwise
• If it detects an opening on the left side, it should turn left by 90 degrees

Alternatively, you could create a smarter “drive” behavior that would adjust the way the robot curves depending on its distance to the wall. You should add to this another ‘terminate’ behavior to stop your robot when the escape button is pressed.

Bert G. Wachsmut