From 68f4082b5d3264079df803369bf5320b9439593d Mon Sep 17 00:00:00 2001 From: gac-S_Changer Date: Mon, 10 Jul 2017 13:49:29 +0200 Subject: [PATCH] Script execution --- script/setup/Layout.py | 10 +++++++++- 1 file changed, 9 insertions(+), 1 deletion(-) diff --git a/script/setup/Layout.py b/script/setup/Layout.py index ee94d11..3086961 100644 --- a/script/setup/Layout.py +++ b/script/setup/Layout.py @@ -1,4 +1,4 @@ -PLATE_SIZE = 50 +PLATE_SIZE = 480 BLOCK_ROI_TOLERANCE = 12 #mm LED_TOLERANCE = 8 #mm Distance between LEDs = 18mm PUCK_SIZE = 65 @@ -51,6 +51,14 @@ class Puck: def __str__(self): return "Number: " + str(self.number) + "\nBlock: " + str(self.block) + "\nIndex: " + str(self.index) + "\nAngle: " + str(self.angle) + \ "\nCenter: " + str(self.center) + "\nLed Unipuck: " + str(self.led_uni) + "\nLed Minispine: " + str(self.led_mini) + + def match(self, x, y): + if math.hypot(x-self.led_uni[0], y-self.led_uni[1]) <= LED_TOLERANCE: + return "unipuck" + if math.hypot(x-self.led_mini[0], y-self.led_mini[1]) <= LED_TOLERANCE: + return "minispine" + return N one + _block_ids = []