UserPreferences

Exercise 1


CS 372 (Artificial Intelligence) Fall 2004 Robot Lab: Exercise 1

Stimulus response Agents: Bump-N-Grind

In this exercise we will design an SR agent capable of bumping around its environment. The agent has a bunch of bump sensors that can sense if the robot has bumped into something in its environment. By sensing these bumps the agent has to manouvre around objects and keep moving (durative behavior). Imagine if you entered a pitch dark room and had to move about in it. This behavior is similar.

You will implement this behavior in Pyro using the Stage Simulator using the tutorial.world with a simulated Pioneer robot (connect through Player6665). The robot has five bump sensors arranged in an arc around one end of the robot. The following simple algorithm is suggested:

   if left bump then back up a little and turn right, go forward
   else if right bump then back up a little and turn left, go forward
   else if front bump then back up a little, turn left or right a little, go forward
   else go forward

Doing something for a short while can be achieved by using the sleep command:

   # go backward
   sleep(0.5)
   # do something else

That is, start going backward, do that for 0.5 seconds, and then do something else. The sleep command is available in the standard Python library time (time.sleep(...)). You will need to adjust the amount of turns and the amount of sleep to get seemingly robust behaviors.

Start by implemnting the above algorithm and observe the behavior of the robot for several different runs. Then answer the following questions:

  1. How would you characterize the robot's behavior?

  2. Does it seem robust? Try the behaviors by placing the robot in different parts of the environment.

  3. How well does it deal with corners? Try sending the robot diagonally into a corner a few times. Was the robot able to negotiate itself out of the corner? If not, think about how you could improve the brain program and implement it. Describe your solution.

  4. Show the behavior to some of your friends (or others in the lab who are not in the class). Ask them to describe the robot's behavior (do not tell them what your algorithm or task is). Write down their description(s).

Hand in a written report with your answers to the questions above. Also, attach a printout of your brain program and a short discussion of your own on your overall experience.

Comments and Questions

  Attempting to import 'ibSRbrain'...
  Exception in Tkinter callback
  Traceback (most recent call last):
  File "/usr/src/build/394694-i386/install/usr/lib/python2.3/lib-tk/Tkinter.py", line 1345, in __call__
    return self.func(*args)
  File "/usr/local/pyrobot/gui/__init__.py", line 280, in loadBrain
    self.engine.loadBrain(f)
  File "/usr/local/pyrobot/engine/__init__.py", line 163, in loadBrain
    self.brain = system.loadINIT(file, self)
  File "/usr/local/pyrobot/system/__init__.py", line 76, in loadINIT
    exec("import " + module + " as userspace")
  File "<string>", line 1, in ?
  File "/home/ibutoi/AI/Hw1/ibSRbrain.py", line 7, in ?
    from pyrobot.brain.Brain import *
 ImportError: No module named Brain