omx-multicubes-mujoco / omx_multicubes.xml
maximellerbach's picture
Match the real setup: fence, board outline, 9 mm slats, mast and light
b022719 verified
Raw History Blame Contribute Delete
6.24 kB
<!--
OMX multicubes scene: a ROBOTIS OMX arm on a grey board, a fence of wooden slats, a blue tape square and
four painted wooden cubes, as in the maximellerbach/omx_multicubes and omx_pickandplace datasets.
The arm (ROBOTIS's robotis_omx MJCF) is attached at the `omx_mount` site; env.py adds the wrist camera to
its `link5`. Positions are in meters from the arm's base, x forward and y to the arm's left. The layout and
the top camera were measured on the dataset's top camera images (see README).
-->
<mujoco model="omx_multicubes">
<!-- The extent of the workspace, not of the room: MuJoCo scales the near clipping plane and the shadow
map with it, and the wrist camera sees the gripper from a few centimeters. -->
<statistic center="0.2 0 0.1" extent="0.6"/>
<!-- The arm model's options, which attaching it drops, and several contact points between convex
meshes, so that the fingers hold a cube flat instead of on a single point. -->
<option cone="elliptic" impratio="10">
<flag multiccd="enable"/>
</option>
<visual>
<headlight diffuse="0.25 0.25 0.25" ambient="0.30 0.30 0.30" specular="0 0 0"/>
<quality shadowsize="4096"/>
</visual>
<asset>
<texture type="skybox" builtin="gradient" rgb1="0.75 0.75 0.75" rgb2="0.45 0.45 0.45" width="512" height="3072"/>
<texture name="carpet" type="2d" builtin="flat" mark="random" random="0.4" rgb1="0.42 0.41 0.39"
markrgb="0.55 0.53 0.50" width="512" height="512"/>
<material name="carpet" texture="carpet" texuniform="true" texrepeat="8 8"/>
<material name="board" rgba="0.62 0.66 0.71 1" specular="0.1" shininess="0.2"/>
<material name="slat" rgba="0.84 0.75 0.62 1" specular="0.05"/>
<material name="tape" rgba="0.10 0.30 0.62 1" specular="0.2"/>
<material name="aluminium" rgba="0.75 0.76 0.78 1" specular="0.5" shininess="0.5"/>
<!-- Painted wooden cubes: one light wood grain, tinted by each cube's material. -->
<texture name="wood" type="cube" file="textures/wood.png"/>
<material name="red_wood" texture="wood" rgba="0.92 0.10 0.10 1" specular="0.2" shininess="0.3"/>
<material name="green_wood" texture="wood" rgba="0.18 0.55 0.18 1" specular="0.2" shininess="0.3"/>
<material name="blue_wood" texture="wood" rgba="0.10 0.35 0.85 1" specular="0.2" shininess="0.3"/>
<material name="yellow_wood" texture="wood" rgba="1.0 0.85 0.10 1" specular="0.2" shininess="0.3"/>
<!-- Board outline: its near edge back-projected from the top images, its sides 8 mm outside the side slats. -->
<mesh name="board" vertex="-0.0880 -0.3134 0.0 0.5600 -0.3625 0.0 0.5600 0.3320 0.0 -0.0880 0.3320 0.0 -0.0880 -0.3134 -0.02 0.5600 -0.3625 -0.02 0.5600 0.3320 -0.02 -0.0880 0.3320 -0.02"/>
</asset>
<default>
<default class="cube">
<geom type="box" size="0.0145 0.0145 0.0145" mass="0.02" condim="4" friction="1 0.03 0.003" solref="0.004 1"
solimp="0.95 0.99 0.001"/>
</default>
<!-- Fence slats: 9 x 9 mm wooden strips that the cubes can bump into. -->
<default class="slat">
<geom type="box" material="slat"/>
</default>
<!-- Tape and mast: visual only. -->
<default class="decor">
<geom type="box" contype="0" conaffinity="0"/>
</default>
</default>
<worldbody>
<light pos="0.2 0 2.5" dir="0 0 -1" directional="true" diffuse="0.35 0.35 0.35"/>
<light pos="-0.5 -0.4 1.2" dir="0.4 0.3 -1" diffuse="0.25 0.25 0.25" castshadow="true"/>
<!-- Carpet floor and the 2 cm board the arm is screwed onto, its outline back-projected from the top images; the board's top is z = 0. -->
<geom name="floor" type="plane" size="0 0 0.05" pos="0 0 -0.02" material="carpet"/>
<geom name="board" type="mesh" mesh="board" material="board"/>
<site name="omx_mount" pos="0 0 0"/>
<!-- Fence: seven slats around the workspace, open behind the arm, back-projected from the dataset's top
images. A top photo of the real setup agrees within about 1 cm: the front slats' inner face is about
0.38 m from the pan axis, so the arm reaches them just before it is fully straight. -->
<geom class="slat" fromto="-0.0548 -0.0839 0.0045 -0.0110 -0.3067 0.0045" size="0.0045"/>
<geom class="slat" fromto="-0.0110 -0.3067 0.0045 0.2370 -0.3255 0.0045" size="0.0045"/>
<geom class="slat" fromto="0.2370 -0.3255 0.0045 0.3738 -0.1372 0.0045" size="0.0045"/>
<geom class="slat" fromto="0.3738 -0.1372 0.0045 0.3795 0.1367 0.0045" size="0.0045"/>
<geom class="slat" fromto="0.3795 0.1367 0.0045 0.2450 0.3194 0.0045" size="0.0045"/>
<geom class="slat" fromto="0.2450 0.3194 0.0045 -0.0108 0.3195 0.0045" size="0.0045"/>
<geom class="slat" fromto="-0.0108 0.3195 0.0045 -0.0633 0.0742 0.0045" size="0.0045"/>
<!-- Blue tape square, 12.8 x 15.3 cm outside, 1.4 cm tape. -->
<body name="square" pos="0.172 -0.1875 0">
<geom class="decor" material="tape" size="0.0640 0.0070 0.0003" pos="0 0.0695 0.0003"/>
<geom class="decor" material="tape" size="0.0640 0.0070 0.0003" pos="0 -0.0695 0.0003"/>
<geom class="decor" material="tape" size="0.0070 0.0765 0.0003" pos="0.0570 0 0.0003"/>
<geom class="decor" material="tape" size="0.0070 0.0765 0.0003" pos="-0.0570 0 0.0003"/>
</body>
<!-- The top camera's aluminium mast at the far end of the board, as the wrist camera sees it. -->
<geom class="decor" material="aluminium" size="0.02 0.02 0.26" pos="0.47 0 0.26"/>
<body name="red_cube" pos="0.15 0.20 0.0145">
<freejoint/>
<geom class="cube" material="red_wood"/>
</body>
<body name="green_cube" pos="0.20 0.24 0.0145">
<freejoint/>
<geom class="cube" material="green_wood"/>
</body>
<body name="blue_cube" pos="0.14 0.16 0.0145">
<freejoint/>
<geom class="cube" material="blue_wood"/>
</body>
<body name="yellow_cube" pos="0.18 0.28 0.0145">
<freejoint/>
<geom class="cube" material="yellow_wood"/>
</body>
<!-- Fitted to the dataset's top camera: mostly straight down, the arm at the top of the image. -->
<camera name="top" pos="0.2541 -0.0099 0.4250" quat="0.70592 0.06232 0.06204 0.70282" fovy="62.22"/>
</worldbody>
</mujoco>