Skip to content

Commit 4fc52ad

Browse files
committed
qtvcp -qtvismach_router_atc: fix model path, clean up code
1 parent 2d6b598 commit 4fc52ad

1 file changed

Lines changed: 29 additions & 17 deletions

File tree

share/qtvcp/panels/vismach_router_atc/vismach_router_atc_handler.py

Lines changed: 29 additions & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -15,10 +15,14 @@
1515
STATUS = Status()
1616
PATH = Path()
1717

18-
###### VISMACH MODEL CODE #################
18+
###########################################
19+
# **** VISMACH MODEL CODE **** #
20+
###########################################
21+
22+
# decided not to use separate component in example
1923
#import hal
2024

21-
#c = hal.component("3axisatcgui")
25+
#c = hal.component("router_atc")
2226
#c.newpin("joint0", hal.HAL_FLOAT, hal.HAL_IN)
2327
#c.newpin("joint1", hal.HAL_FLOAT, hal.HAL_IN)
2428
#c.newpin("joint2", hal.HAL_FLOAT, hal.HAL_IN)
@@ -29,21 +33,16 @@
2933
tool = Capture()
3034
tooltip = Capture()
3135

32-
33-
3436
# kinematic axis
3537
# axis_y -> axis_x -> axis_z -> tool
3638
# base -> work
3739

38-
3940
# tool
40-
4141
tool = Collection([tooltip, tool])
4242

4343

4444
# 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")
4746
axisz = AsciiOBJ(filename=objfile)
4847
axisz = Color([1,1,1,1],[axisz])
4948
axisz = Rotate([axisz],90,1,0,0)
@@ -52,18 +51,18 @@
5251
axisz = Translate([axisz],0,0,-77)
5352
#axisz = HalTranslate([axisz],c,"joint2",0,0,1)
5453
axisz = HalTranslate([axisz], None, "joint.2.pos-fb",0,0,1)
55-
# axis x
5654

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")
5857
head = AsciiOBJ(filename=objfile)
5958
head = Color([0.5,0.5,1,1],[head])
6059
head = Rotate([head],90,1,0,0)
6160
axisx = Collection([axisz, head])
6261
#axisx = HalTranslate([axisx],c,"joint0",1,0,0)
6362
axisx = HalTranslate([axisx],None, "joint.0.pos-fb",1,0,0)
64-
# axis y
6563

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")
6766
rack = AsciiOBJ(filename=objfile)
6867
rack = Color([0.7,0.7,0.4,0.4],[rack])
6968
rack = Rotate([rack],90,1,0,0)
@@ -72,20 +71,18 @@
7271
axisy = HalTranslate([axisy],None, "joint.1.pos-fb",0,1,0)
7372
machine = Collection([axisy])
7473

75-
76-
7774
# base
78-
objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/rangka.obj")
75+
objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/rangka.obj")
7976
rangka = AsciiOBJ(filename=objfile)
8077
rangka = Color([1,1,1,1],[rangka])
8178
rangka = Rotate([rangka],90,1,0,0)
8279

83-
objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/bed.obj")
80+
objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/bed.obj")
8481
bed = AsciiOBJ(filename=objfile)
8582
bed = Color([1,0.8,0.2,0.2],[bed])
8683
bed = Rotate([bed],90,1,0,0)
8784

88-
objfile = os.path.join(PATH.PANELDIR, "3axisatcgui/atc.obj")
85+
objfile = os.path.join(PATH.PANELDIR, "vismach_router_atc/atc.obj")
8986
atc = AsciiOBJ(filename=objfile)
9087
atc = Color([0.5,0.5,0.5,0.5],[atc])
9188
atc = Rotate([atc],90,1,0,0)
@@ -96,6 +93,20 @@
9693

9794
model = Collection([base, machine])
9895

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+
99110
# we want to embed with qtvcp so build a window to display
100111
# the model
101112
class VisWindow(QWidget):
@@ -130,6 +141,7 @@ def __init__(self):
130141
# **** instantiate libraries section **** #
131142
###########################################
132143
STATUS = Status()
144+
133145
###################################
134146
# **** HANDLER CLASS SECTION **** #
135147
###################################

0 commit comments

Comments
 (0)