nicrusso7 / rex-gym

OpenAI Gym environments for an open-source quadruped robot (SpotMicro)
Apache License 2.0
973 stars 130 forks source link

Offscreen rendering made terrain disappear #19

Closed Dzhange closed 3 years ago

Dzhange commented 3 years ago

HI

I'm trying to add visual signal of the terrain to the agent.

While rendering in offscreen mode(I turned render option to False when initializing environment), I found that the terrain becam invisible, but the robot looks fine. Do you have any idea about how could I render the terrain without GUI? image

Thanks!

nicrusso7 commented 3 years ago

Hi, you can toggle the pybullet gui pressing 'g'. Check this out for shortcuts: https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=13176

Let me know if this work for you.

Thanks!

Dzhange commented 3 years ago

Hi, you can toggle the pybullet gui pressing 'g'. Check this out for shortcuts: https://pybullet.org/Bullet/phpBB3/viewtopic.php?t=13176

Let me know if this work for you.

Thanks!

Sorry I didn't make it clear, in fact I'm running Rex on a headless server, so I couldn't visiualize through the GUI, and I initialized the rex-gym environment with env = config.env(render=False, **self.args), and tried to get camera image during simulation. In the end I got the image shown above, where the rex robot is visible but the terrain(I set it tomounts) disappeared. I'm wondering how could I render the terrain in that case

Thanks!

nicrusso7 commented 3 years ago

Now I see what you meant, thanks. So the terrain is created here and I can't see why it is actually "invisible" when you run it in headless mode. Did you tried any other terrain? e.g. random. I suspect there is a graphical issue going on

Dzhange commented 3 years ago

Yeah I tried all terrains but none of them was rendered. If you would like to reproduce the problem, just call the render function somewhere and store the returned img.

Dzhange commented 3 years ago

I also tried to render without GUI on a machine with monitor, and the terrain is still not showing :( .

Dzhange commented 3 years ago

Somehow got it working:

  1. I upgraded pybullet to newest version
  2. changed the render in getCameraImage to ER_TINY_RENDERER

image

nicrusso7 commented 3 years ago

Awesome! thanks for pointing this out.