fix(realsense): ignore invalid frames for disabled streams - #2
Open
bowenszhu wants to merge 1 commit into
Open
Conversation
Co-authored-by: Codex <noreply@openai.com>
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.
Type / Scope
Summary / Motivation
pyrealsense2can return a non-Noneframe object whose boolean value is false when a stream is disabled.SharedRealSenseManager._build_frame_snapshot()previously treated such handles as valid and could callget_data(), raisingnull pointer passed for argument "frame_ref". This change uses the SDK frame's truthiness so invalid color and depth handles are ignored while valid frames keep the existing decode and copy behavior.Related issues
What changed
How was this tested (or how to run locally)
Added
tests/cameras/test_realsense_frame_snapshot.py.Ran the focused regression tests and dependency check:
python -m unittest discover -s tests/cameras -p 'test_realsense_frame_snapshot.py' -v python -m pip checkResult: all 3 tests passed, and
pip checkreported no broken requirements.Ran the read-only hardware regression check:
Detected D435i
261822072940and D405260522274196, saved an RGB image from each camera, and observed noframe_referrors or frame timeouts.The existing
lerobotConda environment did not includepytestor Ruff, so those runners could not be executed. No dependencies were installed or upgraded.Checklist (required before merge)
pre-commit run -a)pytest)Reviewer notes
Noneframe semantics returned bypyrealsense2for disabled streams.