from pyrobot.brain import Brain

# This brain moves forward, printing out the current front sensor
# readings.

class SimpleBrain(Brain):

   def setup(self):
      self.speed = 0.3

   def step(self):
      frontSensorValues = [s.distance() for s in self.robot.range['front']]
      print 'min front sensor =', min(frontSensorValues)
      # move forward with no rotation
      self.robot.move(self.speed, 0)


def INIT(engine):
   return SimpleBrain('Simple brain', engine)
