コード例 #1
0
ファイル: test.py プロジェクト: spurkis/Nao-Therapist
    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))
コード例 #2
0
ファイル: reset.py プロジェクト: spurkis/Nao-Therapist
from NaoTherapist import NaoTherapist

therapist = NaoTherapist()
therapist.save_last_command_id(13)