Depth camera

Discussion in 'Support requests' started by zohar.feldman, Jan 15, 2020.

  1. Hi,

    I am trying to figure out how to work with the depth camera in mujoco.
    Following the code in record.cpp, I am using mjr_readPixels as follows:
    mjr_readPixels(rgb, depth, viewport, &con_);
    In the example in record.cpp I see that the depth is later transformed like so
    (unsignedchar)((1.0f-depth[r*W+c])*255.0f)
    which implies that the returned depth is in [0,1]?
    I would hope the depth return the actual distance from the camera, shouldn't it?