-
Notifications
You must be signed in to change notification settings - Fork 0
/
main_simOnly.py
71 lines (68 loc) · 1.67 KB
/
main_simOnly.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
from mass import *
from joint import *
import joint_test as jt
from mech import *
from mech_walkingSimulationV3_test import *
from mfStructure_test import *
import time
def test_software(short=False):
#Mass calculation testing
p = True
if not jt.test_joint():
p = False
if not test_mass():
p = False
if not test_findOptimumMechWalk(short=short):
p = False
if not test_mfStructure():
p = False
if p:
print "Passed tests"
if __name__ == '__main__':
import sys
if(len(sys.argv) > 1):
ar = sys.argv[1]
if(ar == '-t'):
test_software()
sys.exit()
elif(ar == '-ts'):
test_software(short=True)
sys.exit()
elif(ar == '-td'):
structure = test_structureSeed_pyramid()
structure.computeLocations()
elif(ar == '-rs'): #RUN SIMULATION
findOptimumMechWalk()
elif(ar == '-rf'):
m = mech(part='foot')
m.computeLocations()
ma = m.struct.getCenterOfMass()
print ma.toString()
elif(ar == '-rl'):
m = mech(part='leg')
m.computeLocations()
ma = m.struct.getCenterOfMass()
print ma.toString()
elif(ar == '-ra'):
m = mech(part='all')
m.computeLocations()
ma = m.struct.getCenterOfMass()
print ma.toString()
elif(ar == '-rh'):
m = mech(part='hipandlegs')
m.computeLocations()
ma = m.struct.getCenterOfMass()
print ma.toString()
elif(ar == '-rp'):
m = mech(part='all')
m.moveAllActuators(1.8,1.41,0.9,1.41)
m.computeLocations()
co = m.checkForCollisions()
print "Collision status is: %s"%co
#else:
# disp= structureDisplay()
# mech = mech()
# mech.computeLocations()
#disp.displayLines_animate(mech.struct.getLinesList(),save=False)
# disp.displayLines(mech.struct.getLinesList())
print "done"