From 856446b8efef165195f77d17a39ada2f72bcdfb1 Mon Sep 17 00:00:00 2001 From: 0mkt <44606733+0mkt@users.noreply.github.com> Date: Mon, 23 Dec 2019 13:09:38 +0100 Subject: [PATCH] Fixed UndoToolTransformOnCursor method Now the method properly updates the TCP position when DetachingTool. --- src/Machina/RobotCursor.cs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/Machina/RobotCursor.cs b/src/Machina/RobotCursor.cs index 0ce66cf..34d6075 100644 --- a/src/Machina/RobotCursor.cs +++ b/src/Machina/RobotCursor.cs @@ -1327,7 +1327,7 @@ internal void UndoToolTransformOnCursor(RobotCursor cursor, Tool tool, RobotLogg { // TODO: at some point in the future, check for translationFirst here Rotation newRot = Rotation.Combine(cursor.rotation, Rotation.Inverse(tool.TCPOrientation)); // postmultiplication by the inverse rotation - Vector worldVector = Vector.Rotation(tool.TCPPosition, cursor.rotation); + Vector worldVector = Vector.Rotation(tool.TCPPosition, newRot); Vector newPos = cursor.position - worldVector; cursor.prevPosition = cursor.position;