Skip to content

Commit

Permalink
Merge branch 'master' of https://github.com/riglab/spyderbot
Browse files Browse the repository at this point in the history
  • Loading branch information
mynameishamish committed May 3, 2018
2 parents befacc7 + ccd44df commit 8ee2093
Show file tree
Hide file tree
Showing 2 changed files with 98 additions and 2 deletions.
45 changes: 44 additions & 1 deletion motionGUI.py
@@ -1,6 +1,7 @@
import time
import math
import numpy
import random

from easing import *
from motions import *
Expand Down Expand Up @@ -122,6 +123,37 @@
[robot.m1 , x, robot.m1.present_position, 37] ,
[robot.m2 , eie, robot.m2.present_position, -52] ,
[robot.m3 , eoq, robot.m3.present_position, 105]]

netural= [
[robot.m1 , x, robot.m1.present_position, robot.m1.present_position+10 ],
# [robot.m2 , x, robot.m2.present_position, robot.m1.present_position-2],
# [robot.m3 , x, robot.m3.present_position, robot.m1.present_position+2]
]
netural2= [
[robot.m2 , x, robot.m2.present_position, robot.m2.present_position+5 ],
# [robot.m2 , x, robot.m2.present_position, robot.m1.present_position-2],
[robot.m3 , x, robot.m3.present_position, robot.m1.present_position+5]
]
netural3= [
# [robot.m2 , x, robot.m2.present_position, robot.m2.present_position+2 ],
[robot.m2 , x, robot.m2.present_position, robot.m1.present_position+5],
[robot.m3 , x, robot.m3.present_position, robot.m1.present_position-5]]
netural4= [
[robot.m2 , x, robot.m2.present_position, robot.m2.present_position-2 ],
# [robot.m2 , x, robot.m2.present_position, robot.m1.present_position-2],
[robot.m3 , x, robot.m3.present_position, robot.m1.present_position-2]
]

netural5= [
# [robot.m2 , x, robot.m2.present_position, robot.m2.present_position+2 ],
[robot.m2 , x, robot.m2.present_position, robot.m1.present_position-2],
[robot.m3 , x, robot.m3.present_position, robot.m1.present_position+2]]

netural6= [
[robot.m1 , x, robot.m1.present_position, robot.m1.present_position-10 ],
[robot.m2 , x, robot.m2.present_position, robot.m1.present_position+2]
# [robot.m3 , x, robot.m3.present_position, robot.m1.present_position+2]
]
# resting(30,30,30)

# time.sleep(2)
Expand All @@ -133,6 +165,8 @@
window.title("Spyderbot Motion")

window.geometry('400x350')

a =numpy.array([netural,netural2,netural3,netural4,netural5,netural6])

# lbl = Label(window, text="Hello")

Expand All @@ -150,6 +184,12 @@ def checkLeftParticipant():
def checkRightParticipant():
print("Check Right Participant")
easingMultiple(ParticipantRight, 1.2)

def neturalMotion():
print("Rondom Netural Motion")
targetmotion = random.randint(0,5)
easingMultiple(a[targetmotion],1.5)

def rest():
print("rest")
easingMultiple(motionrest,1)
Expand All @@ -168,7 +208,10 @@ def rest():
RightParticipant.grid(column=2, row=2)

rest = Button(window, text = "rest", command = rest)
rest.grid(column=5,row = 4)
rest.grid(column=5,row = 5)

netural = Button(window, text = "netural", command = neturalMotion)
netural.grid(column=2,row = 5)


window.mainloop()
Expand Down
55 changes: 54 additions & 1 deletion runmotion.py
Expand Up @@ -103,7 +103,43 @@
[robot.m2 , eoc, robot.m2.present_position, -55] ,
[robot.m3 , x, robot.m3.present_position, 99]
]
resting(30,30,30)

turn1 = [
[robot.m1 , x, robot.m1.present_position, -55] ,
[robot.m2 , x, robot.m2.present_position, -45] ,
[robot.m3 , x, robot.m3.present_position, 100]

]

turnup = [
[robot.m1 , x, -55, -55] ,
[robot.m2 , x, -45, -53] ,
[robot.m3 , x, 100, 117]

]

turndown = [
[robot.m1 , x, -55, -55] ,
[robot.m2 , x, -53, -50] ,
[robot.m3 , x, 117, 98]

]

check1 = [
[robot.m1 , s, robot.m1.present_position, -46] ,
[robot.m2 , s, robot.m2.present_position, -67] ,
[robot.m3 , y, robot.m3.present_position, 83]

]

check2 = [
[robot.m1 , s, robot.m1.present_position, 35] ,
[robot.m2 , s, robot.m2.present_position, -67] ,
[robot.m3 , s, robot.m3.present_position, 83]

]

resting(45,45,45)

time.sleep(2)

Expand Down Expand Up @@ -133,6 +169,23 @@
easingMultiple(look,1)
elif command == "read":
easingMultiple(read, 1)
elif command =="curious":
easingMultiple(look,1)
time.sleep(0.5)
# easingMultiple(motionrest,1)
# time.sleep(1)
easingMultiple(check1,1)
time.sleep(1)
easingMultiple(check2,1.5)
time.sleep(2)
elif command =="sigh":
easingMultiple(turn1,1.5)
time.sleep(1)
print("up")
easingMultiple(turnup,1.5)
print("down")
easingMultiple(turndown,1.5)
time.sleep(1)
elif command == "dance":
while True:
easingMultiple(musicdown,1)
Expand Down

0 comments on commit 8ee2093

Please sign in to comment.