Skip to content

Fix cross-camera interference in batched look-at poses - #842

Merged
yuecideng merged 1 commit into
mainfrom
codex/fix-camera-batch-isolation
Oct 23, 2026
Merged

yuecideng merged 1 commit into
mainfrom
codex/fix-camera-batch-isolation

Conversation

@yuecideng

Copy link
Copy Markdown
Contributor

Description

A camera whose view direction is collinear with its up vector currently switches the entire look_at_to_pose batch to a fallback direction. Changing only camera B can therefore rotate unchanged camera A by 90 degrees, or introduce NaNs into another camera facing along the fallback axis.

Apply the fallback only to the affected rows and choose the less-aligned X/Y reference axis for each row. Preserve the existing default-up vertical-camera orientation. Extend the existing math test to compare mixed batches against isolated calls, cover custom per-camera up vectors on CPU/CUDA, and check known camera orientations.

Dependencies: none.

Type of change

  • Bug fix (non-breaking change which fixes an issue)

Validation

  • Regression check before the production fix: all four CPU/CUDA/default-up/custom-up cases failed.
  • python -m pytest -q tests/utils/test_math.py tests/sim/sensors/test_camera_reset.py tests/gym/envs/managers/test_randomize_camera_extrinsics.py --run-gpu: 76 passed.
  • black . and black --check --diff ., Black 26.3.1: passed.
  • python docs/scripts/check_api_docs.py: 2805/2805 exports documented.
  • git diff --check: passed.

The added coverage extends the existing camera math test, closing the missing batch-independence and custom-up degeneracy checks without introducing a separate fixture or test module.

Rendered comparison

Checked actual DexSim Hybrid offscreen camera frames with two arenas, CUDA look-at inputs, 480×480 RGB images, disabled denoising, a fixed scene, and zero physics steps. Only camera B's eye changes from oblique to vertical; camera A's inputs remain fixed.

Camera A response Before After
Rotation difference 90° 0°
Changed pixels 58.29% 0%
Mean absolute RGB difference (0–255) 36.9705 0

Documentation and context

The function docstring now states the per-camera fallback contract. No public exports or signatures change. The context impact command reports no affected topics; the sensor overview was also reviewed and its ownership/lifecycle guidance remains accurate, so no context edit is needed.

Checklist

  • I have run the black . command to format the code base.
  • I reviewed affected documentation and agent context, updated it where needed, or explained why no update was needed.
  • Public API changes are reflected in the API docs (python docs/scripts/check_api_docs.py), if applicable.
  • I verified appropriate behavioral coverage, reviewed the necessity of added or extended tests, and explained when no new tests were needed.
  • Dependencies have been updated, if applicable (no dependency changes).

@yuecideng yuecideng added bug Incorrect existing behavior or a fix restoring the intended behavior. sensor Sensor models, attachment, lifecycle, extension interfaces and observation contracts. labels Oct 22, 2026
@greptile-apps

greptile-apps Bot commented Oct 22, 2026 •

Copy link
Copy Markdown

RetriggerView in GreptileConfidence Score: 5/5

[Medium impact] The PR appears safe to merge.

Summary

look_at_to_pose now applies its fallback only to cameras whose view and up directions are collinear.

  • Look-at poses keep fallback choices within each camera.

No actionable issues found. This review checked the code and test expectations; it did not run tests.

Reviews (1) · Last reviewed commit: "fix(sensor): isolate batched look-at fal..." · Reviewed by Greptile

@yuecideng
yuecideng merged commit b6d8a23 into main Oct 23, 2026
9 checks passed
@yuecideng
yuecideng deleted the codex/fix-camera-batch-isolation branch October 23, 2026 02:35
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Incorrect existing behavior or a fix restoring the intended behavior. sensor Sensor models, attachment, lifecycle, extension interfaces and observation contracts.

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant