@@ -35,7 +35,7 @@ def __init__(self):
35
35
36
36
self .client = None
37
37
38
- def read_status (self ): #########################################
38
+ def read_status (self ):
39
39
# Get device status tree
40
40
message = {
41
41
"kind" : "rpc_request" ,
@@ -59,7 +59,7 @@ def read_status(self): #########################################
59
59
# Return status as json object: status[""]
60
60
return status_tree
61
61
62
- def read_sensor (self , id ): #########################################
62
+ def read_sensor (self , id ):
63
63
# Get sensor data
64
64
peripheral_str = self .api .get_info ('peripherals' , id )
65
65
mode = peripheral_str ['mode' ]
@@ -177,7 +177,7 @@ def unlock(self):
177
177
# No inherent return value
178
178
return print ("Triggered device unlock." )
179
179
180
- def reboot (self ): #########################################
180
+ def reboot (self ):
181
181
# Tell bot to reboot
182
182
# No inherent return value
183
183
reboot_message = {
@@ -193,7 +193,7 @@ def reboot(self): #########################################
193
193
self .broker_connect .publish (reboot_message )
194
194
return print ("Triggered device reboot." )
195
195
196
- def shutdown (self ): #########################################
196
+ def shutdown (self ):
197
197
# Tell bot to shutdown
198
198
# No inherent return value
199
199
shutdown_message = {
@@ -398,72 +398,7 @@ def off(self, id):
398
398
self .control_peripheral (id , 0 )
399
399
400
400
# TODO: sort_points(points, method)
401
- # Order group of points with method
402
- # Return ???
403
-
404
- # TODO: sort(points, method) --> API? --> order group of points according to chosen method
405
-
406
- # def sort(tray, tray_cell):
407
- # cell = tray_cell.upper()
408
- # seeder_needle_offset = 17.5
409
- # cell_spacing = 12.5
410
-
411
- # cells = {
412
- # "A1": {"label": "A1", "x": 0, "y": 0},
413
- # "A2": {"label": "A2", "x": 0, "y": 1},
414
- # "A3": {"label": "A3", "x": 0, "y": 2},
415
- # "A4": {"label": "A4", "x": 0, "y": 3},
416
- # "B1": {"label": "B1", "x": -1, "y": 0},
417
- # "B2": {"label": "B2", "x": -1, "y": 1},
418
- # "B3": {"label": "B3", "x": -1, "y": 2},
419
- # "B4": {"label": "B4", "x": -1, "y": 3},
420
- # "C1": {"label": "C1", "x": -2, "y": 0},
421
- # "C2": {"label": "C2", "x": -2, "y": 1},
422
- # "C3": {"label": "C3", "x": -2, "y": 2},
423
- # "C4": {"label": "C4", "x": -2, "y": 3},
424
- # "D1": {"label": "D1", "x": -3, "y": 0},
425
- # "D2": {"label": "D2", "x": -3, "y": 1},
426
- # "D3": {"label": "D3", "x": -3, "y": 2},
427
- # "D4": {"label": "D4", "x": -3, "y": 3}
428
- # }
429
-
430
- # # Checks
431
- # if tray["pointer_type"] != "ToolSlot":
432
- # print("Error: Seed Tray variable must be a seed tray in a slot")
433
- # return
434
- # elif cell not in cells:
435
- # print("Error: Seed Tray Cell must be one of **A1** through **D4**")
436
- # return
437
-
438
- # # Flip X offsets depending on pullout direction
439
- # flip = 1
440
- # if tray["pullout_direction"] == 1:
441
- # flip = 1
442
- # elif tray["pullout_direction"] == 2:
443
- # flip = -1
444
- # else:
445
- # print("Error: Seed Tray **SLOT DIRECTION** must be `Positive X` or `Negative X`")
446
- # return
447
-
448
- # # A1 coordinates
449
- # A1 = {
450
- # "x": tray["x"] - seeder_needle_offset + (1.5 * cell_spacing * flip),
451
- # "y": tray["y"] - (1.5 * cell_spacing * flip),
452
- # "z": tray["z"]
453
- # }
454
-
455
- # # Cell offset from A1
456
- # offset = {
457
- # "x": cell_spacing * cells[cell]["x"] * flip,
458
- # "y": cell_spacing * cells[cell]["y"] * flip
459
- # }
460
-
461
- # # Return cell coordinates
462
- # return {
463
- # "x": A1["x"] + offset["x"],
464
- # "y": A1["y"] + offset["y"],
465
- # "z": A1["z"]
466
- # }
401
+ # TODO: sort(points, method)
467
402
468
403
def soil_height (self ):
469
404
# Execute soil height scripts
@@ -495,42 +430,9 @@ def detect_weeds(self):
495
430
496
431
self .broker_connect .publish (detect_weeds_message )
497
432
498
- def calibrate_camera (self ): # TODO: fix "sequence_id"
499
- # Execute calibrate camera script
500
- # No inherent return value
501
- calibrate_message = {
502
- ** RPC_REQUEST ,
503
- "body" : {
504
- "kind" : "execute_script" ,
505
- "args" : {
506
- "label" : "camera-calibration"
507
- },
508
- "body" : {
509
- "kind" : "pair" ,
510
- "args" : {
511
- "label" : "CAMERA_CALIBRATION_easy_calibration" ,
512
- "value" : "\" TRUE\" "
513
- }
514
- }
515
- }
516
- }
517
-
518
- self .broker_connect .publish (calibrate_message )
519
-
520
- def photo_grid (self ): # TODO: fix "sequence_id"
521
- # Execute photo grid script
522
- # No inherent return value
523
- photo_grid_message = {
524
- ** RPC_REQUEST ,
525
- "body" : {
526
- "kind" : "execute" ,
527
- "args" : {
528
- "sequence_id" : 24372
529
- }
530
- }
531
- }
532
433
533
- self .broker_connect .publish (photo_grid_message )
434
+ # TODO: calibrate_camera()
435
+ # TODO: photo_grid()
534
436
535
437
def take_photo (self ):
536
438
# Take single photo
0 commit comments