Skip to content

Fix buffer conversion in frames_listener function#38

Open
MichaelrMentele wants to merge 1 commit into
eclipse-zenoh:mainfrom
MichaelrMentele:patch-1
Open

Fix buffer conversion in frames_listener function#38
MichaelrMentele wants to merge 1 commit into
eclipse-zenoh:mainfrom
MichaelrMentele:patch-1

Conversation

@MichaelrMentele
Copy link
Copy Markdown

@MichaelrMentele MichaelrMentele commented Nov 1, 2025

Bug

When running as instructed:

AttributeError: 'builtins.Sample' object has no attribute 'value'
callback error
Traceback (most recent call last):
  File "/Users/michaelmentele/Development/trying-shit/zenoh-demos/computer-vision/zcam/zcam-python/zdisplay.py", line 37, in frames_listener
    npImage = np.frombuffer(bytes(sample.value.payload), dtype=np.uint8)
                                  ^^^^^^^^^^^^
AttributeError: 'builtins.Sample' object has no attribute 'value'
^CTraceback (most recent call last):
  File "/Users/michaelmentele/.local/share/uv/python/cpython-3.13.1-macos-aarch64-none/lib/python3.13/threading.py", line 1540, in _shutdown
    _thread_shutdown()
KeyboardInterrupt: 

With the change

Works as expected, though apparently my webcam makes thumbs up emojis that linger when I thumbs up.
image

In current form get the following error:

```python
AttributeError: 'builtins.Sample' object has no attribute 'value'
callback error
Traceback (most recent call last):
  File "/Users/michaelmentele/Development/trying-shit/zenoh-demos/computer-vision/zcam/zcam-python/zdisplay.py", line 37, in frames_listener
    npImage = np.frombuffer(bytes(sample.value.payload), dtype=np.uint8)
                                  ^^^^^^^^^^^^
AttributeError: 'builtins.Sample' object has no attribute 'value'
^CTraceback (most recent call last):
  File "/Users/michaelmentele/.local/share/uv/python/cpython-3.13.1-macos-aarch64-none/lib/python3.13/threading.py", line 1540, in _shutdown
    _thread_shutdown()
KeyboardInterrupt: 
```
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant