unisim.backend.mujoco.xml¶
Functions
|
Add a sensor child under the MuJoCo XML |
|
|
|
List MuJoCo-style body ids and names declared in a (possibly included) XML. |
|
Resolve MuJoCo-style body ids from XML without importing mujoco. |
|
Inject tracking sensors for the MuJoCo backend. |
Build a MuJoCo model with generated hfield terrain and attached robot spec. |
|
Create a temporary scene XML with task/scene fragments merged. |
|
|
Create a temporary scene XML with visual-only overrides applied. |
|
- unisim.backend.mujoco.xml.get_named_bodies(model_file)[source]¶
List MuJoCo-style body ids and names declared in a (possibly included) XML.
Returns
(ids, names)in document order, with ids starting at 1 (the MuJoCo implicit world body 0 is not listed).
- unisim.backend.mujoco.xml.get_named_body_ids(model_file, names)[source]¶
Resolve MuJoCo-style body ids from XML without importing mujoco.
- unisim.backend.mujoco.xml.materialize_scene_visual_override(source_model_file, *, ground_texture_file=None, ground_texrepeat=None, skybox_rgb1=None, skybox_rgb2=None)[source]¶
Create a temporary scene XML with visual-only overrides applied.
- unisim.backend.mujoco.xml.materialize_scene_fragments(source_model_file, *, fragment_files)[source]¶
Create a temporary scene XML with task/scene fragments merged.
- unisim.backend.mujoco.xml.materialize_mujoco_hfield_attached_scene(*, model_file, terrain_cfg, output_dir, fragment_files=(), hfield_name='terrain_hfield', geom_name='floor', return_surface_sampler=False)[source]¶
Build a MuJoCo model with generated hfield terrain and attached robot spec.
- unisim.backend.mujoco.xml.inject_mujoco_tracking_sensors(model_file, baselink_name=None)[source]¶
Inject tracking sensors for the MuJoCo backend.
The generated sensors track every body in the world frame (
_w). Whenbaselink_nameis provided, sensors in the baselink-relative frame (_b) are added as well.
- unisim.backend.mujoco.xml.add_sensor(root, sensor_type, name, **kwargs)[source]¶
Add a sensor child under the MuJoCo XML
<sensor>node.- Parameters:
root – XML root node.
sensor_type – Sensor tag name, such as
"gyro","contact", or"framepos".name – Sensor
nameattribute.**kwargs – Additional XML attributes such as
site="imu"orgeom1="floor".