-
Notifications
You must be signed in to change notification settings - Fork 0
/
nod_head.py
48 lines (36 loc) · 1.33 KB
/
nod_head.py
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
import argparse
import time
import random
from naoqi import ALProxy
robotIP = 'nico.d.mtholyoke.edu'
PORT = 9559
count = 0
motionProxy = ALProxy("ALMotion", robotIP, PORT)
postureProxy = ALProxy("ALRobotPosture", robotIP, PORT)
r_shoulder = ['RShoulderPitch', 'RShoulderRoll']
l_shoulder = ['LShoulderPitch', 'LShoulderRoll']
l_elbow = ['LElbowYaw', 'LElbowRoll']
r_elbow = ['RElbowYaw', 'RElbowRoll']
#names = ['HeadYaw', 'HeadPitch']
times = [[0.5], [0.5]]
for i in range(2):
#motionProxy.angleInterpolation(names, [0.0, 0.0], times, True)
motionProxy.angleInterpolation(r_shoulder, [-1.0, 0.0], times, True)
motionProxy.angleInterpolation(r_shoulder, [-0.5, -0.5], times, True)
#motionProxy.angleInterpolation(l_shoulder, [0.0, -0.3], times, True)
#motionProxy.angleInterpolation(l_elbow, [-1, -0.02], times, False)
#motionProxy.angleInterpolation(r_elbow, [1, 0.02], times, False)
'''
for i in range(2):
#nodding head; positive - downward
motionProxy.angleInterpolation(right_names, [0.0, -1.0], times, True)
motionProxy.angleInterpolation(left_names, [0.0, 1.0], times, True)
#motionProxy.angleInterpolation(names, [0.5, -0.5], times, True)
'''
'''
while count < 2:
motionProxy.setAngles("HeadPitch", 0.2, 0.6)
#motionProxy.setAngles("HeadYaw", 0.4, 0.6)
motionProxy.setAngles("HeadPitch", -0.2, 0.6)
time.sleep(2)
count+=1'''