google-deepmind / google-deepmind/mujoco_playground

Allow `mujoco_playground._src.wrapper.Wrapper.render` to accept kwargs

Open
#258 1 comment 1 reaction 0 assignees View on GitHub
Dominant language
Python
Stars
2.2k
Forks
359
Avg merge
7d 3h
Merged PRs (30d)
1

Description

Currently, the base wrapper class's render function is defined as
```python
def render(
self,
trajectory: List[mjx_env.State],
height: int = 240,
width: int = 320,
camera: Optional[str] = None,
scene_option: Optional[mujoco.MjvOption] = None,
modify_scene_fns: Optional[
Sequence[Callable[[mujoco.MjvScene], None]]
] = None,
) -> Sequence[np.ndarray]:
return self.env.render(
trajectory, height, width, camera, scene_option, modify_scene_fns
)
```
but when defining our own environments, users may have extra arguments for their render functions. Enabling kwargs would help solve potential silent bugs:
```python
def render(
self,
trajectory: List[mjx_env.State],
height: int = 240,
width: int = 320,
camera: Optional[str] = None,
scene_option: Optional[mujoco.MjvOption] = None,
modify_scene_fns: Optional[
Sequence[Callable[[mujoco.MjvScene], None]]
] = None,
**kwargs,
) -> Sequence[np.ndarray]:
return self.env.render(
trajectory, height=height, width=width, camera=camera, scene_option=scene_option, modify_scene_fns=modify_scene_fns, **kwargs
)
```

Contributor guide

Open the contributing guide

Assessment

This issue has not been assessed yet.

Get new issues in your inbox

A short digest of beginner-friendly GitHub issues.