isl-org / Open3D

Open3D: A Modern Library for 3D Data Processing
http://www.open3d.org
Other
11.37k stars 2.29k forks source link

Unable to detect realsense camera "RuntimeError: failed to set power state" #4393

Closed kr886q closed 2 years ago

kr886q commented 2 years ago

Describe the bug

following the documentation I am unable to detect the realsense d415 camera.

To Reproduce Steps to reproduce the behavior:

  1. pip install open3d
  2. git clone --recursive https://github.com/intel-isl/Open3D
  3. cd Open3d
  4. python examples/python/reconstruction_system/scripts/download_dataset.py L515_test
  5. modify the blow code to find data
import open3d as o3d
bag_reader = o3d.t.io.RSBagReader()
bag_reader.open(bag_filename)
while not bag_reader.is_eof():
    im_rgbd = bag_reader.next_frame()
    # process im_rgbd.depth and im_rgbd.color

bag_reader.close()

this runs with the expected output of

[Open3D INFO] File L515_test.bag opened
[Open3D INFO] EOF reached

adding the line o3d.t.io.RealSenseSensor.list_devices() for realsense discovery produces the following:

Traceback (most recent call last):
  File "/Users/kr886q/Development/VR Proj/open3d/3d_test.py", line 3, in <module>
    o3d.t.io.RealSenseSensor.list_devices()
RuntimeError: failed to set power state

Expected behavior

based on the documentation I expect something similar but with the d415 instead of the L515

[Open3D INFO] [0] Intel RealSense L515: f0141095
[Open3D INFO]       color_format: [RS2_FORMAT_BGR8 | RS2_FORMAT_BGRA8 | RS2_FORMAT_RGB8 | RS2_FORMAT_RGBA8 | RS2_FORMAT_Y16 | RS2_FORMAT_YUYV]
[Open3D INFO]       color_resolution: [1280,720 | 1920,1080 | 960,540]
[Open3D INFO]       color_fps: [15 | 30 | 6 | 60]
[Open3D INFO]       depth_format: [RS2_FORMAT_Z16]
[Open3D INFO]       depth_resolution: [1024,768 | 320,240 | 640,480]
[Open3D INFO]       depth_fps: [30]
[Open3D INFO]       visual_preset: [RS2_L500_VISUAL_PRESET_CUSTOM | RS2_L500_VISUAL_PRESET_DEFAULT | RS2_L500_VISUAL_PRESET_LOW_AMBIENT | RS2_L500_VISUAL_PRESET_MAX_RANGE | RS2_L500_VISUAL_PRESET_NO_AMBIENT | RS2_L500_VISUAL_PRESET_SHORT_RANGE]
[Open3D INFO] Open3D only supports synchronized color and depth capture (color_fps = depth_fps).

Screenshots If applicable, add screenshots to help explain your problem.

Environment (please complete the following information):

Additional context Add any other context about the problem here.

ssheorey commented 2 years ago

@kr886q can you confirm that your D415 camera works with the official RealSense viewer? HW issues (e.g. lose cable) may sometimes cause this.

kr886q commented 2 years ago

@ssheorey Yes I can confirm it works. I used the realsense app on my android phone and on my pc. I also used it on a free trial of dot3d

theNded commented 2 years ago

@ssheorey Yes I can confirm it works. I used the realsense app on my android phone and on my pc. I also used it on a free trial of dot3d

By "works with the official viewer" we mean in the same platform during the same connection launch so that we can track down the issue. Please let us know if your realsense works on mac with the official viewer.

kr886q commented 2 years ago

There is no native mac support for realsense, I tried the directions but was unable to launch the realsense app after manually building. I can try open3d on my pc for consistency

theNded commented 2 years ago

I guess that's the reason why it also fails in Open3D, because Open3D is just wrapping the official librealsense with our APIs with nothing magical... @ssheorey do you know if mac is supported?

ssheorey commented 2 years ago

@kr886q you can install and use the official realsense-viewer in macOS. brew install librealsense Open realsense-viewer and check whether you can access the camera.

ssheorey commented 2 years ago

Hi @kr886q I can confirm that D415 does not work with the official realsense-viewer v2.50.0 on macOS with the same error message. It does work with realsense-viewer v2.45.0.

With Open3D v0.14.1 we use librealsense v2.44.0. I can verify that D415 works:

>>> import open3d as o3d
Using external Open3D-ML in /Users/ssheorey/Documents/Open3D/Code/Open3D-ML/
>>> o3d.__version__
'0.14.1'
>>> o3d.t.io.RealSenseSensor.list_devices()
[Open3D INFO] [0] Intel RealSense D415: 748512060522
[Open3D INFO]   color_format: [RS2_FORMAT_BGR8 | RS2_FORMAT_BGRA8 | RS2_FORMAT_RAW16 | RS2_FORMAT_RGB8 | RS2_FORMAT_RGBA8 | RS2_FORMAT_Y16 | RS2_FORMAT_YUYV]
[Open3D INFO]   color_resolution: [1280,720 | 1920,1080 | 320,180 | 320,240 | 424,240 | 640,360 | 640,480 | 848,480 | 960,540]
[Open3D INFO]   color_fps: [15 | 30 | 6 | 60]
[Open3D INFO]   depth_format: [RS2_FORMAT_Z16]
[Open3D INFO]   depth_resolution: [1280,720 | 256,144 | 424,240 | 480,270 | 640,360 | 640,480 | 848,100 | 848,480]
[Open3D INFO]   depth_fps: [100 | 15 | 30 | 6 | 60 | 90]
[Open3D INFO]   visual_preset: []
[Open3D INFO] Open3D only supports synchronized color and depth capture (color_fps = depth_fps).
True

Please try upgrading the firmware on your camera to the latest. See here: https://dev.intelrealsense.com/docs/firmware-update-tool. An easier way is with realsense-viewer on any platform.

Since this is an upstream bug, please open an issue with librealsense. https://github.com/IntelRealSense/librealsense/issues