-
Notifications
You must be signed in to change notification settings - Fork 0
/
Copy pathmain.py
69 lines (63 loc) · 2.66 KB
/
main.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
from wood_gripper import WoodGripper
from robot_platform import RobotPlatform
from supervisor import Supervisor
import robopy.base.model as robot
from excercises import robot_visual
wood_gripper = WoodGripper()
robot_platform = RobotPlatform()
supervisor = Supervisor()
model = robot.Puma560()
while True:
print("------------------------------")
print("Choose action from menu below: ")
print("------------------------------")
print("Press 'a' to start a new cycle and visualize station at the end. ")
print("Press 'b' to show graphs of transitions between states. ")
print("Press 'c' to show only visualization of the whole cycle. ")
print("Press 'd' to show a path between 2 chosen states. ")
print("------------------------------")
n = input("Action: ")
if n == "a":
supervisor.real_deal()
elif n == "b":
print("Choose graph to show: ")
print("------------------------------")
print("Press '1' to show the supervisor graph ")
print("Press '2' to show the gripper graph ")
print("Press '3' to show the robot and the platform graph ")
print("------------------------------")
w = input("Action: ")
if w == "1":
supervisor.build_supervisor_graph()
supervisor.draw_supervisor_graph()
elif w == "2":
wood_gripper.build_gripper_graph()
wood_gripper.draw_gripper_graph()
elif w == "3":
robot_platform.build_robot_graph()
robot_platform.draw_robot_graph()
elif n == "c":
robot_visual.visual(model)
elif n == "d":
print("Choose graph to analyze: ")
print("------------------------------")
print("Press '1' to analyze the supervisor graph ")
print("Press '2' to analyze the gripper graph ")
print("Press '3' to analyze the robot and the platform graph ")
print("------------------------------")
w = input("Action: ")
if w == "1":
supervisor.build_supervisor_graph()
x = input("Provide start node: ")
y = input("Provide end node: ")
supervisor.analyze_supervisor_graph(x, y)
elif w == "2":
wood_gripper.build_gripper_graph()
x = input("Provide start node: ")
y = input("Provide end node: ")
wood_gripper.analyze_gripper_graph(x, y)
elif w == "3":
robot_platform.build_robot_graph()
x = input("Provide start node: ")
y = input("Provide end node: ")
robot_platform.analyze_robot_graph(x, y)