-
Notifications
You must be signed in to change notification settings - Fork 1
/
tello.kv
279 lines (266 loc) · 8.77 KB
/
tello.kv
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
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
# tello.kv for Windows landscope
<MainWidget>:
orientation: 'vertical'
BoxLayout:
orientation: 'horizontal'
size_hint: (1, 0.12)
Button:
id: LandButton
text: 'Land'
on_release: root.land()
Button:
id: TakeoffButton
text: 'Takeoff'
on_release: root.takeoff()
Button:
id: ConnectButton
text: 'Connect'
on_release: root.connect()
Button:
id: RunDemoButton
text: 'Run Demo'
on_release: root.runCommandFromFileAsync('samples\simple.txt')
Button:
id: RunDemo2Button
text: 'Run Demo2'
on_release: root.runCommandFromFileAsync('samples\video360.txt')
BoxLayout:
orientation: 'horizontal'
size_hint: (1, 0.12)
Button:
id: FlyPathButton
text: ' '
#on_release: root.takeoff()
Button:
id: FaceTrackButton
text: 'Face Tracking'
on_release: root.startOrStopFaceTrackingAsync()
Button:
id: StreamButton
text: 'Stream'
on_release: root.startOrStopStreamVideoAsync()
Button:
id: VideoButton
text: 'Video'
on_release: root.startOrStopSaveVideoAsync()
Button:
id: PhotoButton
text: 'Photo'
on_release: root.takePictureAsync()
BoxLayout:
orientation: 'horizontal'
size_hint: (1, 0.1)
Button:
id: Speed80Button
text: 'Speed 80'
on_release: root.setSpeed(80)
Button:
id: Speed65Button
text: 'Speed 65'
on_release: root.setSpeed(65)
Button:
id: Speed50Button
text: 'Speed 50'
on_release: root.setSpeed(50)
Button:
id: Speed35Button
text: 'Speed 35'
on_release: root.setSpeed(35)
Button:
id: Speed20Button
text: 'Speed 20'
on_release: root.setSpeed(20)
BoxLayout:
orientation: 'horizontal'
size_hint_y: 0.5
ScrollView:
do_scroll_x: False
do_scroll_y: True
size_hint: (0.6, 1)
#size: self.size
Label:
id: CommandLabel
text: 'cmd: '
#text_size: root.width, None
size: self.texture_size
text_size: self.size
halign: 'left'
valign: 'top'
GridLayout:
id: exifGrid
cols: 2
size_hint: (0.3, 1)
row_force_default: True
row_default_height: 28
#padding: 10, 10
Label:
text: 'Speed: '
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
TextInput:
id: SpeedInput
text: '50'
multiline: False
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
on_text_validate: root.setSpeed(self.text)
Label:
text: 'Video Width'
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
TextInput:
id: WidthInput
text: '960'
multiline: False
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
on_text_validate: root.setVideoWidth(self.text)
Label:
text: 'Video Height'
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
TextInput:
id: HeightInput
text: '720'
multiline: False
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
on_text_validate: root.setVideoHeight(self.text)
Label:
text: 'Status: '
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
id: StatusLabel
text: 'Not Connected'
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
text: 'Height: '
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
id: HeightLabel
text: '0'
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
text: 'Battery: '
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
id: BatteryLabel
text: '100%'
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
text: 'Flight Time: '
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
id: FlighttimeLabel
text: '0'
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
text: 'Temperature: '
size_hint_x: 0.2
text_size: self.size
halign: 'left'
valign: 'middle'
Label:
id: TempLabel
text: ' '
size_hint_x: 0.3
text_size: self.size
halign: 'left'
valign: 'middle'
BoxLayout:
orientation: 'horizontal'
size_hint_y: 1
BoxLayout:
orientation: 'vertical'
Button:
id: CircleLeftButton
text: 'Circle Left'
on_press: root.sendRcControl(-1, 1, 0, 1, 'CircleLeft')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
Button:
id: UpButton
text: 'Up'
on_press: root.sendRcControl(0, 0, 1, 0, 'Up')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
BoxLayout:
orientation: 'horizontal'
Button:
id: CCWButton
text: 'CCW Rotate'
on_press: root.sendRcControl(0, 0, 0, -1, 'CCW')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
Button:
id: CWButton
text: 'CW Rotate'
on_press: root.sendRcControl(0, 0, 0, 1, 'CW')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
Button:
id: DownButton
text: 'Down'
on_press: root.sendRcControl(0, 0, -1, 0, 'Down')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
BoxLayout:
orientation: 'vertical'
Button:
id: CircleRightButton
text: 'Circle Right'
on_press: root.sendRcControl(1, 1, 0, -1, 'CircleRight')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
Button:
id: ForwardButton
text: 'Forward'
on_press: root.sendRcControl(0, 1, 0, 0, 'Forward')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
BoxLayout:
orientation: 'horizontal'
Button:
id: LeftButton
text: 'Left'
on_press: root.sendRcControl(-1, 0, 0, 0, 'Left')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
Button:
id: RightButton
text: 'Right'
on_press: root.sendRcControl(1, 0, 0, 0, 'Right')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')
Button:
id: BackwardButton
text: 'Backward'
on_press: root.sendRcControl(0, -1, 0, 0, 'Backward')
on_release: root.sendRcControl(0, 0, 0, 0, 'Stop')