Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Running pyrealsense2 in docker on Jetson Nano doesn't receive any frames #12218

Closed
nixone opened this issue Sep 22, 2023 · 3 comments
Closed

Comments

@nixone
Copy link

nixone commented Sep 22, 2023


Required Info
Camera Model D455
Firmware Version 5.15.02
Operating System & Version Ubuntu (Jetson Nano SD image) Linux jetson-desktop 4.9.337-tegra
Kernel Version (Linux Only) 4.9.337
Platform NVIDIA Jetson
SDK Version 2.54.1
Language python
Segment IoT

Issue Description

I noticed in the latest built pyrealsense2 there are also versions for aarch64 for python 3.8 and 3.9. I decided to try it on Jetson Nano, and it works:

test.py

import pyrealsense2 as rs
pipe = rs.pipeline()
profile = pipe.start()
try:
  for i in range(0, 100):
    frames = pipe.wait_for_frames()
    for f in frames:
      print(f.profile)
finally:
    pipe.stop()

Running it receives frames:

jetson@jetson-desktop:~/workspace/test$ python3.8 test.py
<pyrealsense2.[video_]stream_profile: Depth(0) 848x480 @ 30fps Z16>
<pyrealsense2.[video_]stream_profile: Color(0) 1280x720 @ 30fps RGB8>
<pyrealsense2.stream_profile: Accel(0) @ 63fps MOTION_XYZ32F>
<pyrealsense2.stream_profile: Gyro(0) @ 200fps MOTION_XYZ32F>
<pyrealsense2.[video_]stream_profile: Depth(0) 848x480 @ 30fps Z16>
<pyrealsense2.[video_]stream_profile: Color(0) 1280x720 @ 30fps RGB8>

But, when I try to use it in docker, it fails with not receiving frames:

docker-compose.yml

version: "3.9"
services:

        test:
                build:
                        context: .
                        dockerfile_inline: |
                                FROM ubuntu:focal
                                ARG DEBIAN_FRONTEND=noninteractive
                                RUN apt-get -y update
                                RUN apt-get -y install python3.8 python3.8-dev python3-distutils python3-pip libusb-1.0-0-dev
                                RUN python3.8 -m pip install pyrealsense2
                                WORKDIR /
                                COPY test.py /test.py
                                CMD ["/usr/bin/python3.8", "/test.py"]
                privileged: true
                runtime: nvidia
                restart: always
                volumes:
                        - /dev/bus/usb:/dev/bus/usb
                device_cgroup_rules:
                        - 'c 81:* rmw'
                        - 'c 189:* rmw'
jetson@jetson-desktop:~/workspace/test$ docker compose up
[+] Building 0.0s (0/0)
[+] Running 1/1
 ✔ Container test-test-1  Created                                          0.1s
Attaching to test-test-1
test-test-1  | Traceback (most recent call last):
test-test-1  |   File "/test.py", line 6, in <module>
test-test-1  |     frames = pipe.wait_for_frames()
test-test-1  | RuntimeError: Frame didn't arrive within 5000
test-test-1 exited with code 0

Does anyone have an idea what might I have wrong in the docker setup?

@MartyG-RealSense
Copy link
Collaborator

Hi @nixone Please first try reloading the device-handling udev rules outside of Docker using the instruction below to see whether it resolves your problem within Docker.

sudo udevadm control --reload-rules && udevadm trigger

@MartyG-RealSense
Copy link
Collaborator

Hi @nixone Do you require further assistance with this case, please? Thanks!

@MartyG-RealSense
Copy link
Collaborator

Case closed due to no further comments received.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants