Browse Source

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.
pull/77/head
Mohamed Fazil 2 years ago
parent
commit
3572d5bd99
1 changed files with 7 additions and 7 deletions
  1. +7
    -7
      stretch_core/nodes/command_groups.py

+ 7
- 7
stretch_core/nodes/command_groups.py View File

@ -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

Loading…
Cancel
Save