Repository navigation
Fix cross-camera interference in batched look-at poses - #842
Merged
Merged
Conversation
[Medium impact] The PR appears safe to merge. Summary
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 |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Description
A camera whose view direction is collinear with its up vector currently switches the entire
look_at_to_posebatch 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
Validation
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 .andblack --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.
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
black .command to format the code base.python docs/scripts/check_api_docs.py), if applicable.