Skip to content

Commit 32a3c45

Browse files
authored
Merge branch 'google-deepmind:main' into musculoskeletal_dog_creation
2 parents 05c1f4c + 40043f0 commit 32a3c45

File tree

5 files changed

+34
-29
lines changed

5 files changed

+34
-29
lines changed

dm_control/mjcf/README.md

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -462,7 +462,7 @@ All children of non-worldbody elements, e.g. actuators or tendons, are
462462
automatically merged in to appropriate places when a model is attached. Named
463463
elements are prefixed as previously described.
464464

465-
## Common gotchas {#common-gotchas}
465+
## Common gotchas
466466

467467
### Use `foo.dclass`, not ~~`foo.class`~~
468468

dm_control/mjcf/schema.xml

Lines changed: 23 additions & 27 deletions
Original file line numberDiff line numberDiff line change
@@ -25,6 +25,7 @@
2525
<attribute name="inertiafromgeom" type="keyword" valid_values="false true auto"/>
2626
<attribute name="inertiagrouprange" type="array" array_type="int" array_size="2"/>
2727
<attribute name="exactmeshinertia" type="keyword" valid_values="false true"/>
28+
<attribute name="alignfree" type="keyword" valid_values="false true"/>
2829
</attributes>
2930
<children>
3031
<element name="lengthrange">
@@ -66,8 +67,8 @@
6667
<attribute name="ls_tolerance" type="float" conflict_allowed="true" conflict_behavior="min"/>
6768
<attribute name="noslip_iterations" type="int" conflict_allowed="true" conflict_behavior="max"/>
6869
<attribute name="noslip_tolerance" type="float" conflict_allowed="true" conflict_behavior="min"/>
69-
<attribute name="mpr_iterations" type="int" conflict_allowed="true" conflict_behavior="max"/>
70-
<attribute name="mpr_tolerance" type="float" conflict_allowed="true" conflict_behavior="min"/>
70+
<attribute name="ccd_iterations" type="int" conflict_allowed="true" conflict_behavior="max"/>
71+
<attribute name="ccd_tolerance" type="float" conflict_allowed="true" conflict_behavior="min"/>
7172
<attribute name="sdf_iterations" type="int" conflict_allowed="true" conflict_behavior="max"/>
7273
<attribute name="sdf_initpoints" type="int" conflict_allowed="true" conflict_behavior="max"/>
7374
</attributes>
@@ -983,7 +984,6 @@
983984
<children>
984985
<element name="plugin" repeated="true" namespace="mesh">
985986
<attributes>
986-
<attribute name="name" type="string"/>
987987
<attribute name="plugin" type="string"/>
988988
<attribute name="instance" type="reference" reference_namespace="plugin"/>
989989
</attributes>
@@ -1079,7 +1079,6 @@
10791079
<children>
10801080
<element name="plugin" repeated="true" namespace="geom">
10811081
<attributes>
1082-
<attribute name="name" type="string"/>
10831082
<attribute name="plugin" type="string"/>
10841083
<attribute name="instance" type="reference" reference_namespace="plugin"/>
10851084
</attributes>
@@ -1184,7 +1183,6 @@
11841183
<children>
11851184
<element name="plugin" repeated="true" namespace="flexcomp">
11861185
<attributes>
1187-
<attribute name="name" type="string"/>
11881186
<attribute name="plugin" type="string"/>
11891187
<attribute name="instance" type="reference" reference_namespace="plugin"/>
11901188
</attributes>
@@ -1252,7 +1250,6 @@
12521250
<children>
12531251
<element name="plugin" repeated="true" namespace="composite">
12541252
<attributes>
1255-
<attribute name="name" type="string"/>
12561253
<attribute name="plugin" type="string"/>
12571254
<attribute name="instance" type="reference" reference_namespace="plugin"/>
12581255
</attributes>
@@ -1370,7 +1367,6 @@
13701367
<children>
13711368
<element name="plugin" repeated="true" namespace="body">
13721369
<attributes>
1373-
<attribute name="name" type="string"/>
13741370
<attribute name="plugin" type="string"/>
13751371
<attribute name="instance" type="reference" reference_namespace="plugin"/>
13761372
</attributes>
@@ -1427,6 +1423,7 @@
14271423
<attributes>
14281424
<attribute name="name" type="identifier"/>
14291425
<attribute name="group" type="int"/>
1426+
<attribute name="align" type="keyword" valid_values="false true auto"/>
14301427
</attributes>
14311428
</element>
14321429
<element name="geom" repeated="true">
@@ -1468,7 +1465,6 @@
14681465
<children>
14691466
<element name="plugin" repeated="true" namespace="geom">
14701467
<attributes>
1471-
<attribute name="name" type="string"/>
14721468
<attribute name="plugin" type="string"/>
14731469
<attribute name="instance" type="reference" reference_namespace="plugin"/>
14741470
</attributes>
@@ -1573,7 +1569,6 @@
15731569
<children>
15741570
<element name="plugin" repeated="true" namespace="flexcomp">
15751571
<attributes>
1576-
<attribute name="name" type="string"/>
15771572
<attribute name="plugin" type="string"/>
15781573
<attribute name="instance" type="reference" reference_namespace="plugin"/>
15791574
</attributes>
@@ -1641,7 +1636,6 @@
16411636
<children>
16421637
<element name="plugin" repeated="true" namespace="composite">
16431638
<attributes>
1644-
<attribute name="name" type="string"/>
16451639
<attribute name="plugin" type="string"/>
16461640
<attribute name="instance" type="reference" reference_namespace="plugin"/>
16471641
</attributes>
@@ -1849,9 +1843,11 @@
18491843
<attribute name="active" type="keyword" valid_values="false true"/>
18501844
<attribute name="solref" type="array" array_type="float" array_size="2"/>
18511845
<attribute name="solimp" type="array" array_type="float" array_size="5"/>
1852-
<attribute name="body1" type="reference" required="true" reference_namespace="body"/>
1846+
<attribute name="body1" type="reference" reference_namespace="body"/>
18531847
<attribute name="body2" type="reference" reference_namespace="body"/>
1854-
<attribute name="anchor" type="array" required="true" array_type="float" array_size="3"/>
1848+
<attribute name="anchor" type="array" array_type="float" array_size="3"/>
1849+
<attribute name="site1" type="reference" reference_namespace="site"/>
1850+
<attribute name="site2" type="reference" reference_namespace="site"/>
18551851
</attributes>
18561852
</element>
18571853
<element name="weld" repeated="true" namespace="equality">
@@ -2625,35 +2621,35 @@
26252621
<attribute name="name" type="identifier"/>
26262622
<attribute name="noise" type="float"/>
26272623
<attribute name="user" type="array" array_type="float"/>
2628-
<attribute name="cutoff" type="float"/>
2629-
<attribute name="geom1" type="reference" required="true" reference_namespace="geom"/>
2630-
<attribute name="geom2" type="reference" required="true" reference_namespace="geom"/>
2631-
<attribute name="body1" type="reference" required="true" reference_namespace="body"/>
2632-
<attribute name="body2" type="reference" required="true" reference_namespace="body"/>
2624+
<attribute name="cutoff" type="float" required="true"/>
2625+
<attribute name="geom1" type="reference" reference_namespace="geom"/>
2626+
<attribute name="geom2" type="reference" reference_namespace="geom"/>
2627+
<attribute name="body1" type="reference" reference_namespace="body"/>
2628+
<attribute name="body2" type="reference" reference_namespace="body"/>
26332629
</attributes>
26342630
</element>
26352631
<element name="normal" repeated="true" namespace="sensor">
26362632
<attributes>
26372633
<attribute name="name" type="identifier"/>
26382634
<attribute name="noise" type="float"/>
26392635
<attribute name="user" type="array" array_type="float"/>
2640-
<attribute name="cutoff" type="float"/>
2641-
<attribute name="geom1" type="reference" required="true" reference_namespace="geom"/>
2642-
<attribute name="geom2" type="reference" required="true" reference_namespace="geom"/>
2643-
<attribute name="body1" type="reference" required="true" reference_namespace="body"/>
2644-
<attribute name="body2" type="reference" required="true" reference_namespace="body"/>
2636+
<attribute name="cutoff" type="float" required="true"/>
2637+
<attribute name="geom1" type="reference" reference_namespace="geom"/>
2638+
<attribute name="geom2" type="reference" reference_namespace="geom"/>
2639+
<attribute name="body1" type="reference" reference_namespace="body"/>
2640+
<attribute name="body2" type="reference" reference_namespace="body"/>
26452641
</attributes>
26462642
</element>
26472643
<element name="distance" repeated="true" namespace="sensor">
26482644
<attributes>
26492645
<attribute name="name" type="identifier"/>
26502646
<attribute name="noise" type="float"/>
26512647
<attribute name="user" type="array" array_type="float"/>
2652-
<attribute name="cutoff" type="float"/>
2653-
<attribute name="geom1" type="reference" required="true" reference_namespace="geom"/>
2654-
<attribute name="geom2" type="reference" required="true" reference_namespace="geom"/>
2655-
<attribute name="body1" type="reference" required="true" reference_namespace="body"/>
2656-
<attribute name="body2" type="reference" required="true" reference_namespace="body"/>
2648+
<attribute name="cutoff" type="float" required="true"/>
2649+
<attribute name="geom1" type="reference" reference_namespace="geom"/>
2650+
<attribute name="geom2" type="reference" reference_namespace="geom"/>
2651+
<attribute name="body1" type="reference" reference_namespace="body"/>
2652+
<attribute name="body2" type="reference" reference_namespace="body"/>
26572653
</attributes>
26582654
</element>
26592655
</children>

