1 2 Previous Next 21 Replies Latest reply on Jun 6, 2018 8:17 AM by MartyG

    Intel D415 & Python 3.5

    Lab

      Hi everyone!
      I'm trying to use this camera with opencv. I'm using Xubuntu 16.04 and Python 3.5 with opencv and pyrealsense2 installed.

      If I try another camera it works (an old intel...I don't rimember the name but is a depth camera older than the ZR300) but if I plug the D415 pyrealsense2 can't find any realsense camera.

       

      What do I need to install? is there a documentation about this?

       

      Thank you!

        • 1. Re: Intel D415 & Python 3.5
          MartyG

          Hi Lab!  The documentation for SDK 2.0's Python wrapper is here:

           

          librealsense/wrappers/python at master · IntelRealSense/librealsense · GitHub

          • 2. Re: Intel D415 & Python 3.5
            Lab

            Hi Marty!

            thank you for the answer! Later I'll take a look and I'll let you know!

            • 3. Re: Intel D415 & Python 3.5
              Lab

              HI!

              I tried to follow the guide but when I try to launch the examples I've this error:

               

              INFO:pyrealsense.core:There are 0 connected RealSense devices.

              ERROR:pyrealsense.utils:rs_error was raised when calling rs_get_device(context:0x1fe6c40, index:0)

              ERROR:pyrealsense.utils:    out of range value for argument "index"

              Traceback (most recent call last):

                File "show_depth.py", line 39, in <module>

                  with serv.Device(streams=(depth_stream,)) as dev:

                File "/usr/local/lib/python3.5/dist-packages/pyrealsense-2.2-py3.5-linux-x86_64.egg/pyrealsense/core.py", line 125, in Device

                  return Device(self, *args, **kwargs)

                File "/usr/local/lib/python3.5/dist-packages/pyrealsense-2.2-py3.5-linux-x86_64.egg/pyrealsense/core.py", line 170, in Device

                  _check_error(e)

                File "/usr/local/lib/python3.5/dist-packages/pyrealsense-2.2-py3.5-linux-x86_64.egg/pyrealsense/utils.py", line 46, in _check_error

                  pp(lrs.rs_get_error_message, e))

              pyrealsense.utils.RealsenseError: rs_get_device(context:0x1fe6c40, index:0) crashed with: out of range value for argument "index"

              If I run "sudo lsusb" I've this:

              Bus 002 Device 004: ID 8086:0ad3 Intel Corp.

              Bus 002 Device 005: ID 8086:0ad3 Intel Corp.

              Bus 002 Device 001: ID 1d6b:0003 Linux Foundation 3.0 root hub

              Bus 001 Device 002: ID 8087:0a2b Intel Corp.

              Bus 001 Device 001: ID 1d6b:0002 Linux Foundation 2.0 root hub

              (there are actually 2 D415 connected with my NUC with Xubuntu 16.04)

               

               

              Any idea? Thank you!

              • 4. Re: Intel D415 & Python 3.5
                MartyG

                The closest example I could find to your problem (camera is not detected but lsusb can find it) is the case below.

                 

                R200 Realsense not detected on Linux Ubuntu · Issue #195 · IntelRealSense/librealsense · GitHub

                 

                In that case, the users fixed their problem temporarily with a chmod permissions change, and permanently by adding their username to a 'dialout group'.

                 

                sudo usermod -a -G dialout [put your username here without the brackets]

                • 5. Re: Intel D415 & Python 3.5
                  Lab

                  I tried but the problem remains...

                   

                   

                  • 6. Re: Intel D415 & Python 3.5
                    MartyG

                    I have analysed the problem many times.  It is a hard one, for sure.  I noticed though that the log makes reference to 'pyrealsense_2_2'.  This makes me wonder if you have installed a branch of 'pyrealsense 2.0', which works with old RealSense cameras such as the R200 but not with the new cameras, which need 'pyrealsense2' (which is different from the similarly named pyrealsense 2.0 for the older cameras).

                    • 7. Re: Intel D415 & Python 3.5
                      Lab

                      Yes that's because I used old intel camera with my software but now I installed pyrealsense 2.0 and it doesn't work anymore with old camera.

                       

                      What do you suggest? Should I make a clean installation?

                      • 8. Re: Intel D415 & Python 3.5
                        MartyG

                        It sounds like you would benefit from a clean installation with pyrealsense2 (the new one for the 400 Series cameras) to make sure there aren't crossed wires between programs.  At this point, it's certainly worth trying.

                        • 9. Re: Intel D415 & Python 3.5
                          Lab

                          Thank you for your time...

                           

                          I uninstalled librealsense and pyrealsense and reinstalled everything.

                           

                          now the error of the example (show_cv2.py) is this:

                           

                          INFO:pyrealsense.core:There are 0 connected RealSense devices.

                          ERROR:pyrealsense.utils:rs_error was raised when calling rs_get_device(context:0x269d470, index:0)

                          ERROR:pyrealsense.utils:    out of range value for argument "index"

                          Traceback (most recent call last):

                            File "show_cv2.py", line 12, in <module>

                              with serv.Device() as dev:

                            File "/home/stark/.local/lib/python3.5/site-packages/pyrealsense/core.py", line 125, in Device

                              return Device(self, *args, **kwargs)

                            File "/home/stark/.local/lib/python3.5/site-packages/pyrealsense/core.py", line 170, in Device

                              _check_error(e)

                            File "/home/stark/.local/lib/python3.5/site-packages/pyrealsense/utils.py", line 46, in _check_error

                              pp(lrs.rs_get_error_message, e))

                          pyrealsense.utils.RealsenseError: rs_get_device(context:0x269d470, index:0) crashed with: out of range value for argument "index"

                          • 10. Re: Intel D415 & Python 3.5
                            MartyG

                            Are you able to run a RealSense program such as the RealSense Viewer and confirm that the camera is working, even though it is detected?   In particular, you could check in the RealSense Viewer program whether the camera is listed as "Intel RealSense D415" (showing it is fully functioning) or listed as 'Intel RealSense USB2' (indicating that it is only functioning in a very limited USB 2.0 mode).

                            • 11. Re: Intel D415 & Python 3.5
                              Lab

                              Yes, I tried it with windows 10 (in another machine) with RealSense Viewer and it is listed as Intel Realsense D415 (usb symbol) 2.1

                               

                              I also updated the firmware

                              • 12. Re: Intel D415 & Python 3.5
                                MartyG

                                The USB2 status is related to the USB ports on a particular machine, not to the camera hardware.  So the camera may work fine on one machine but have the function-limiting USB2 problem on another machine.  That's why it is important to establish whether the USB2 problem is present on the machine you are using for Python. 

                                • 13. Re: Intel D415 & Python 3.5
                                  Lab

                                  Ok I tried on xubuntu too and Intel RealSense Viewer it works.

                                  The camera is listed as Intel RealSense D415 (usb symbol) 3.1

                                  • 14. Re: Intel D415 & Python 3.5
                                    Lab

                                    is it possible that D415 cameras don't work with python3.5 but only with python3.6?

                                    1 2 Previous Next