-
Notifications
You must be signed in to change notification settings - Fork 0
/
robot.py
executable file
·71 lines (53 loc) · 1.59 KB
/
robot.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
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
#!/usr/bin/env python
from Maestor import maestor
def theRobot():
robot = maestor()
bendDown(robot)
doTheRobot(robot)
standUp(robot)
def bendDown(robot):
robot.setProperties("RFZ LFZ", "position position", "-.52 -.52")
robot.waitForJoint("RFZ")
robot.waitForJoint("LFZ")
def waitForJoints(robot):
robot.waitForJoint("RSR")
robot.waitForJoint("RSY")
robot.waitForJoint("REP")
def armUp(robot):
robot.setProperty("NKY", "position", -.65)
robot.setProperties("RSY RSR", "position position", "1.57 -1.35")
def swingArm(robot):
robot.setProperty("REP", "position", -1.7)
robot.waitForJoint("REP")
robot.setProperty("REP", "position", 0)
robot.waitForJoint("REP")
def armDown(robot):
robot.setProperties("RSY RSR NKY", "position position position", "0 0 0")
def doTheRobot(robot):
armUp(robot)
waitForJoints(robot)
for i in range(0, 2):
swingArm(robot)
armDown(robot)
waitForJoints(robot)
def standUp(robot):
robot.setProperties("RFZ LFZ", "position position", "-.56 -.56")
robot.waitForJoint("RFZ")
robot.waitForJoint("LFZ")
def getDanceList():
danceList = []
#add all of the key parts of the dance. Including the wait for joints
danceList.append(armUp)
danceList.append(waitForJoints)
danceList.append(swingArm)
danceList.append(swingArm)
danceList.append(swingArm)
danceList.append(armDown)
danceList.append(waitForJoints)
return danceList
def theRobotRobot(robot):
bendDown(robot)
doTheRobot(robot)
standUp(robot)
if __name__ == '__main__':
theRobot()