===================
Scene Composition
===================
This section explains how to compose scenes using MuJoCo's include system and the DexRobot MuJoCo component library.
Basic Structure
-------------
A scene XML file consists of several key sections:
1. Default inclusions
2. Asset inclusions
3. World body definitions
4. Component inclusions
Example Scene
-----------
Here's a complete example (based on box.xml):
.. code-block:: xml
Component Types
-------------
Defaults
^^^^^^^
Always include defaults first:
.. code-block:: xml
This sets up standard parameters for physics, rendering, and contacts.
Assets
^^^^^
Include all required visual assets:
.. code-block:: xml
Bodies
^^^^^
Add physical bodies to the scene:
.. code-block:: xml
The body tag sets:
- ``name``: Unique identifier
- ``pos``: Position [x y z]
- ``euler``: Orientation [roll pitch yaw]
Additional Components
^^^^^^^^^^^^^^^^^^
Include remaining components after worldbody:
.. code-block:: xml
Building Scenes
-------------
Step-by-Step Process
^^^^^^^^^^^^^^^^^
1. Start with model declaration:
.. code-block:: xml
2. Include defaults:
.. code-block:: xml
3. Include all required assets:
.. code-block:: xml
4. Define worldbody with components:
.. code-block:: xml
5. Include remaining component files:
.. code-block:: xml
Common Patterns
------------
Floating Hand Scene
^^^^^^^^^^^^^^^^
Basic setup for hand manipulation:
.. code-block:: xml
Hand-Arm Scene
^^^^^^^^^^^
Setup for mounted hand:
.. code-block:: xml
Available Components
------------------
Furniture Components
^^^^^^^^^^^^^^^^^^
Tables
~~~~~~
Structure: ``furniture_sim/[type]/[type]_{asset,body}.xml``
.. code-block:: xml
Available:
- simpleTable: Basic surface with material variants
- studyTable: Surface with drawer/handle mechanics
- ventionTable: Industrial frame structure
Storage Units
~~~~~~~~~~~
.. code-block:: xml
Available:
- hingecabinet: Hinged door mechanics
- slidecabinet: Linear sliding mechanism
- counters: Kitchen counter units
- bin: Storage containers
Appliances
~~~~~~~~~
.. code-block:: xml
Available:
- microwave: Door and control panel mechanics
- kettle: Handle and pour mechanics
- oven: Door, knob and burner mechanics
Environment Components
^^^^^^^^^^^^^^^^^^^^
Base Scenes
~~~~~~~~~
Structure: ``scene_sim/[name]_scene.xml``
.. code-block:: xml
Available:
- basic_scene: Ground plane and lighting
- room_scene: Enclosed space with windows
- rooftop_scene: Open space with skyline
Lighting
~~~~~~~
.. code-block:: xml
Textures
~~~~~~~
Standard textures:
- Materials: wood[0-4].png, metal[0-4].png, stone[0-4].png
- Environment: dawn/night/cloudy/stormy.png (skyboxes)
- Surfaces: oak/maple_floorboard.png, high_contrast_brick.png
Next Steps
---------
- Study complete examples in :doc:`examples`