fix: report negotiated color resolution in /status
Read width/height/fps from the live pipeline profile instead of hardcoding 640x480, so /status reflects the firmware-accepted resolution (e.g. the USB 2.x 640x480@15 fallback) rather than the requested config. Co-Authored-By: Claude Opus 4.7 (1M context) <noreply@anthropic.com>
This commit is contained in:
1 parent
08977ac6f6
commit
f1f1277755
2 files changed
+16
-1
No files matched your search
@@ -135,6 +135,21 @@ class RealSenseD435:
|
||||
def usb_type(self) -> str:
|
||||
return self._usb_type
|
||||
|
||||
def resolution(self) -> Optional[dict]:
|
||||
"""Negotiated color stream resolution, or None if not open.
|
||||
|
||||
Reads from the live pipeline profile so the value reflects what the
|
||||
firmware actually accepted — on USB 2.x this is the forced 640x480@15
|
||||
fallback, not the configured `_width/_height`.
|
||||
"""
|
||||
if not self._open or self._profile is None:
|
||||
return None
|
||||
try:
|
||||
stream = self._profile.get_stream(rs.stream.color).as_video_stream_profile()
|
||||
return {"width": stream.width(), "height": stream.height(), "fps": stream.fps()}
|
||||
except Exception:
|
||||
return None
|
||||
|
||||
def init(self) -> bool:
|
||||
try:
|
||||
self._ctx = rs.context()
|
||||
|
||||
Reference in new issue
Block a user