IntelRealSense / librealsense

Intel® RealSense™ SDK
https://www.intelrealsense.com/
Apache License 2.0
7.53k stars 4.81k forks source link

Segmentation Fault When Using PySpin with pyrealsense2 #12459

Closed kboseong closed 9 months ago

kboseong commented 9 months ago
Required Info
Camera Model D435
Firmware Version 5.15.1
Operating System & Version Ubuntu 20.04
Kernel Version (Linux Only) 5.15.0-89-generic
Platform PC
SDK Version pyrealsense2-2.53.1.4623
Language python
Segment Robot

Issue Description

Hello, I am currently developing a Python software for simultaneous use of a depth camera and a thermal camera. I am encountering a problem when using the PySpin library (for controlling FLIR cameras) in conjunction with pyrealsense2.

Issue Details Problem: When I declare PySpin.System.GetInstance() and then execute pipeline.start(), a segmentation fault error occurs. Impact: Once this error occurs, all software related to the Realsense camera, including the realsense-viewer, fails to operate. However, after restarting the system, running the Realsense software alone works fine.

Code

import PySpin
import pyrealsense2 as rs

system = PySpin.System.GetInstance()

pipeline = rs.pipeline()
config = rs.config()
config.enable_stream(rs.stream.depth, 640, 480, rs.format.z16, 30)
config.enable_stream(rs.stream.color, 640, 480, rs.format.rgb8, 30)

profile = pipeline.start(config)

System Configuration PySpin version: spinnaker_python-3.1.0.79-cp38-cp38-linux_x86_64 (Describe other information is at above)

Request for Assistance I would appreciate any insights or suggestions on how to resolve this issue. Is there a known compatibility issue between these libraries, or could it be related to the order of operations in my code? Any help or guidance would be greatly appreciated.

MartyG-RealSense commented 9 months ago

Hi @kboseong Does the segmentation fault still occur if the thermal camera is detacted, please?

There is a project at the links below that uses RealSense and PySpin with a FLIR infrared camera that you could compare to your own project.

https://github.com/vigitia/IRPenTracking

RealSense 400 Series cameras do not experience interference from non-RealSense cameras that use infrared, but the 400 Series camera can interfere with non-RealSense cameras in return.

MartyG-RealSense commented 9 months ago

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

MartyG-RealSense commented 9 months ago

Case closed due to no further comments received.