From aeb03abe7907c6f2b9fdffc9c8fa75889c0a37db Mon Sep 17 00:00:00 2001 From: Renan Date: Thu, 28 Oct 2021 17:13:20 +0300 Subject: [PATCH] ADD: function to stop and reset motion state --- invesalius/navigation/robot.py | 9 ++++++--- 1 file changed, 6 insertions(+), 3 deletions(-) diff --git a/invesalius/navigation/robot.py b/invesalius/navigation/robot.py index bf9ed80..97b0ea5 100644 --- a/invesalius/navigation/robot.py +++ b/invesalius/navigation/robot.py @@ -175,6 +175,11 @@ class ControlRobot(threading.Thread): return coord_raw, coord_robot_raw, markers_flag + def robot_motion_reset(self): + self.trck_init_robot.StopRobot() + self.arc_motion_flag = False + self.arc_motion_step_flag = const.ROBOT_MOTIONS["normal"] + def robot_move_decision(self, distance_target, new_robot_coordinates, current_robot_coordinates, current_head_filtered): """ There are two types of robot movements. @@ -277,9 +282,7 @@ class ControlRobot(threading.Thread): if not self.robot_target_queue.empty(): self.robot_tracker_flag, self.m_change_robot_to_head = self.robot_target_queue.get_nowait() - self.trck_init_robot.StopRobot() - self.arc_motion_flag = False - self.arc_motion_step_flag = const.ROBOT_MOTIONS["normal"] + self.robot_motion_reset() self.robot_target_queue.task_done() if not self.object_at_target_queue.empty(): -- libgit2 0.21.2