Skip to content

Commit b17f4b2

Browse files
haroonqcopybara-github
authored andcommitted
Add more scene golden tests.
PiperOrigin-RevId: 812708484 Change-Id: Icba94b128c89097703611ac4f6974f6d1cb19b4d
1 parent 6a75668 commit b17f4b2

File tree

4 files changed

+181
-0
lines changed

4 files changed

+181
-0
lines changed

test/testdata/catenary.xml

Lines changed: 34 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,34 @@
1+
<mujoco>
2+
<visual>
3+
<global elevation="-20"/>
4+
</visual>
5+
6+
<worldbody>
7+
<geom type="plane" size="1 1 .1"/>
8+
<light pos="0 -.2 2" dir="0 1 -4" diffuse="1 1 1"/>
9+
<body pos="0 0 .8">
10+
<joint type="slide" stiffness="1000"/>
11+
<geom size=".05" mass="20"/>
12+
<site name="hook" pos="0 0 -.05"/>
13+
</body>
14+
15+
<body pos="-.15 -.15 .3">
16+
<joint name="hinge" type="hinge" axis="0 0 1" damping=".5"/>
17+
<geom type="cylinder" size=".01" fromto="0 0 0 0 0 .1"/>
18+
<geom type="capsule" size=".01" fromto="0 0 0 .25 0 0"/>
19+
<geom size=".02" pos=".25 0 0"/>
20+
<site name="corner" pos=".25 0 .02"/>
21+
</body>
22+
</worldbody>
23+
24+
<tendon>
25+
<spatial limited="true" range="0 .5" width=".005">
26+
<site site="hook"/>
27+
<site site="corner"/>
28+
</spatial>
29+
</tendon>
30+
31+
<actuator>
32+
<general joint="hinge" biasprm="2" biastype="affine"/>
33+
</actuator>
34+
</mujoco>

test/testdata/frustum.xml

Lines changed: 33 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,33 @@
1+
<!-- Please activate Camera rendering when loading this model.
2+
The frustum should match exactly the fron face of the box. -->
3+
4+
<mujoco>
5+
<visual>
6+
<map znear="0.01"/>
7+
<rgba frustum="1. 1. 0 0.2"/>
8+
<scale frustum="3"/>
9+
</visual>
10+
11+
<asset>
12+
<texture name="grid" type="2d" builtin="checker" width="512" height="512" rgb1=".8 .6 .4" rgb2=".2 .3 .4"/>
13+
<material name="grid" texture="grid" texrepeat="9 16" texuniform="false" reflectance=".2"/>
14+
<texture type="skybox" builtin="flat" rgb1=".5 .5 1" height="1" width="1"/>
15+
</asset>
16+
17+
<worldbody>
18+
<light pos="0 0 3"/>
19+
<geom type="plane" size="10 10 .01"/>
20+
21+
<geom type="box" size=".375 .6 .1" pos="1.1 0 1" material="grid" euler="0 90 0"/>
22+
<!-- 8mm focal length lenses -->
23+
<camera pos="0 0 1" xyaxes="0 -1 0 0 0 1" focalpixel="1600 1600" resolution="1920 1200"
24+
sensorsize="9.6e-3 6e-3"/>
25+
26+
<body euler="0 0 90">
27+
<geom type="box" size=".375 .6 .1" pos="1.1 2 1" material="grid" euler="0 90 0"/>
28+
<!-- 8mm focal length lenses -->
29+
<camera pos="0 2 1" xyaxes="0 -1 0 0 0 1" focal="8e-3 8e-3" resolution="1920 1200"
30+
sensorsize="9.6e-3 6e-3" principalpixel="200 0"/>
31+
</body>
32+
</worldbody>
33+
</mujoco>

test/testdata/hammock.xml

