Skip to content

Depth annotators return +inf for pixels with no object, documentation says 0 #956

Backlog

Description

@ycpss91255

Description

The Replicator annotator documentation says that for distance_to_camera and distance_to_image_plane, a value of 0 means "no object in that pixel". In Isaac Sim 6.2.0.1 the annotators return +inf for those pixels. There are no 0 and no NaN values in the output. Downstream code that follows the documentation (depth == 0 means invalid) treats background pixels as valid, very far points.

Environment

  • Isaac Sim 6.2.0.1 (nvcr.io/nvidia/isaac-sim:6.2.0.1), headless, Ubuntu 24.04 host, NVIDIA RTX GPU
  • omni.replicator.core-1.13.38+110.4.0

Documentation reference

In the image, /isaac-sim/extscache/omni.replicator.core-1.13.38+110.4.0.lx64.r.cp312/docs/annotators_details.rst:

  • line 99 (distance_to_camera): "0 in the 2d array represents infinity (which means there is no object in that pixel)."
  • line 123 (distance_to_image_plane): the same sentence.

Minimal reproduction

Run with /isaac-sim/python.sh depth_inf_repro.py inside the container.

from isaacsim import SimulationApp
app = SimulationApp({"headless": True})
import numpy as np
import omni.timeline, omni.usd
import omni.replicator.core as rep
from pxr import Gf, UsdGeom, UsdLux

W, H = 640, 480
omni.usd.get_context().new_stage()
stage = omni.usd.get_context().get_stage()
UsdGeom.SetStageUpAxis(stage, UsdGeom.Tokens.z)
UsdGeom.SetStageMetersPerUnit(stage, 1.0)
UsdGeom.Xform.Define(stage, "/World")
cam = UsdGeom.Camera.Define(stage, "/World/Cam")
cam.GetClippingRangeAttr().Set(Gf.Vec2f(0.01, 1000))
cube = UsdGeom.Cube.Define(stage, "/World/Box")
cube.GetSizeAttr().Set(1.0)
xf = UsdGeom.Xformable(cube)
xf.AddTranslateOp().Set(Gf.Vec3d(0, 0, -5))          # camera looks down -Z
UsdLux.DomeLight.Define(stage, "/World/Dome").GetIntensityAttr().Set(1000)

omni.timeline.get_timeline_interface().play()
for _ in range(60):
    app.update()
rp = rep.create.render_product("/World/Cam", (W, H))
anns = {n: rep.AnnotatorRegistry.get_annotator(n) for n in ("distance_to_camera", "distance_to_image_plane")}
for a in anns.values():
    a.attach([rp])
for i in range(3000):
    app.update()
    if all(np.asarray(a.get_data()).size for a in anns.values()):
        break
for n, a in anns.items():
    d = np.asarray(a.get_data()).astype(np.float64)
    print("RESULT", n, d.dtype, d.shape, "zero:", int((d == 0).sum()), "posinf:", int(np.isposinf(d).sum()),
          "nan:", int(np.isnan(d).sum()), "finite>0:", int(((d > 0) & np.isfinite(d)).sum()))
app.close()

Expected

Pixels without an object are 0, as documented (or the documentation states +inf).

Actual

RESULT distance_to_camera float64 (480, 640) zero: 0 posinf: 191600 nan: 0 finite>0: 115600
RESULT distance_to_image_plane float64 (480, 640) zero: 0 posinf: 191600 nan: 0 finite>0: 115600

Of 307,200 pixels, 191,600 are +inf and none are 0.

In a larger run (a 4 m x 4 m plane tilted 30 degrees, centre 5 m from the camera, 640x480), 168,390 of 307,200 pixels (54.8%) were +inf, with 0 zeros and 0 NaN. The same counts were obtained in two separate runs. Valid pixels matched the analytic plane distance within 1.5 mm.

Request

Either make the output match the documentation, or update the documentation (and the Replicator docs for other annotators with the same sentence, if any) to say +inf. For users, +inf is the more convenient value, but the behaviour needs to be stated one way or the other. A related precedent is #897, where a no-return sentinel (-1.0 vs +inf) in the LaserScan publisher was aligned with REP 117.

Not verified

Other Isaac Sim versions, and whether pixels beyond the far clip, occluded pixels or glass materials also return +inf.

Activity

  1. vick-yu commented on Nov 30, 2026

    @vick-yu

    Thanks for the clear repro and the pixel counts – they made this quick to check.

    We have opened an internal ticket to address this documentation issue.

  2. added
    documentation
    on Nov 30, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    documentationisaac-sim-sdgisaac-sim-v6-2-0

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions