-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathsubuway.py
624 lines (517 loc) · 20.9 KB
/
subuway.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
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
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
import cv2 as cv
from cv2 import aruco
import numpy as np
import glob
import time
print(cv.__version__)
print(np.__version__)
# We use 250 ID
aruco_dict = aruco.Dictionary_get(aruco.DICT_6X6_250)
# 1~4는 그냥 카메라 캘리브레이션을 위해 제작한 코드이므로 딱히 신경쓸 필요는 없을듯.
# 1. Once it generate the board we print the board and take with our camera.
def generateCharucoBoard():
board = aruco.CharucoBoard_create(7, 5, 0.04, 0.02, aruco_dict)
imboard = board.draw((2000, 2000))
cv.imwrite('charuco_board.tiff', imboard)
return board
# 2. If press 'c' capture current image from camrera, If press 'esc' finish the task
def getCharucoBoardImgfromCamera():
print("press esc to terminate")
print("press c to capture")
cap = cv.VideoCapture(0)
i = 1 #step
while (1):
# Take each frame
_, frame = cap.read()
# Convert BGR to HSV
frame = cv.resize(frame, None, fx=1, fy=1, interpolation=cv.INTER_CUBIC)
cv.imshow('output', frame)
k = cv.waitKey(5) & 0xFF
#press esc to terminate
if k == 27:
break
#press c to capture
#save our pictures in folder "calibpic"
if k == ord('c'):
workdir = "./calibpic/"
cv.imwrite(workdir + 'calibBoard'+str(i)+'.jpg', frame)
print('image' + str(i) + 'saved')
i = int(i) + 1
cv.destroyAllWindows()
# 3. We calibrate our camera to get camera matrix and distorsion vector
def calibrateFromCharucoBoardImage(board):
#get pictures in folder "calibpic"
workdir = "./calibpic/"
images = glob.glob(workdir + '*.jpg')
print(images)
print("POSE ESTIMATION STARTS:")
allCorners = []
allIds = []
decimator = 0
# SUB PIXEL CORNER DETECTION CRITERION
criteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 100, 0.00001)
for im in images:
print("=> Processing image {0}".format(im))
frame = cv.imread(im)
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
corners, ids, rejectedImgPoints = aruco.detectMarkers(gray, aruco_dict)
fixedcorners = []
# If we detect the corners from image
if len(corners) > 0:
# SUB PIXEL DETECTION
for corner in corners:
corner2 = cv.cornerSubPix(gray, corner, winSize=(3, 3), zeroZone=(-1, -1), criteria=criteria)
fixedcorners.append(corner2)
# InterpolateCornersCharuco return [1]:corners, [2]:Ids
CornerandIds = aruco.interpolateCornersCharuco(fixedcorners, ids, gray, board)
if CornerandIds[1] is not None and CornerandIds[2] is not None and len(CornerandIds[1]) > 3 and decimator % 1 == 0:
allCorners.append(CornerandIds[1])
allIds.append(CornerandIds[2])
decimator += 1
imsize = gray.shape
return allCorners, allIds, imsize
# 4. calibrate and get the vectors
def calibrate_camera(allCorners,allIds,imsize, board):
"""
Calibrates the camera using the dected corners.
"""
print("CAMERA CALIBRATION")
cameraMatrixInit = np.array([[ 1000., 0., imsize[0]/2.],
[ 0., 1000., imsize[1]/2.],
[ 0., 0., 1.]])
distCoeffsInit = np.zeros((5,1))
flags = (cv.CALIB_USE_INTRINSIC_GUESS + cv.CALIB_RATIONAL_MODEL + cv.CALIB_FIX_ASPECT_RATIO)
#flags = (cv2.CALIB_RATIONAL_MODEL)
(ret, camera_matrix, distortion_coefficients0,
rotation_vectors, translation_vectors,
stdDeviationsIntrinsics, stdDeviationsExtrinsics,
perViewErrors) = cv.aruco.calibrateCameraCharucoExtended(
charucoCorners=allCorners,
charucoIds=allIds,
board=board,
imageSize=imsize,
cameraMatrix=cameraMatrixInit,
distCoeffs=distCoeffsInit,
flags=flags,
criteria=(cv.TERM_CRITERIA_EPS & cv.TERM_CRITERIA_COUNT, 10000, 1e-9))
return ret, camera_matrix, distortion_coefficients0, rotation_vectors, translation_vectors
# 5. Dectect Id and Calculate the distance, rotation vector from aruco marker by camera
def detectMarker(ret, mtx, dist, rvecs, tvecs):
start = time.time()
cap = cv.VideoCapture(0)
i = 1 # step
while (1):
# wait for 1 seconds
if time.time() - start > 1:
break
# Take each frame
_, frame = cap.read()
# Convert BGR to HSV
frame = cv.resize(frame, None, fx=1, fy=1, interpolation=cv.INTER_CUBIC)
gray = cv.cvtColor(frame, cv.COLOR_BGR2GRAY)
parameters = aruco.DetectorParameters_create()
corners, ids, rejectedImgPoints = aruco.detectMarkers(gray, aruco_dict, parameters=parameters)
# SUB PIXEL DETECTION
criteria = (cv.TERM_CRITERIA_EPS + cv.TERM_CRITERIA_MAX_ITER, 100, 0.0001)
fixedCorners = []
for corner in corners:
corner2 = cv.cornerSubPix(gray, corner, winSize=(3, 3), zeroZone=(-1, -1), criteria=criteria)
fixedCorners.append(corner2)
frame_markers = aruco.drawDetectedMarkers(frame.copy(), fixedCorners, ids)
size_of_marker = 0.0285 # side lenght of the marker in meter
rvecs, tvecs, _obj = aruco.estimatePoseSingleMarkers(fixedCorners, size_of_marker, mtx, dist)
if tvecs is None:
cv.imshow('output', frame)
print("-----------------------------")
cv.waitKey(10)
return None, None, None, None
cv.imshow('output', frame_markers)
k = cv.waitKey(30) & 0xFF
# press esc to terminate
if k == 27:
break
cv.destroyAllWindows()
return ids, fixedCorners, rvecs, tvecs
# Send to server
def html_sending(s):
str1 = " "
str2 = str1.join(s)
str3 = "<!DOCTYPE html><html><head><title>hello</title></head><body><h2>" + str2 + "</h2></body></html>"
html_file = open('index.html', 'w')
html_file.write(str2)
html_file.close()
# Node and Route information data structure
class markerNode:
"""
Save marker data
Floor : current floor
Id : id of the marker
northConnectedNode : connected node which located in north
southConnectedNode : connected node which located in south
westConnectedNode : connected node which located in west
eastConnectedNode : connected node which located in east
nextNode : next node for the route
1. Destination Node
For elevator, toilet, exit etc
Use Id from 1~50
2. Marker Node
For the way point
Use Id from over 50
"""
def __init__(self, name, floor, id, north = None, south = None, west = None, east = None):
self.name = name
self.floor = floor
self.id = id
self.northConnectedNode = north
self.southConnectedNode = south
self.westConnectedNode = west
self.eastConnectedNode = east
self.next = None
def update(self, north = None, south = None, west = None, east = None):
self.northConnectedNode = north
self.southConnectedNode = south
self.westConnectedNode = west
self.eastConnectedNode = east
self.next = None
class markerGraph:
"""
Fixed map graph for Seolleung station
Not made yet
"""
def __init__(self):
self.size = 1000
class routeData:
"""
Stack the ordered route information
"""
def __init__(self, markerNode = None):
self.head = markerNode
self.routeLength = 1
def insertFirstNode(self, firstNode):
new_node = firstNode
temp_node = self.head
self.head = new_node
self.head.next = temp_node
self.routeLength += 1
def insertLast(self, insertNode):
node = self.head
while True:
if node.next == None:
break
node = node.next
new_node = insertNode
node.next = new_node
self.routeLength += 1
def selectNode(self, num):
if self.routeLength < num:
print("Overflow")
return
node = self.head
count = 0
while count < num:
node = node.next
count += 1
return node
def deleteHead(self):
node = self.head
self.head = node.next
del node
self.routeLength -= 1
def length(self):
return str(self.routeLength)
def createB2mapInSeooleung():
"""
Seolleung station marker nodes in B2 Floor
:return: way points in Seolleung station B2
"""
#railWay marker
global railWay_7_4_Seolleung_B2
global railWay_8_1_Seolleung_B2, railWay_8_2_Seolleung_B2, railWay_8_3_Seolleung_B2, railWay_8_4_Seolleung_B2
global railWay_9_1_Seolleung_B2
# blockWay marker
global blockWay_51_Seolleung_B2, blockWay_52_Seolleung_B2
# elevator marker
global elevator_2_Seolleung_B2
# railWay marker
railWay_7_4_Seolleung_B2 = markerNode("Seolleung_7_4_B2", 2, 1)
railWay_8_1_Seolleung_B2 = markerNode("Seolleung_8_1_B2", 2, 2)
railWay_8_2_Seolleung_B2 = markerNode("Seolleung_8_2_B2", 2, 2)
railWay_8_3_Seolleung_B2 = markerNode("Seolleung_8_3_B2", 2, 2)
railWay_8_4_Seolleung_B2 = markerNode("Seolleung_8_4_B2", 2, 2)
railWay_9_1_Seolleung_B2 = markerNode("Seolleung_9_1_B2", 2, 2)
# blockWay marke
blockWay_51_Seolleung_B2 = markerNode("Seolleung_51_B2", 2, 51)
blockWay_52_Seolleung_B2 = markerNode("Seolleung_52_B2", 2, 52)
# elevator marker
elevator_2_Seolleung_B2 = markerNode("Seolleung_EV_2_B2", 2, 3)
#update
railWay_7_4_Seolleung_B2.update(north = blockWay_51_Seolleung_B2, east = railWay_8_1_Seolleung_B2)
railWay_8_1_Seolleung_B2.update(west = railWay_7_4_Seolleung_B2, east = railWay_8_2_Seolleung_B2)
railWay_8_2_Seolleung_B2.update(west = railWay_8_1_Seolleung_B2, east = railWay_8_3_Seolleung_B2)
railWay_8_3_Seolleung_B2.update(west = railWay_8_2_Seolleung_B2, east = railWay_8_4_Seolleung_B2)
railWay_8_4_Seolleung_B2.update(west = railWay_8_3_Seolleung_B2, east = railWay_9_1_Seolleung_B2)
railWay_9_1_Seolleung_B2.update(west = railWay_8_4_Seolleung_B2)
blockWay_51_Seolleung_B2.update(north = blockWay_52_Seolleung_B2, west = railWay_7_4_Seolleung_B2)
blockWay_52_Seolleung_B2.update(south = blockWay_51_Seolleung_B2, east = elevator_2_Seolleung_B2)
elevator_2_Seolleung_B2.update(west = blockWay_52_Seolleung_B2)
def createB3mapInSeooleung():
"""
Seolleung station marker nodes in B3 Floor
:return: way points in Seolleung station B3
"""
# railWay marker
global railWay_2_4_Seolleung_B3
# blockWay marker
global blockWay_53_Seolleung_B3, blockWay_54_Seolleung_B3, blockWay_55_Seolleung_B3
# elevator marker
global elevator_2_Seolleung_B3
# railWay marker
railWay_2_4_Seolleung_B3 = markerNode("Seolleung_2_4_B3", 3, 4)
# blockWay marker
blockWay_53_Seolleung_B3 = markerNode("Seolleung_53_B3", 3, 53)
blockWay_54_Seolleung_B3 = markerNode("Seolleung_54_B3", 3, 54)
blockWay_55_Seolleung_B3 = markerNode("Seolleung_55_B3", 3, 55)
# elevator marker
elevator_2_Seolleung_B3 = markerNode("Seolleung_EV_2_B3", 3, 3)
#update
railWay_2_4_Seolleung_B3.update(east=blockWay_55_Seolleung_B3)
blockWay_53_Seolleung_B3.update(west=blockWay_54_Seolleung_B3, south=elevator_2_Seolleung_B3)
blockWay_54_Seolleung_B3.update(east=blockWay_53_Seolleung_B3, north=blockWay_55_Seolleung_B3)
blockWay_55_Seolleung_B3.update(west=railWay_2_4_Seolleung_B3, south=blockWay_54_Seolleung_B3)
elevator_2_Seolleung_B3.update(north = blockWay_53_Seolleung_B3)
def createB1mapInHanti():
"""
Hanti station marker nodes in B4 Floor
:return: way points in Hanti station B4
"""
#railWay marker
#blockWay marker
global blockWay_59_Hanti_B1
# elevator marker
global elevator_1_Hanti_B1, elevator_2_Hanti_B1
# blockWay marker
blockWay_59_Hanti_B1 = markerNode("Hanti_59_B1", 1, 59)
# elevator marker
elevator_1_Hanti_B1 = markerNode("Hanti_EV_1_B1", 1, 7)
elevator_2_Hanti_B1 = markerNode("Hanti_EV_2_B1", 1, 8)
#update
blockWay_59_Hanti_B1.update(south = elevator_2_Hanti_B1, east = elevator_1_Hanti_B1)
elevator_1_Hanti_B1.update(west = blockWay_59_Hanti_B1)
elevator_2_Hanti_B1.update(north = blockWay_59_Hanti_B1)
def createB4mapInHanti():
"""
Hanti station marker nodes in B4 Floor
:return: way points in Hanti station B4
"""
#railWay marker
global railWay_2_4_Hanti_B4
global railWay_3_1_Hanti_B4, railWay_3_2_Hanti_B4
# blockWay marker
global blockWay_56_Hanti_B4, blockWay_57_Hanti_B4, blockWay_58_Hanti_B4
# elevator marker
global elevator_1_Hanti_B4
# railWay marker
railWay_2_4_Hanti_B4 = markerNode("Hanti_2_4_B4", 4, 4)
railWay_3_1_Hanti_B4 = markerNode("Hanti_3_1_B4", 4, 5)
railWay_3_2_Hanti_B4 = markerNode("Hanti_3_2_B4", 4, 6)
#blockWay marker
blockWay_56_Hanti_B4 = markerNode("Hanti_56_B4", 4, 56)
blockWay_57_Hanti_B4 = markerNode("Hanti_57_B4", 4, 57)
blockWay_58_Hanti_B4 = markerNode("Hanti_58_B4", 4, 58)
# elevator marker
elevator_1_Hanti_B4 = markerNode("Hanti_EV_1_B4", 4, 7)
#update
railWay_2_4_Hanti_B4.update(west = railWay_3_1_Hanti_B4)
railWay_3_1_Hanti_B4.update(west = railWay_3_2_Hanti_B4, east = railWay_2_4_Hanti_B4)
railWay_3_2_Hanti_B4.update(north = blockWay_56_Hanti_B4, east = railWay_3_1_Hanti_B4)
blockWay_56_Hanti_B4.update(south = railWay_3_2_Hanti_B4, west = blockWay_57_Hanti_B4)
blockWay_57_Hanti_B4.update(north = blockWay_58_Hanti_B4, east = blockWay_56_Hanti_B4)
blockWay_58_Hanti_B4.update(south = blockWay_57_Hanti_B4, west = elevator_1_Hanti_B4)
elevator_1_Hanti_B4.update(east = blockWay_58_Hanti_B4)
def createRouteForTransfer():
# Seolleung station B2 way point
global routeDataList
routeDataList = routeData(railWay_9_1_Seolleung_B2)
routeDataList.insertLast(railWay_8_4_Seolleung_B2)
routeDataList.insertLast(railWay_8_3_Seolleung_B2)
routeDataList.insertLast(railWay_8_2_Seolleung_B2)
routeDataList.insertLast(railWay_8_1_Seolleung_B2)
routeDataList.insertLast(railWay_7_4_Seolleung_B2)
routeDataList.insertLast(blockWay_51_Seolleung_B2)
routeDataList.insertLast(blockWay_52_Seolleung_B2)
routeDataList.insertLast(elevator_2_Seolleung_B2)
routeDataList.insertLast(elevator_2_Seolleung_B3)
routeDataList.insertLast(blockWay_53_Seolleung_B3)
routeDataList.insertLast(blockWay_54_Seolleung_B3)
routeDataList.insertLast(blockWay_55_Seolleung_B3)
routeDataList.insertLast(railWay_2_4_Seolleung_B3)
routeDataList.insertLast(railWay_2_4_Hanti_B4)
routeDataList.insertLast(railWay_3_1_Hanti_B4)
routeDataList.insertLast(railWay_3_2_Hanti_B4)
routeDataList.insertLast(blockWay_56_Hanti_B4)
routeDataList.insertLast(blockWay_57_Hanti_B4)
routeDataList.insertLast(blockWay_58_Hanti_B4)
routeDataList.insertLast(elevator_1_Hanti_B4)
routeDataList.insertLast(elevator_1_Hanti_B1)
routeDataList.insertLast(blockWay_59_Hanti_B1)
routeDataList.insertLast(elevator_2_Hanti_B1)
class currentLocation:
def __init__(self, floor, prev = None, cur = None, next = None):
self.floor = floor
self.prev = prev
self.cur = cur
self.next = next
def updateFloor(self, floor):
self.floor = floor
def updateLocation(self, next):
self.prev = self.cur
self.cur = self.next
self.next = next
def findMarkerLocation(findId):
node = routeDataList.head
while True:
if node.id == findId:
return node
node = node.next
if node.next == None:
print("Not found")
return
def dataForNextNode(currentLoc, mode):
"""
get the data to go to next node
:param node: Get the current node data
:param mode:
0 : Nothing, just go forward
1 : Riding elevator, change to E.V. sign
2 : Riding subway, change to wait sign
3 : Etc, depending on the situation
:return: string list data which will be sent to web
"""
prev = currentLoc.prev
cur = currentLoc.cur
next = currentLoc.next
stringList = []
if mode == 0:
if cur.northConnectedNode == next:
if cur.southConnectedNode == prev:
stringList.append("F")
stringList.append("Go_Straight")
elif cur.eastConnectedNode == prev:
stringList.append("R")
stringList.append("Turn_Right")
else:
stringList.append("L")
stringList.append("Turn_Left")
elif cur.westConnectedNode == next:
if cur.eastConnectedNode == prev:
stringList.append("F")
stringList.append("Go_Straight")
elif cur.northConnectedNode == prev:
stringList.append("R")
stringList.append("Turn_Right")
else:
stringList.append("L")
stringList.append("Turn_Left")
elif cur.southConnectedNode == next:
if cur.northConnectedNode == prev:
stringList.append("F")
stringList.append("Go_Straight")
elif cur.westConnectedNode == prev:
stringList.append("R")
stringList.append("Turn_Right")
else:
stringList.append("L")
stringList.append("Turn_Left")
elif cur.eastConnectedNode == next:
if cur.westConnectedNode == prev:
stringList.append("F")
stringList.append("Go_Straight")
elif cur.southConnectedNode == prev:
stringList.append("R")
stringList.append("Turn_Right")
else:
stringList.append("L")
stringList.append("Turn_Left")
stringList.append("F")
elif mode == 1:
if next == None:
stringList.append("E")
stringList.append("FINISH")
stringList.append("E")
return stringList
stringList.append("E")
stringList.append("Go_to_B" + str(next.floor) + "_floor")
stringList.append("E")
elif mode == 2:
stringList.append("S")
stringList.append("Get_off_at_" + str(next.name) + "_platform")
stringList.append("S")
elif mode == 3:
if cur == railWay_9_1_Seolleung_B2:
stringList.append("L")
stringList.append("Turn_Left")
stringList.append("F")
elif cur == railWay_7_4_Seolleung_B2:
stringList.append("R")
stringList.append("Turn_Right_Go_Straight_Turn_Right")
stringList.append("F")
elif cur == elevator_2_Seolleung_B3:
stringList.append("F")
stringList.append("Get_off_EV_Go_Straight")
stringList.append("F")
elif cur == railWay_2_4_Hanti_B4:
stringList.append("L")
stringList.append("Get_off_Subway_Turn_Left")
stringList.append("F")
elif cur == elevator_1_Hanti_B1:
stringList.append("L")
stringList.append("Get_off_EV_Turn_Left")
stringList.append("F")
return stringList
#main function
if __name__ == '__main__':
charucoBoard = generateCharucoBoard()
getCharucoBoardImgfromCamera()
allCorners, allIds, imsize = calibrateFromCharucoBoardImage(charucoBoard)
ret, mtx, dist, rvecs, tvecs = calibrate_camera(allCorners, allIds, imsize, charucoBoard)
createB2mapInSeooleung()
createB3mapInSeooleung()
createB1mapInHanti()
createB4mapInHanti()
createRouteForTransfer()
IdList = [2, 2, 2, 2, 2, 1, 51, 52, 3, 3, 53, 54, 55, 4, 4, 5, 6, 56, 57, 58, 7, 7, 59, 8]
modeList = [3, 0, 0, 0, 0, 3, 0, 0, 1, 3, 0, 0, 0, 2, 3, 0, 0, 0, 0, 0, 1, 3, 0, 1]
i = 0
while True:
if i == 8:
print("")
if routeDataList.routeLength == 0:
print("The end")
break
#First recognization
ids, fixedCorners, rvecs, tvecs = detectMarker(ret, mtx, dist, rvecs, tvecs)
if ids == None:
print("Can't recognize")
continue
else:
currentNode = findMarkerLocation(ids)
if currentNode is None:
print("Wrong way")
continue
mode = modeList[i]
if i == 0:
currentLocation = currentLocation(currentNode.floor, cur = currentNode, next = currentNode.next)
else:
currentLocation.updateLocation(currentNode.next)
if currentLocation.prev.floor != currentLocation.cur.floor:
currentLocation.updateFloor(currentLocation.cur.floor)
stringList = dataForNextNode(currentLocation, mode)
print("step " + str(i))
stringList.append(str(i))
print(stringList)
html_sending(stringList)
routeDataList.deleteHead()
print("Wait a moment")
cv.waitKey(1000)
print("NEXT")
i += 1