Commit 004777bc825f005d9db8818fd8e19e716266ab8f
1 parent
44451842
Exists in
master
ENH: code
Showing
2 changed files
with
11 additions
and
10 deletions
Show diff stats
invesalius/data/coordinates.py
... | ... | @@ -458,7 +458,7 @@ def HybridCoord(trk_init, trck_id, ref_mode): |
458 | 458 | obj_tracker_in_robot = db.transform_tracker_2_robot().transformation_tracker_2_robot(coord_tracker[2]) |
459 | 459 | |
460 | 460 | if probe_tracker_in_robot is None: |
461 | - print("Getting raw tracker") | |
461 | + #print("Getting raw tracker") | |
462 | 462 | probe_tracker_in_robot = coord_tracker[0] |
463 | 463 | ref_tracker_in_robot = coord_tracker[1] |
464 | 464 | obj_tracker_in_robot = coord_tracker[2] | ... | ... |
invesalius/data/elfin_robot.py
... | ... | @@ -126,10 +126,12 @@ class TrackerProcessing: |
126 | 126 | |
127 | 127 | return versorfator |
128 | 128 | |
129 | - def arcmotion(self, actual_point, pc, coord_inv): | |
129 | + def arcmotion(self, actual_point, coord_head, coord_inv): | |
130 | 130 | |
131 | 131 | p1 = coord_inv |
132 | 132 | |
133 | + pc = coord_head[0], coord_head[1], coord_head[2], coord_inv[3], coord_inv[4], coord_inv[5] | |
134 | + | |
133 | 135 | versorfator1_calculado = self.Versores(pc,actual_point) |
134 | 136 | init_ext_point = actual_point[0]+versorfator1_calculado[0],\ |
135 | 137 | actual_point[1]+versorfator1_calculado[1],\ |
... | ... | @@ -281,17 +283,17 @@ class ControlRobot(threading.Thread): |
281 | 283 | self.coord_inv_old = coord_inv |
282 | 284 | else: |
283 | 285 | #self.trck_init_robot.SendCoordinates(coord_inv, const.MOTIONS["normal"]) |
284 | - if self.process_tracker.correction_distance_calculation_target(coord_inv, coord_robot_raw) < 100 and not self.arcmotion_flag: | |
286 | + distance_target = self.process_tracker.correction_distance_calculation_target(coord_inv, coord_robot_raw) | |
287 | + if distance_target < 100 and not self.arcmotion_flag: | |
285 | 288 | self.trck_init_robot.SendCoordinates(coord_inv, const.MOTIONS["normal"]) |
286 | 289 | |
287 | - elif self.process_tracker.correction_distance_calculation_target(coord_inv, coord_robot_raw) >= 100 or self.arcmotion_flag: | |
290 | + elif distance_target >= 100 or self.arcmotion_flag: | |
288 | 291 | actual_point = coord_robot_raw |
289 | 292 | if not self.arcmotion_flag: |
290 | 293 | coord_head = self.process_tracker.estimate_head_center(self.tracker, |
291 | 294 | current_ref_filtered).tolist() |
292 | - pc = coord_head[0], coord_head[1], coord_head[2], coord_inv[3], coord_inv[4], coord_inv[ | |
293 | - 5] | |
294 | - self.target_linearout, self.target_arc = self.process_tracker.arcmotion(coord_robot_raw, pc, | |
295 | + | |
296 | + self.target_linearout, self.target_arc = self.process_tracker.arcmotion(coord_robot_raw, coord_head, | |
295 | 297 | coord_inv) |
296 | 298 | self.arcmotion_flag = True |
297 | 299 | self.arcmotion_step_flag = const.MOTIONS["linear out"] |
... | ... | @@ -305,9 +307,8 @@ class ControlRobot(threading.Thread): |
305 | 307 | elif self.arcmotion_flag and self.arcmotion_step_flag == const.MOTIONS["arc"]: |
306 | 308 | coord_head = self.process_tracker.estimate_head_center(self.tracker, |
307 | 309 | current_ref_filtered).tolist() |
308 | - pc = coord_head[0], coord_head[1], coord_head[2], coord_inv[3], coord_inv[4], coord_inv[ | |
309 | - 5] | |
310 | - _, new_target_arc = self.process_tracker.arcmotion(coord_robot_raw, pc, | |
310 | + | |
311 | + _, new_target_arc = self.process_tracker.arcmotion(coord_robot_raw, coord_head, | |
311 | 312 | coord_inv) |
312 | 313 | if np.allclose(np.array(new_target_arc[3:-1]), np.array(self.target_arc[3:-1]), 0, 1): |
313 | 314 | None | ... | ... |