From e24126b64ff890c055956e53f07309bb46633c13 Mon Sep 17 00:00:00 2001 From: gac-bernina Date: Tue, 27 Aug 2024 08:39:07 +0200 Subject: [PATCH] delta and gamma behave now like seperate motors --- script/devices/RobotBernina.py | 18 ++++-------------- 1 file changed, 4 insertions(+), 14 deletions(-) diff --git a/script/devices/RobotBernina.py b/script/devices/RobotBernina.py index 7e0adda..ca34ee5 100644 --- a/script/devices/RobotBernina.py +++ b/script/devices/RobotBernina.py @@ -215,22 +215,12 @@ class RobotBernina(RobotTCP): rz = math.asin(-math.sin(ry)*math.sin(rx)*math.sqrt(1/(math.cos(rx)**2+(math.sin(ry)*math.sin(rx))**2))) rx, ry, rz = self.rad2deg([rx, ry, rz]) #end new try - - #Necessary for delta or gamma larger 90 - if self.rad2deg(delta) > 90: - rz = 180-rz + print rz + #Necessary to keep detector orientation for gamma larger 90 if self.rad2deg(gamma) > 90: rz = 180-rz - - # New try: first gamme - #ry = gamma - #rx = -math.acos(math.cos(delta)*math.cos(gamma)/math.cos(ry)) - #rz = -math.asin(-math.sin(-math.sin(ry)*math.sin(rx)*math.sqrt(1/(math.cos(rx)**2+(math.sin(ry)*math.sin(rx))**2)))) - #rx, ry, rz = self.rad2deg([rx, ry, rz]) - # End new try - - #rz = -math.asin(-math.sin(-math.sin(gamma)*math.sin(-delta)*math.sqrt(1/(math.cos(-delta)**2+(math.sin(gamma)*math.sin(-delta))**2)))) - #rx, ry, rz = self.rad2deg([-delta,+gamma, rz]) + if self.rad2deg(delta) > 90: + rz = -rz if abs(rz//180) > 0: rz = rz - (rz+180)//360*360