Items with no label
3335 Discussions

core dump error with sample code for opencv librealsense streaming

sdas17
Beginner
3,497 Views

I am trying to use the code at https://software.intel.com/en-us/articles/using-librealsense-and-opencv-to-stream-rgb-and-depth-data https://software.intel.com/en-us/articles/using-librealsense-and-opencv-to-stream-rgb-and-depth-data.

I am using ubuntu 16.04.1 LTS with opencv 3.1 and SR300 camera.

I can successfully compile the code using Eclipse with std=c++11. However on running the code I get core dumped error.

terminate called after throwing an instance of 'rs::error'

what(): ioctl failed on UVC_GET_MAX

Aborted (core dumped)

0 Kudos
9 Replies
MartyG
Honored Contributor III
590 Views

I would ask first if your project is using kernel version 4.8. Librealsense only works with Ubuntu up til kernel 4.4. An update for support for kernel 4.8 is on the librealsense team's to-do list but is not released yet.

https://github.com/IntelRealSense/librealsense/issues/444 Uvcvideo patching issue · Issue # 444 · IntelRealSense/librealsense · GitHub

0 Kudos
sdas17
Beginner
590 Views

I am using ubuntu kernel version: 4.4.0-72-generic.

0 Kudos
MartyG
Honored Contributor III
590 Views

Ok, thanks.

My research indicates that the Aborted (core dumped) error most commonly happens because the camera was not detected or the camera disconnected, due to issues with the USB port not being able to reliably supply enough power to the camera. The most successful solution for this problem is to plug the camera into a mains-powered USB hub instead of directly into the PC's USB port. Powered hubs can be purchased for around $15 from stores such as Amazon by searching for 'powered usb 3.0 hub'.

0 Kudos
sdas17
Beginner
590 Views

I did lsusb, it showed

Bus 002 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

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

Bus 001 Device 002: ID 8087:0024 Intel Corp. Integrated Rate Matching Hub

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

Bus 004 Device 005: ID 8086:0a66 Intel Corp.

Bus 004 Device 004: ID 05e3:0616 Genesys Logic, Inc. hub

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

Bus 003 Device 005: ID 041e:4099 Creative Technology, Ltd

Bus 003 Device 004: ID 05e3:0610 Genesys Logic, Inc. 4-port hub

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

Does it suggest that the SR300 is not powered properly.

0 Kudos
MartyG
Honored Contributor III
590 Views

An easy way to test the camera is to use the Camera Explorer application. You can find this by typing 'camera explorer' into the text box at the bottom of your Windows screen, next to the button where you shut down. If there is a detection problem with your camera then it should say 'not connected'. If it does show as connected, you can click on the camera to bring up a range of options to run tests on the camera.

0 Kudos
sdas17
Beginner
590 Views

I am on linux. Is there any librealsense binary which will give some indication if the camera is connected properly.

0 Kudos
MartyG
Honored Contributor III
590 Views

Yes, sorry, it just occurred to me that you'd likely be on Linux if you were using librealsense. My apologies!

Apparently the camera power status can be checked with the instruction Is_Powered. The only example script I could find that uses this is this rather complex one.

https://github.com/intel-ros/realsense/pull/99/files Added services to start and stop the camera by rjingar · Pull Request # 99 · intel-ros/realsense · GitHub

Edit: if all that you want to do is check the camera, you may only need the line that deals with that check:

+bool is_powered

0 Kudos
sdas17
Beginner
590 Views

Do I also need to install realsense_sdk to make librealsense opencv work?

0 Kudos
MartyG
Honored Contributor III
590 Views

You should only need to install Librealsense to use it with OpenCV, as the Librealsense SDK and the RealSense SDK are separate programs.

0 Kudos
Reply