From 3572d5bd998152bb47feb0f73b1d238342e757e8 Mon Sep 17 00:00:00 2001 From: Mohamed Fazil Date: Thu, 1 Sep 2022 17:48:42 -0700 Subject: [PATCH] Fix broken APIs in Command groups after contact model addition in stretch_body The contact_thresh_N, contact_thresh_pos_N and contact_thresh_neg_N argument is deprecated by removing the suffix '_N' with all the move_to(),move_by(), translate_by() and rotate_by() APIs that is associated with stepper motors after the new contatc models feature introduced to the stretch_body. --- stretch_core/nodes/command_groups.py | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) diff --git a/stretch_core/nodes/command_groups.py b/stretch_core/nodes/command_groups.py index b7f23a8..6e7ad40 100644 --- a/stretch_core/nodes/command_groups.py +++ b/stretch_core/nodes/command_groups.py @@ -347,8 +347,8 @@ class ArmCommandGroup(SimpleCommandGroup): robot.arm.move_by(extension_error_m, v_m=self.goal['velocity'], a_m=self.goal['acceleration'], - contact_thresh_pos_N=self.goal['contact_threshold'], - contact_thresh_neg_N=-self.goal['contact_threshold'] \ + contact_thresh_pos=self.goal['contact_threshold'], + contact_thresh_neg=-self.goal['contact_threshold'] \ if self.goal['contact_threshold'] is not None else None) self.retracted = extension_error_m < 0.0 @@ -392,8 +392,8 @@ class LiftCommandGroup(SimpleCommandGroup): robot.lift.move_by(self.update_execution(robot_status)[1], v_m=self.goal['velocity'], a_m=self.goal['acceleration'], - contact_thresh_pos_N=self.goal['contact_threshold'], - contact_thresh_neg_N=-self.goal['contact_threshold'] \ + contact_thresh_pos=self.goal['contact_threshold'], + contact_thresh_neg=-self.goal['contact_threshold'] \ if self.goal['contact_threshold'] is not None else None) def update_execution(self, robot_status, **kwargs): @@ -556,17 +556,17 @@ class MobileBaseCommandGroup(SimpleCommandGroup): robot.base.translate_by(mobile_base_error_m, v_m=self.goal_translate_mobile_base['velocity'], a_m=self.goal_translate_mobile_base['acceleration'], - contact_thresh_N=self.goal_translate_mobile_base['contact_threshold']) + contact_thresh=self.goal_translate_mobile_base['contact_threshold']) elif mobile_base_error_rad is not None: robot.base.rotate_by(mobile_base_error_rad, v_r=self.goal_rotate_mobile_base['velocity'], a_r=self.goal_rotate_mobile_base['acceleration'], - contact_thresh_N=self.goal_rotate_mobile_base['contact_threshold']) + contact_thresh=self.goal_rotate_mobile_base['contact_threshold']) else: robot.base.translate_by(self.update_execution(robot_status)[1], v_m=self.goal['velocity'], a_m=self.goal['acceleration'], - contact_thresh_N=self.goal['contact_threshold']) + contact_thresh=self.goal['contact_threshold']) def update_execution(self, robot_status, **kwargs): success_callback = kwargs['success_callback'] if 'success_callback' in kwargs.keys() else None