-
Notifications
You must be signed in to change notification settings - Fork 0
/
ControlPanel.qml
94 lines (88 loc) · 2.68 KB
/
ControlPanel.qml
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
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
import QtQuick 2.12
import QtQuick.Controls 1.4
import QtQuick.Controls.Styles 1.4
import QtGraphicalEffects 1.12
Item{
id: controlPanel
anchors.fill: parent
ArrowPad{
id: trans
z:11
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: parent.width / 15 + width/2
anchors.verticalCenter: resetButton.verticalCenter
visible: commandGui.visible
}
ArrowPad{
id: other
z:11
type: "other"
visible: commandGui.visible
anchors.horizontalCenter: parent.horizontalCenter
anchors.verticalCenter: resetButton.verticalCenter
}
ArrowPad{
id: rot
z:11
visible: commandGui.visible
type: "rotation"
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: -parent.width / 15 - width/2
anchors.verticalCenter: resetButton.verticalCenter
}
GuiButton{
id: grasp
anchors.bottom: parent.bottom
anchors.bottomMargin: width/2 + 5/4 *height
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: parent.width/4
name: 'Grasp'
color: "steelblue"
onClicked: {
pubCommand("direct;"+name)
}
}
GuiButton{
id: release
anchors.bottom: parent.bottom
anchors.bottomMargin: width/2 - height/5
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: parent.width/4
name: 'Release'
color: "steelblue"
onClicked: {
pubCommand("direct;"+name)
}
}
GuiButton{
id: resetButton
anchors.horizontalCenter: parent.horizontalCenter
anchors.horizontalCenterOffset: 3*parent.width/8
anchors.bottom: parent.bottom
anchors.bottomMargin: width
z:10
name: "reset"
onClicked:{
pubCommand("reset_position")
}
visible: globalStates.state === "command"
}
GuiButton{
id: stopButton
z:10
anchors.horizontalCenter: resetButton.horizontalCenter
anchors.verticalCenter: resetButton.verticalCenter
name: "stop"
color: "red"
onClicked:{
pubCommand("stop")
globalStates.state = "command"
}
visible: globalStates.state === "execution"
}
function filter_button(panda_pose){
trans.setEnabled("up", panda_pose[0]**2 + panda_pose[1]**2 + panda_pose[2]**2 < .56)
other.setEnabled("down", panda_pose[0]**2 + panda_pose[1]**2 + panda_pose[2]**2 < .56)
other.setEnabled("up", panda_pose[2]>.1)
}
}