proxies['ALMotion'].openHand(hand) proxies['ALMotion'].closeHand(hand) pose_and_time = proxies['ALRobotPose'].getActualPoseAndTime() if pose_and_time[1] > 180: therapist.send_status("I'm a little bored, changing position.") proxies['ALBehaviorManager'].runBehavior('Toggle Stand') def shuffle(): pose_and_time = proxies['ALRobotPose'].getActualPoseAndTime() if pose_and_time[0] == "Stand": if random.randint(0,1) > 0: proxies["ALBehaviorManager"].runBehavior("Shrug") else: proxies["ALBehaviorManager"].runBehavior("Stand Straight") therapist = NaoTherapist() while True: takePicture() command = therapist.get_next_command() if command and command.command is not None: print command.command c = 0 for i in command.params: c+=1 paramid = "parameter"+str(c) print "setting " + paramid + " to " + str(i) proxies['ALMemory'].insertData(paramid, str(i)) proxies['ALBehaviorManager'].runBehavior(str(command.command))
from NaoTherapist import NaoTherapist therapist = NaoTherapist() therapist.save_last_command_id(13)