google-deepmind / mujoco

Multi-Joint dynamics with Contact. A general purpose physics simulator.
https://mujoco.org
Apache License 2.0
8.11k stars 813 forks source link

There are differences in depth values of cameras with the same parameters in different scenes. #746

Closed Rancho-zhao closed 1 year ago

Rancho-zhao commented 1 year ago

Hi,

I'm a student and I'm trying to use MuJoCo for robot manipulation based on RL methods.

In my simulation, a camera is placed into a simulated sensor like the following. 1

Firstly, I constructed the sensor without any other objects in the scene. Then, I obtained the depth data of the camera, which is proceeded to the next step. Here is the code I obtain the depth value.

    viewer.render(gel_width,gel_height,camera_id=0)
    depth = viewer.read_pixels(gel_width, gel_height, depth=True)[1].copy()

After completing the debugging of relevant functions, I added the sensor to a simulated robot arm.

However, I found that whether there is a robot that will change the depth values of the camera. What's the problem?

Here is a model which explains my question:

minimal XML ```XML ```
yuvaltassa commented 1 year ago

znear and zfar are scaled by the model extent This is documented here, but should be added to the XML reference too.

yuvaltassa commented 1 year ago

Oh I take that back this is documented here