From 3f2ae998f7217c05762f7b33c7b87ab389826c4c Mon Sep 17 00:00:00 2001 From: Runyu Ding Date: Wed, 18 Dec 2024 16:10:13 +0800 Subject: [PATCH] [fix] fix equality removal with actuator removal --- .../models/robots/manipulators/legged_manipulator_model.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/robosuite/models/robots/manipulators/legged_manipulator_model.py b/robosuite/models/robots/manipulators/legged_manipulator_model.py index b1c6b00625..f405b1d28e 100644 --- a/robosuite/models/robots/manipulators/legged_manipulator_model.py +++ b/robosuite/models/robots/manipulators/legged_manipulator_model.py @@ -41,6 +41,12 @@ def _remove_joint_actuation(self, part_name): parent_body = find_parent(self.tendon, fixed) parent_body.remove(fixed) break + # remove joint in equality + for equality in self.equality.findall(".//joint"): + # If either joint1 or joint2 is the joint we want to remove + if part_name in equality.get("joint1") or part_name in equality.get("joint2"): + parent_body = find_parent(self.equality, equality) + parent_body.remove(equality) def _remove_free_joint(self): # remove freejoint