-
Notifications
You must be signed in to change notification settings - Fork 249
Closed
Description
The following test creates a fixed root and a child link. The child link is given a mass of 1.5 but ModelBuilder reports a mass of 0.01.
I believe something is not right with inertia so this is worth looking at as well. I expect body_inertia to be a diagonal matrix with 0.02 on the diagonal but these values are not present in individual_builder.body_inertia[0]
The test may be added to test_import_mjcf.py.
def test_mass(self):
"""Test that mass parameters can be parsed from mjcf"""
mjcf = """<?xml version="1.0" ?>
<mujoco model="myart">
<worldbody>
<!-- Root body (fixed to world) -->
<body name="root" pos="0 0 0">
<!-- First child link with prismatic joint along x -->
<body name="link1" pos="0.0 -0.5 0">
<joint name="joint1" type="slide" axis="1 0 0" range="-50.5 50.5"/>
<inertial pos="0 0 0" mass="1.5" diaginertia="0.02 0.02 0.02"/>
</body>
</body>
</worldbody>
</mujoco>
"""
individual_builder = newton.ModelBuilder()
SolverMuJoCo.register_custom_attributes(individual_builder)
individual_builder.add_mjcf(mjcf)
# The mass should be 1.5 but it is reported as 0.01
print(individual_builder.body_mass)
Reactions are currently unavailable
Metadata
Metadata
Assignees
Labels
No labels
Type
Projects
Status
Done