Skip to content

How to visualize it in mujoco? #5

Answered by nzolman
JUNLIN1111 asked this question in Q&A
Discussion options

You must be logged in to vote

Hi @JUNLIN1111—it depends on what you're looking to do here. In terms of visualizing a Mujoco environment from dm_control, I have primarily been using RLlib's dm_control wrapper (using ray 2.6.3) [1] and requesting visual observations from the environment through the render function [2]. At a low level, this call's dm_control's physics.render function [3].

from ray.rllib.env.wrappers.dm_control_wrapper import DMCEnv

# create env and request 480 x 480 resolution gif.
env = DMCEnv('cartpole', task_name='swingup',height=480, width=480)
env.reset()

# take the null action
obs = env.step(0.0 * env.action_space.sample())

# camera ID can either be 0 or 1, depending on the view you want.
cam_id = 

Replies: 2 comments 1 reply

Comment options

You must be logged in to vote
1 reply
@Vcbby
Comment options

Answer selected by nzolman
Comment options

You must be logged in to vote
0 replies
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Category
Q&A
Labels
None yet
3 participants