Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,7 @@ def domain_randomize(
'cam_quat': 0,
'light_pos': 0,
'light_dir': 0,
'light_directional': 0,
'light_type': 0,
'light_castshadow': 0,
})
rng = jax.random.key(0)
Expand Down Expand Up @@ -151,15 +151,15 @@ def rand(rng: jax.Array, light_position: jax.Array):
).astype(jp.float32)

# No need to randomize into specular lighting
light_directional = jp.ones((nlight,))
light_type = jp.ones((nlight,))

return (
geom_rgba,
geom_matid,
cam_pos,
cam_quat,
light_dir,
light_directional,
light_type,
light_castshadow,
)

Expand All @@ -169,7 +169,7 @@ def rand(rng: jax.Array, light_position: jax.Array):
cam_pos,
cam_quat,
light_dir,
light_directional,
light_type,
light_castshadow,
) = rand(jax.random.split(rng, num_worlds), light_positions)

Expand All @@ -180,7 +180,7 @@ def rand(rng: jax.Array, light_position: jax.Array):
'cam_quat': cam_quat,
'light_pos': light_positions,
'light_dir': light_dir,
'light_directional': light_directional,
'light_type': light_type,
'light_castshadow': light_castshadow,
})

Expand Down
10 changes: 5 additions & 5 deletions mujoco_playground/_src/wrapper.py
Original file line number Diff line number Diff line change
Expand Up @@ -196,7 +196,7 @@ def _identity_vision_randomization_fn(
'geom_size': 0,
'light_pos': 0,
'light_dir': 0,
'light_directional': 0,
'light_type': 0,
'light_castshadow': 0,
'light_cutoff': 0,
})
Expand All @@ -218,8 +218,8 @@ def _identity_vision_randomization_fn(
'light_dir': jp.repeat(
jp.expand_dims(mjx_model.light_dir, 0), num_worlds, axis=0
),
'light_directional': jp.repeat(
jp.expand_dims(mjx_model.light_directional, 0), num_worlds, axis=0
'light_type': jp.repeat(
jp.expand_dims(mjx_model.light_type, 0), num_worlds, axis=0
),
'light_castshadow': jp.repeat(
jp.expand_dims(mjx_model.light_castshadow, 0), num_worlds, axis=0
Expand All @@ -245,7 +245,7 @@ def _supplement_vision_randomization_fn(
'geom_size',
'light_pos',
'light_dir',
'light_directional',
'light_type',
'light_castshadow',
'light_cutoff',
]
Expand Down Expand Up @@ -292,7 +292,7 @@ def __init__(
'geom_size',
'light_pos',
'light_dir',
'light_directional',
'light_type',
'light_castshadow',
'light_cutoff',
]
Expand Down