How to visualize it in mujoco? #5
-
How to visualize it in mujoco? |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 1 reply
-
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 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 = 0
pixels = env.render(camera_id=cam_id)) Does that meet your needs? References |
Beta Was this translation helpful? Give feedback.
-
ber
At 2025-01-06 02:18:13, "Vcbby" ***@***.***> wrote:
Hi there, I am trying to write a script to visualise the cart pole swing task under cart sparse policy, but I am a little bit confused and error occurs when I am coding. Can you show me a simple script to visualise the task pls?
—
Reply to this email directly, view it on GitHub, or unsubscribe.
You are receiving this because you were mentioned.Message ID: ***@***.***>
|
Beta Was this translation helpful? Give feedback.
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'sphysics.render
function [3].