diff --git a/robosuite/models/robots/manipulators/legged_manipulator_model.py b/robosuite/models/robots/manipulators/legged_manipulator_model.py index d2da70940b..b1c6b00625 100644 --- a/robosuite/models/robots/manipulators/legged_manipulator_model.py +++ b/robosuite/models/robots/manipulators/legged_manipulator_model.py @@ -35,6 +35,12 @@ def _remove_joint_actuation(self, part_name): parent_body = find_parent(self.actuator, motor) parent_body.remove(motor) self._actuators.remove(motor.get("name").replace(self.naming_prefix, "")) + for fixed in self.tendon.findall(".//fixed"): + for joint in fixed.findall(".//joint"): + if part_name in joint.get("joint"): + parent_body = find_parent(self.tendon, fixed) + parent_body.remove(fixed) + break def _remove_free_joint(self): # remove freejoint diff --git a/robosuite/robots/legged_robot.py b/robosuite/robots/legged_robot.py index e48e496d46..8d89431b5d 100644 --- a/robosuite/robots/legged_robot.py +++ b/robosuite/robots/legged_robot.py @@ -186,9 +186,10 @@ def control(self, action, policy_step=False): for part_name, applied_action in applied_action_dict.items(): applied_action_low = self.sim.model.actuator_ctrlrange[self._ref_actuators_indexes_dict[part_name], 0] applied_action_high = self.sim.model.actuator_ctrlrange[self._ref_actuators_indexes_dict[part_name], 1] - applied_action = np.clip(applied_action, applied_action_low, applied_action_high) - - self.sim.data.ctrl[self._ref_actuators_indexes_dict[part_name]] = applied_action + actuator_indexes = self._ref_actuators_indexes_dict[part_name] + actuator_gears = self.sim.model.actuator_gear[actuator_indexes, 0] + applied_action = np.clip(applied_action / actuator_gears, applied_action_low, applied_action_high) + self.sim.data.ctrl[actuator_indexes] = applied_action # If this is a policy step, also update buffers holding recent values of interest if policy_step: