Sorry to flood the list tonight with emails. I'm so very very close ... trying to run with a "real" Hemisson

From the command line, I say,
robot.move(0.5,0)
and my  goes forward (yay!)

Then I say
   robot.stop()
and it (usually) stops. Yay again


So I write a simple brain:

from pyrobot.brain import Brain

class StopWhenClose(Brain):


   def step(self):
      front = self.robot.ir[0][0].distance()
      print "front ir: ",front

      if front > 0.4:
          self.robot.move(0.5,0)
          print "moving ..."
      else:
          print "stopping"
          self.robot.stop()


def INIT(engine):
return StopWhenClose('StopWhenClose', engine)


And my output looks promising:

front ir:  0.5
moving ...
front ir:  0.5
moving ...
front ir:  0.5
moving ...
front ir:  0.5
moving ...
front ir:  0.5
moving ...
front ir:  0.49853372434
moving ...
front ir:  0.477028347996
moving ...
front ir:  0.379276637341
stopping
front ir:  0.379765395894
stopping
front ir:  0.399804496579
stopping
front ir:  0.396383186706
stopping


except my motors never actually start or stop. So what am I doing wrong???

Thanks,

-- Jennie

--
Jennifer Kay
Associate Professor
Rowan University                        email: k...@elvis.rowan.edu
Computer Science Department             voice: 856-256-4593
201 Mullica Hill Road                   fax:    856-256-4741
Glassboro, NJ 08028                     web: http://www.rowan.edu/~kay/

_______________________________________________
Pyro-users mailing list
Pyro-users@pyrorobotics.org
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users

Reply via email to