Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[MuJoCo] add visual_options rendering argument #965

Merged
merged 3 commits into from
Mar 16, 2024

Conversation

Kallinteris-Andreas
Copy link
Collaborator

@Kallinteris-Andreas Kallinteris-Andreas commented Mar 14, 2024

Description

Fixes #464

Type of change

  • Documentation only change (no code changed)
  • Bug fix (non-breaking change which fixes an issue)
  • New feature (non-breaking change which adds functionality)
  • Breaking change (fix or feature that would cause existing functionality to not work as expected)
  • This change requires a documentation update

Testing

it works with render_mode="human" `render_mode="rgb_array"

import gymnasium
import mujoco
import time
from gymnasium.wrappers import HumanRendering, RecordVideo

env = gymnasium.make("Ant-v5", render_mode="human", visual_options={mujoco.mjtVisFlag.mjVIS_CONTACTPOINT: True, mujoco.mjtVisFlag.mjVIS_CONTACTFORCE: True})
# env = gymnasium.make("Ant-v5", render_mode="rgb_array", visual_options={mujoco.mjtVisFlag.mjVIS_CONTACTPOINT: True, mujoco.mjtVisFlag.mjVIS_CONTACTFORCE: True})
# env = HumanRendering(gymnasium.make("Ant-v5", render_mode="rgb_array", visual_options={mujoco.mjtVisFlag.mjVIS_CONTACTPOINT: True, mujoco.mjtVisFlag.mjVIS_CONTACTFORCE: True}))
# env = RecordVideo(env, video_folder="./save_videos1")
env.reset()

for _ in range(1000):
    env.step(env.action_space.sample())

env.close()

@Kallinteris-Andreas Kallinteris-Andreas marked this pull request as ready for review March 16, 2024 08:41
Copy link
Member

@pseudo-rnd-thoughts pseudo-rnd-thoughts left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Testing locally the HumanRendering and RecordVideo work great

@pseudo-rnd-thoughts pseudo-rnd-thoughts merged commit 62d739d into main Mar 16, 2024
16 checks passed
@Kallinteris-Andreas Kallinteris-Andreas deleted the Kallinteris-Andreas-patch-6 branch March 23, 2024 14:36
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
2 participants