|
15 | 15 | STATUS = Status() |
16 | 16 | PATH = Path() |
17 | 17 |
|
18 | | -###### VISMACH MODEL CODE ################# |
| 18 | +########################################### |
| 19 | +# **** VISMACH MODEL CODE **** # |
| 20 | +########################################### |
| 21 | + |
| 22 | +# decided not to use separate component in example |
19 | 23 | #import hal |
20 | 24 |
|
21 | | -#c = hal.component("3axisatcgui") |
| 25 | +#c = hal.component("router_atc") |
22 | 26 | #c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN) |
23 | 27 | #c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN) |
24 | 28 | #c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN) |
|
29 | 33 | tool = Capture() |
30 | 34 | tooltip = Capture() |
31 | 35 |
|
32 | | - |
33 | | - |
34 | 36 | # kinematic axis |
35 | 37 | # axis_y -> axis_x -> axis_z -> tool |
36 | 38 | # base -> work |
37 | 39 |
|
38 | | - |
39 | 40 | # tool |
40 | | - |
41 | 41 | tool = Collection([tooltip, tool]) |
42 | 42 |
|
43 | 43 |
|
44 | 44 | # axis z |
45 | | -print(PATH.PANELDIR) |
46 | | -objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/headz.obj") |
| 45 | +objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/headz.obj") |
47 | 46 | axisz = AsciiOBJ(filename=objfile) |
48 | 47 | axisz = Color([1,1,1,1],[axisz]) |
49 | 48 | axisz = Rotate([axisz],90,1,0,0) |
|
52 | 51 | axisz = Translate([axisz],0,0,-77) |
53 | 52 | #axisz = HalTranslate([axisz],c,"joint2",0,0,1) |
54 | 53 | axisz = HalTranslate([axisz], None, "joint.2.pos-fb",0,0,1) |
55 | | -# axis x |
56 | 54 |
|
57 | | -objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/head.obj") |
| 55 | +# axis x |
| 56 | +objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/head.obj") |
58 | 57 | head = AsciiOBJ(filename=objfile) |
59 | 58 | head = Color([0.5,0.5,1,1],[head]) |
60 | 59 | head = Rotate([head],90,1,0,0) |
61 | 60 | axisx = Collection([axisz, head]) |
62 | 61 | #axisx = HalTranslate([axisx],c,"joint0",1,0,0) |
63 | 62 | axisx = HalTranslate([axisx],None, "joint.0.pos-fb",1,0,0) |
64 | | -# axis y |
65 | 63 |
|
66 | | -objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/gantri.obj") |
| 64 | +# axis y |
| 65 | +objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/gantri.obj") |
67 | 66 | rack = AsciiOBJ(filename=objfile) |
68 | 67 | rack = Color([0.7,0.7,0.4,0.4],[rack]) |
69 | 68 | rack = Rotate([rack],90,1,0,0) |
|
72 | 71 | axisy = HalTranslate([axisy],None, "joint.1.pos-fb",0,1,0) |
73 | 72 | machine = Collection([axisy]) |
74 | 73 |
|
75 | | - |
76 | | - |
77 | 74 | # base |
78 | | -objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/rangka.obj") |
| 75 | +objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/rangka.obj") |
79 | 76 | rangka = AsciiOBJ(filename=objfile) |
80 | 77 | rangka = Color([1,1,1,1],[rangka]) |
81 | 78 | rangka = Rotate([rangka],90,1,0,0) |
82 | 79 |
|
83 | | -objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/bed.obj") |
| 80 | +objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/bed.obj") |
84 | 81 | bed = AsciiOBJ(filename=objfile) |
85 | 82 | bed = Color([1,0.8,0.2,0.2],[bed]) |
86 | 83 | bed = Rotate([bed],90,1,0,0) |
87 | 84 |
|
88 | | -objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/atc.obj") |
| 85 | +objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/atc.obj") |
89 | 86 | atc = AsciiOBJ(filename=objfile) |
90 | 87 | atc = Color([0.5,0.5,0.5,0.5],[atc]) |
91 | 88 | atc = Rotate([atc],90,1,0,0) |
|
96 | 93 |
|
97 | 94 | model = Collection([base, machine]) |
98 | 95 |
|
| 96 | +# uncomment for a DRO HUD |
| 97 | +#myhud = HalHud() |
| 98 | +#myhud.set_background_color(0,.1,.2,0) |
| 99 | +#myhud.show_top("Router_atc") |
| 100 | +#myhud.show_top("------------") |
| 101 | +#myhud.add_pin('axis-x: ',"{:10.4f}","axis.x.pos-cmd") |
| 102 | +#myhud.add_pin('axis-y: ',"{:10.4f}","axis.y.pos-cmd") |
| 103 | +#myhud.add_pin('axis-z: ',"{:10.4f}","axis.z.pos-cmd") |
| 104 | +#myhud.show("-------------") |
| 105 | + |
| 106 | +########################################### |
| 107 | +# model window # |
| 108 | +########################################### |
| 109 | + |
99 | 110 | # we want to embed with qtvcp so build a window to display |
100 | 111 | # the model |
101 | 112 | class VisWindow(QWidget): |
@@ -130,6 +141,7 @@ def __init__(self): |
130 | 141 | # **** instantiate libraries section **** # |
131 | 142 | ########################################### |
132 | 143 | STATUS = Status() |
| 144 | + |
133 | 145 | ################################### |
134 | 146 | # **** HANDLER CLASS SECTION **** # |
135 | 147 | ################################### |
|
0 commit comments