dm_control/mjcf/test_assets/robot_arm.xml

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -141,6 +141,8 @@
141141
<torque name="wristtorque" site='wristsite'/>
142142
<force name="baseforce" site='basesite'/>
143143
<torque name="basetorque" site='basesite'/>
144+
<distance body1="b_finger_3" body2="b_finger_2" cutoff="0.1"/>
145+
<distance geom1="finger_knuckle_3" geom2="finger_knuckle_2" cutoff="0.1"/>
144146
</sensor>
145147

146148
<actuator>

dm_control/mujoco/index_test.py

Lines changed: 7 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -52,6 +52,12 @@
5252
'4 mocap2 [ 12 13 14 ]'),
5353
}
5454

55+
# A test below accesses all attributes of np.ndarray, but accessing some of them
56+
# triggers an exception under numpy>=2.0.
57+
_DEPRECATED_NDARRAY_ATTRIBUTES = {
58+
'itemset', 'newbyteorder', 'ptp'
59+
}
60+
5561

5662
class MujocoIndexTest(parameterized.TestCase):
5763

@@ -291,6 +297,7 @@ def testBuildIndexersForEdgeCases(self, xml_string):
291297
(name, name) for name in dir(np.ndarray)
292298
if not name.startswith('_') # Exclude 'private' attributes
293299
and name not in ('ctypes', 'flat') # Can't compare via identity/equality
300+
and name not in _DEPRECATED_NDARRAY_ATTRIBUTES
294301
])
295302
# pylint: enable=undefined-variable
296303
def testFieldIndexerDelegatesNDArrayAttributes(self, name):

dm_control/utils/inverse_kinematics_test.py

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -118,7 +118,7 @@ def testQposFromSitePose(self, target, inplace):
118118
xmat = physics.named.data.site_xmat[_SITE_NAME]
119119
quat = np.empty_like(target_quat)
120120
mjlib.mju_mat2Quat(quat, xmat)
121-
quat /= quat.ptp() # Normalize xquat so that its max-min range is 1
121+
quat /= np.ptp(quat) # Normalize xquat so that its max-min range is 1
122122
np.testing.assert_array_almost_equal(quat, target_quat)
123123

124124
def testNamedJointsWithMultipleDOFs(self):

0 commit comments

Comments
 (0)