Skip to content

[Bug Report] Camera intrinsic batch mismatch silently updates only a prefix #7798

Closed

Description

@peachtree0222

Describe the bug

Camera.set_intrinsic_matrices() accepts a batch of matrices and a selection of camera IDs, but it does not require the two counts to match. The write loop uses zip(env_ids, matrices), which silently stops at the shorter input.

With two selected cameras and one matrix, only the first camera is authored and the second keeps its previous calibration. With one selected camera and two matrices, the second matrix is ignored. The method then refreshes intrinsics for all selected cameras, so callers receive no indication that only a prefix was written.

This report is based on current-source control flow. I have not run a simulator-backed reproduction.

Reproduction files:

camera-intrinsic-batch-cardinality-mismatch-poc.zip

Steps to reproduce

Use a camera view containing at least two instances, then call:

one_matrix = torch.eye(3, device=camera.device).unsqueeze(0)
before = camera.data.intrinsic_matrices.torch[[0, 1]].clone()

camera.set_intrinsic_matrices(one_matrix, env_ids=[0, 1])

after = camera.data.intrinsic_matrices.torch[[0, 1]].clone()

The implementation pairs only camera 0 with the single matrix. Camera 1 is still included in the final readback even though no matrix was authored for it.

Expected behavior: reject the call before any USD attribute changes unless there is exactly one matrix per selected camera. If single-row broadcasting is intended, it should be explicit and documented rather than inherited from zip behavior.

The reverse mismatch is also silent:

camera.set_intrinsic_matrices(torch.eye(3).repeat(2, 1, 1), env_ids=[0])

Only the first matrix is consumed.

System Info

  • Commit: 429fb6339def1f3ff24f9c15d9dceb8474a74804 (develop; source inspection only)
  • Isaac Sim Version: Not run
  • OS: Not recorded for a runtime reproduction
  • GPU: Not required for the control-flow defect; not run
  • CUDA: Not run
  • GPU Driver: Not run

Additional context

The affected loop is in Camera.set_intrinsic_matrices. The proposed patch compares matrices.shape[0] with the resolved ID count immediately after normalizing a single matrix to a one-row batch, before reading or writing any camera prim.

Public searches for the method name and intrinsic batch/ID mismatches found camera issues, but no report of this count-truncation behavior.

Checklist

  • I have checked that there is no similar issue in the repo (required; bounded search repeated on 2026-09-11)
  • I have checked that the issue is not in running Isaac Sim itself and is related to the repo

Acceptance Criteria

  • Too few or too many intrinsic matrices raise a clear ValueError before any camera attribute is written.
  • A correctly sized batch updates every selected camera.
  • Any supported single-row broadcast behavior is explicit and documented.
  • Regression tests cover both mismatch directions and confirm validation occurs before prim access.

Activity

  1. kgu42 commented on Sep 23, 2026

    @kgu42
    Collaborator

    Thanks for reporting this. The internal team updated the develop branch to resolve this (#7916 in commit 27d66c008).

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

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions