qgallouedec / panda-gym

Set of robotic environments based on PyBullet physics engine and gymnasium.
MIT License
492 stars 106 forks source link

Cannot change the viewpoint for render. #63

Closed daodreamer closed 1 year ago

daodreamer commented 1 year ago

Describe the bug

A clear and concise description of what the bug is.

To Reproduce

Provide a minimal code :

import gymnasium as gym
import panda_gym

env = gym.make(
    "PandaSlide-v3",
    render_mode="rgb_array",
    renderer="OpenGL",
    render_width=480,
    render_height=480,
    render_target_position=[0.2, 0, 0],
    render_distance=1.0,
    render_yaw=90,
    render_pitch=-70,
    render_roll=0,
)
env.reset()
image = env.render()  # RGB rendering of shape (480, 480, 3)
env.close()

...

System

Hi there, I got a problem. I wanted to set a different viewpoint during training and test, so I followed the instruction written down in document. I changed the parameters related to render: render_yaw and render_pitch. However, when I ran the training, the viewpoint had no change at all. It's totally the same as the default. How can I change the viewpoint?

Best regards, Dao

qgallouedec commented 1 year ago

The image rendered has the desired viewpoint.

# The above code
from PIL import Image
Image.fromarray(image).show()

image

However, it's true the the debug GUI does not reflect that. #64 should fix it.