Skip to content

Commit cb25aae

Browse files
Fix duplicated inertial property + free joint issue (#765)
* Fix duplicated inertial property issue * skip explicit torso action is >1D * Format * Don't add freejoints for add_mobile_base
1 parent 6ea97b2 commit cb25aae

File tree

1 file changed

+6
-2
lines changed

1 file changed

+6
-2
lines changed

robosuite/models/robots/robot_model.py

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -202,9 +202,13 @@ def add_mobile_base(self, mobile_base: MobileBaseModel):
202202
mount_support = find_elements(
203203
root=self.worldbody, tags="body", attribs={"name": mobile_base.correct_naming("support")}, return_first=True
204204
)
205-
# Move ALL content from robot0_base to the mobile base support (arms, geoms, inertial)
205+
# Move content from robot0_base to the mobile base support (arms, geoms), but skip inertial
206+
# elements and freejoints to avoid conflicts and MuJoCo constraints
206207
for child in all_root_children:
207-
mount_support.append(deepcopy(child))
208+
# Skip inertial elements to avoid duplicates with mobile base's own inertial
209+
# Skip freejoints since they can only be used at top level
210+
if child.tag not in ["inertial", "freejoint"]:
211+
mount_support.append(deepcopy(child))
208212
root.remove(child)
209213
self.merge_assets(mobile_base)
210214
for one_actuator in mobile_base.actuator:

0 commit comments

Comments
 (0)