Again my apologies to spamming you guys. At least someone's using the
stuff, yes?
I switched machines (still running the same pyro live knoppix CD) and
now my code works (phew). Though sometimes it appears (and this is true
with the joystick interface too) that the Hemisson isn't getting the
command to move.
Specifically:
* Occasionally I click on the joystick interface to go forward and
get no response. Repeat the click and the robot moves
* I step through my program. It prints "moving" on the screen but
the robot doesn't move
* I need to run my robot at an incredibly slow speed to get it to
stop before bumping into something. I suspect this is because not
all of the "stop" commands are being received.
My current code: (have tried permutations of self.robot.ir / self.ir and
self.robot.move and self.move -- they seem equivalent. Am I missing
something?)
# robot goes forward and then slows to a stop when it detects something
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.488:
self.robot.move(0.2,0)
print "moving ..."
else:
print "stopping"
self.robot.stop()
def INIT(engine):
return StopWhenClose('StopWhenClose', engine)
_______________________________________________
Pyro-users mailing list
Pyro-users@pyrorobotics.org
http://emergent.brynmawr.edu/mailman/listinfo/pyro-users