diff --git a/invesalius/data/bases.py b/invesalius/data/bases.py index 8ccfb87..930a1b7 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, 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])] + # TODO: check this with robot + translation, angles_as_deg = dco.transformation_matrix_to_coordinates(M_tracker_in_robot, axes='rzyx') + tracker_in_robot = list(translation) + list(angles_as_deg) return tracker_in_robot diff --git a/invesalius/data/elfin_processing.py b/invesalius/data/elfin_processing.py index c6d9182..4fb6a02 100644 --- a/invesalius/data/elfin_processing.py +++ b/invesalius/data/elfin_processing.py @@ -175,11 +175,11 @@ class TrackerProcessing: axes='rzyx', ) m_robot_new = M_current_head @ m_change_robot_to_head - _, _, angles, translate, _ = tr.decompose_matrix(m_robot_new) - angles = np.degrees(angles) + #TODO: check this with robot + translation, angles_as_deg = dco.transformation_matrix_to_coordinates(m_robot_new, axes='sxyz') + new_robot_position = list(translation) + list(angles_as_deg) - return m_robot_new[0, -1], m_robot_new[1, -1], m_robot_new[2, -1], angles[0], angles[1], \ - angles[2] + return new_robot_position def estimate_head_center(self, tracker, current_head): """ -- libgit2 0.21.2