Lines changed: 58 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,58 @@
1+
<!-- Copyright 2021 DeepMind Technologies Limited
2+
3+
Licensed under the Apache License, Version 2.0 (the "License");
4+
you may not use this file except in compliance with the License.
5+
You may obtain a copy of the License at
6+
7+
http://www.apache.org/licenses/LICENSE-2.0
8+
9+
Unless required by applicable law or agreed to in writing, software
10+
distributed under the License is distributed on an "AS IS" BASIS,
11+
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
12+
See the License for the specific language governing permissions and
13+
limitations under the License.
14+
-->
15+
16+
<mujoco model="Hammock">
17+
<!-- Degree of Freedom: 312
18+
Actuators: 21
19+
Equality constraints: 178
20+
Tendons: 178
21+
22+
Simple hammock, implemented as a 2D grid composite, pinned at the corners.
23+
-->
24+
25+
<option timestep="0.001" solver="CG" iterations="30" tolerance="1e-6"/>
26+
27+
<size memory="20M"/>
28+
29+
<visual>
30+
<map force="0.1" zfar="30"/>
31+
<rgba haze="0.15 0.25 0.35 1"/>
32+
<quality shadowsize="2048"/>
33+
<global offwidth="800" offheight="800"/>
34+
</visual>
35+
36+
<asset>
37+
<texture type="skybox" builtin="gradient" rgb1="0.3 0.5 0.7" rgb2="0 0 0" width="512" height="512"/>
38+
<texture name="plane" type="2d" builtin="checker" rgb1=".2 .3 .4" rgb2=".1 0.15 0.2"
39+
width="512" height="512" mark="cross" markrgb=".8 .8 .8"/>
40+
<texture name="hammock" type="2d" builtin="checker" rgb1=".1 .5 .1" rgb2=".5 .1 .1"
41+
width="512" height="512" mark="edge" markrgb=".8 .8 .8"/>
42+
<material name="plane" reflectance="0.3" texture="plane" texrepeat="1 1" texuniform="true"/>
43+
<material name="hammock" texture="hammock"/>
44+
</asset>
45+
46+
<worldbody>
47+
<geom name="floor" pos="0 0 -1" size="0 0 .25" type="plane" material="plane" condim="3"/>
48+
<light directional="true" diffuse=".2 .2 .2" specular="0 0 0" pos="0 0 5" dir="0 0 -1" castshadow="false"/>
49+
<light directional="false" diffuse=".8 .8 .8" specular="0.3 0.3 0.3" pos="0 0 4" dir="0 0 -1"/>
50+
<flexcomp name="hammock" type="grid" count="11 9 1" spacing="0.2 0.2 0.2" material="hammock"
51+
radius="0.04" dim="2">
52+
<pin id="0 8 90 98"/>
53+
<edge equality="true" damping="10" solimp=".95 .99"/>
54+
<contact selfcollide="none" internal="false" solimp=".99 .999 .00001"/>
55+
</flexcomp>
56+
</worldbody>
57+
58+
</mujoco>

test/testdata/tendon_wrap.xml

Lines changed: 56 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,56 @@
1+
<mujoco>
2+
<option>
3+
<flag island="enable"/>
4+
</option>
5+
6+
<default>
7+
<joint type="slide" axis="1 0 0" damping="3" frictionloss=".1"/>
8+
<geom type="cylinder" size=".07 .1" zaxis="0 1 0"/>
9+
<site size=".015" rgba="1 0 0 1"/>
10+
</default>
11+
12+
<worldbody>
13+
<site name="anchor" pos="0 0 1"/>
14+
15+
<body pos="0 0 .75">
16+
<joint stiffness="10"/>
17+
<geom name="0"/>
18+
</body>
19+
<site name="side0" pos=".15 0 .75" rgba="0 0 1 1"/>
20+
21+
<site name="01" pos="0 0 .625"/>
22+
23+
<body pos="0 0 .5">
24+
<joint stiffness="30"/>
25+
<geom name="1"/>
26+
</body>
27+
<site name="side1" pos="-.15 0 .5" rgba="0 0 1 1"/>
28+
29+
<site name="12" pos="0 0 .375"/>
30+
31+
<body pos="0 0 .25">
32+
<joint stiffness="100"/>
33+
<geom name="2"/>
34+
</body>
35+
<site name="side2" pos=".15 0 .25" rgba="0 0 1 1"/>
36+
37+
<body>
38+
<freejoint/>
39+
<site name="box" pos="0 0 .1"/>
40+
<geom type="box" size=".1 .1 .1"/>
41+
</body>
42+
</worldbody>
43+
44+
<tendon>
45+
<spatial limited="true" range="0 1.05" rgba="0 1 0 1" width=".005">
46+
<site site="anchor"/>
47+
<geom geom="0" sidesite="side0"/>
48+
<site site="01"/>
49+
<geom geom="1" sidesite="side1"/>
50+
<site site="12"/>
51+
<geom geom="2" sidesite="side2"/>
52+
<site site="box"/>
53+
</spatial>
54+
</tendon>
55+
</mujoco>
56+

0 commit comments

Comments
 (0)