diff --git a/invesalius/data/bases.py b/invesalius/data/bases.py index dad0aa1..8ccfb87 100644 --- a/invesalius/data/bases.py +++ b/invesalius/data/bases.py @@ -284,8 +284,8 @@ class transform_tracker_to_robot(object): ) M_tracker_in_robot = transform_tracker_to_robot.M_tracker_to_robot @ M_tracker - angles_as_deg, translate = dco.transformation_matrix_to_coordinates(M_tracker_in_robot, axes='rxyz') - #TODO: check this with robot - tracker_in_robot = list(translate) + list(angles_as_deg) + _, _, angles, translate, _ = tr.decompose_matrix(M_tracker_in_robot) + tracker_in_robot = [translate[0], translate[1], translate[2], \ + np.degrees(angles[2]), np.degrees(angles[1]), np.degrees(angles[0])] return tracker_in_robot diff --git a/invesalius/data/elfin_processing.py b/invesalius/data/elfin_processing.py index 41b0202..c6d9182 100644 --- a/invesalius/data/elfin_processing.py +++ b/invesalius/data/elfin_processing.py @@ -20,6 +20,7 @@ import numpy as np import cv2 from time import time +import invesalius.data.transformations as tr import invesalius.data.coregistration as dcr import invesalius.data.coordinates as dco import invesalius.constants as const @@ -174,9 +175,11 @@ class TrackerProcessing: axes='rzyx', ) m_robot_new = M_current_head @ m_change_robot_to_head - angles_as_deg, translate = dco.transformation_matrix_to_coordinates(m_robot_new, axes='rzyx') - #TODO: check this with robot - return list(translate) + list(angles_as_deg) + _, _, angles, translate, _ = tr.decompose_matrix(m_robot_new) + angles = np.degrees(angles) + + return m_robot_new[0, -1], m_robot_new[1, -1], m_robot_new[2, -1], angles[0], angles[1], \ + angles[2] def estimate_head_center(self, tracker, current_head): """ -- libgit2 0.21.2