|
29 | 29 | from newton.solvers import SolverMuJoCo |
30 | 30 |
|
31 | 31 |
|
32 | | -class TestImportMjcf(unittest.TestCase): |
| 32 | +class TestImportMjcfBasic(unittest.TestCase): |
33 | 33 | def test_humanoid_mjcf(self): |
34 | 34 | builder = newton.ModelBuilder() |
35 | 35 | builder.default_shape_cfg.ke = 123.0 |
@@ -610,6 +610,8 @@ def test_replace_3d_hinge_with_ball_joint(self): |
610 | 610 | # note we need to swap quaternion order wxyz -> xyzw |
611 | 611 | np.testing.assert_allclose(joint_x_p.q, [0, 0, 0.7071068, 0.7071068], atol=1e-6) |
612 | 612 |
|
| 613 | + |
| 614 | +class TestImportMjcfGeometry(unittest.TestCase): |
613 | 615 | def test_cylinder_shapes_preserved(self): |
614 | 616 | """Test that cylinder geometries are properly imported as cylinders, not capsules.""" |
615 | 617 | # Create MJCF content with cylinder geometry |
@@ -1829,6 +1831,8 @@ def test_single_mujoco_fixed_tendon_auto_springlength(self): |
1829 | 1831 | msg=f"Expected tendon_length0: {expected_tendon_length0}, Measured: {measured_tendon_length0}", |
1830 | 1832 | ) |
1831 | 1833 |
|
| 1834 | + |
| 1835 | +class TestImportMjcfSolverParams(unittest.TestCase): |
1832 | 1836 | def test_solimplimit_parsing(self): |
1833 | 1837 | """Test that solimplimit attribute is parsed correctly from MJCF.""" |
1834 | 1838 | mjcf = """<?xml version="1.0" ?> |
@@ -2902,6 +2906,8 @@ def test_default_inheritance(self): |
2902 | 2906 | else: |
2903 | 2907 | self.fail("Model should have mujoco.condim attribute") |
2904 | 2908 |
|
| 2909 | + |
| 2910 | +class TestImportMjcfActuatorsFrames(unittest.TestCase): |
2905 | 2911 | def test_actuatorfrcrange_parsing(self): |
2906 | 2912 | """Test that actuatorfrcrange is parsed from MJCF joint attributes and applied to joint effort limits.""" |
2907 | 2913 | mjcf_content = """<?xml version="1.0" encoding="utf-8"?> |
@@ -3741,6 +3747,8 @@ def test_joint_anchor_with_rotated_child_body(self): |
3741 | 3747 | # In xyzw format: [0, 0, sin(45°), cos(45°)] = [0, 0, 0.7071, 0.7071] |
3742 | 3748 | np.testing.assert_allclose(joint_X_p[3:7], [0, 0, 0.7071068, 0.7071068], atol=1e-5) |
3743 | 3749 |
|
| 3750 | + |
| 3751 | +class TestImportMjcfComposition(unittest.TestCase): |
3744 | 3752 | def test_floating_true_creates_free_joint(self): |
3745 | 3753 | """Test that floating=True creates a free joint for the root body.""" |
3746 | 3754 | mjcf_content = """<?xml version="1.0" encoding="utf-8"?> |
|
0 commit comments