Trying to have a infinit loop in "go forward", which would stop when "kill the motors" is called
def heard(data):
data = msg_i01_ear_recognized.data[0]
if (data == "go forward"):
forwardServo.moveTo(60)
x = 1
while True:
i01.setHandSpeed("left", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
i01.setHandSpeed("right", 1.0, 1.0, 1.0, 1.0, 1.0, 1.0)
i01.setArmSpeed("right", 0.95, 0.95, 0.95, 0.85)
i01.setArmSpeed("left", 0.95, 0.95, 0.95, 0.85)
i01.setHeadSpeed(0.75, 0.75)
i01.moveHead(70,79,85,85,65)
i01.moveArm("left",5,90,23,10)
i01.moveArm("right",15,90,30,10)
i01.moveHand("left",92,33,37,71,66,25)
i01.moveHand("right",81,66,82,60,105,113)
i01.moveTorso(75,97,90)
sleep(2)
i01.moveHead(79,100,85,85,65)
i01.moveArm("left",15,84,36,15)
i01.moveArm("right",5,82,22,20)
i01.moveHand("left",92,33,37,71,66,25)
i01.moveHand("right",81,66,82,60,105,113)
i01.moveTorso(124,83,90)
sleep(2)
x += 1
if (data == "kill the motor"):
forwardServo.moveTo(93)
relax()
break
In this exemple I made the "break" function is out of the loop, and I have been reading stuff, but I'm getting tired and I implore the good Elves of MyRobotLab for help.
example thread .. (not tested yet)
Great Kevin! Added it to my
Great Kevin!
Added it to my full script and worky!! after all the back and forth emails it is cool!
Thanks for your help!
Gael