Python box_dimensioner demo not working (SR300 or L515)
I'd like to try the box dimensioner example to evaluate Realsense devices, using the Python wrapper.
i.e. this example code.
https://github.com/IntelRealSense/librealsense/blob/development/wrappers/python/examples/box_dimensioner_multicam/box_dimensioner_multicam_demo.py
Unfortunately I can't get this to work and would appreciate any support.
Realsense SDK is installed, openCV is installed, Python 3.6.9 is used.
A RealSense SR300 hardware unit is connected to USB3.0 interface.
The realsense-viewer binary works fine and successfully connects to the RealSense hardware.
The librealsense repository is cloned from GitHub, and the appropriate python example (as above) is run (python3). Doesn't work - so I edited it with different sensor modes, as below.
$ rs-enumerate-devices
Device info:
Name : Intel RealSense SR300
Serial Number : 610205005115
Firmware Version : 3.10.10.0
Physical Port : /sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3.1/2-3.1:1.2/video4linux/video2
[rest of the output snipped, for brevity]
Stream Profiles supported by Coded-Light Depth Sensor
Supported modes:
stream resolution fps format
Infrared 1 640x480 @ 60Hz Y16
Infrared 1 640x480 @ 60Hz Y8
Infrared 1 640x240 @ 10Hz Y16
Depth 640x480 @ 60Hz Z16
Depth 640x480 @ 30Hz Z16
Depth 640x480 @ 10Hz Z16
Color 640x480 @ 10Hz RGB8
Color 640x480 @ 10Hz Y16
Color 640x480 @ 10Hz BGRA8
[I've snipped off most of the list of supported modes, for brevity]
The following modes are supported, so I'll choose the following. I figure that a conservative, low resolution and low frame rate gives the best chance of success.
Depth camera: 640x480, Z16, 10Hz
IR sensor: 640x480, Y8, 10Hz
RGB sensor: 640x480, Y16, 10Hz
Based on this enumeration supported modes on this hardware, I've edited the box_dimensioner_multicam_demo.py file as follows. (Sorry, not sure if we have code-formatting tags supported here.)
# Enable the streams from all the intel realsense devices
rs_config = rs.config()
rs_config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 10)
rs_config.enable_stream(rs.stream.infrared, 640, 480, rs.format.y8, 10)
rs_config.enable_stream(rs.stream.color, 640, 480, rs.format.y16, 10)
This fails with a "RuntimeError: object doesn't support option #18" error.
$ ./box_dimensioner_multicam_demo.py
1 devices have been found
Traceback (most recent call last):
File "./box_dimensioner_multicam_demo.py", line 144, in <module>
run_demo()
File "./box_dimensioner_multicam_demo.py", line 49, in run_demo
device_manager.enable_all_devices()
File "/home/dev/librealsense/wrappers/python/examples/box_dimensioner_multicam/realsense_device_manager.py", line 167, in enable_all_devices
self.enable_device(serial, enable_ir_emitter)
File "/home/dev/librealsense/wrappers/python/examples/box_dimensioner_multicam/realsense_device_manager.py", line 156, in enable_device
sensor.set_option(rs.option.emitter_enabled, 1 if enable_ir_emitter else 0)
RuntimeError: object doesn't support option #18
I've also got a L515 LiDAR device, so I also wanted to try the same example on the L515 hardware. Again, the hardware is connected to USB3, and the realsense-viewer works fine and detects the device.
$rs-enumerate-devices
Device info:
Name : Intel RealSense L515
Serial Number : 00000000f0090002
Firmware Version : 01.04.01.00
Recommended Firmware Version : 01.04.01.00
Physical Port : /sys/devices/pci0000:00/0000:00:14.0/usb2/2-3/2-3:1.0/video4linux/video0
[Rest of information snipped.]
Looking at the supported sensor resolutions and modes, we have IR 640x480, Y8 30Hz, Depth sensor 640x480, Z16 30Hz, and RGB 1280x720, Y16 6Hz. I've edited box_dimensioner_multicam_demo.py accordingly. (Again, I figure that a conservative, low resolution and low frame rate gives the best chance of success.)
rs_config = rs.config()
rs_config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
rs_config.enable_stream(rs.stream.infrared, 640, 480, rs.format.y8, 30)
rs_config.enable_stream(rs.stream.color, 1280, 720, rs.format.y16, 6)
$ ./box_dimensioner_multicam_demo.py
1 devices have been found
Traceback (most recent call last):
File "./box_dimensioner_multicam_demo.py", line 144, in <module>
run_demo()
File "./box_dimensioner_multicam_demo.py", line 49, in run_demo
device_manager.enable_all_devices()
File "/home/dev/librealsense/wrappers/python/examples/box_dimensioner_multicam/realsense_device_manager.py", line 167, in enable_all_devices
self.enable_device(serial, enable_ir_emitter)
File "/home/dev/librealsense/wrappers/python/examples/box_dimensioner_multicam/realsense_device_manager.py", line 156, in enable_device
sensor.set_option(rs.option.emitter_enabled, 1 if enable_ir_emitter else 0)
RuntimeError: object doesn't support option #18
Again, I get the same kind of error.
Any advice or suggestions on how to fix this would be appreciated.
-
The box_dimensioner_multicam sample program was designed for the 400 Series cameras that have Stereo technology (a depth image constructed from left and right infrared sensors). The SR300 and L515 are different technologies (Coded Light and Lidar specifically) and just have one IR stream.
An SR300 user once tried to adapt box_dimensioner_multicam for SR300 but encountered incompatibilities due to functions that were being called by the program that were not supported on SR300.
https://github.com/IntelRealSense/librealsense/issues/4760#issuecomment-526282375
A better sample program to test with may be align_depth2color as that is simply aligning the color stream with the depth stream.
Please sign in to leave a comment.
Comments
1 comment