zivid / zivid-cpp-samples

Code samples for the usage of a Zivid 3D camera in C++
BSD 3-Clause "New" or "Revised" License
21 stars 16 forks source link

Trace/breakpoint trap (core dumped) when visualizing point cloud #234

Open Nitrow opened 1 year ago

Nitrow commented 1 year ago

Hello Zivid. I have trouble with the stability of the visualizer. I'm using the from your examples CaptureWritePCLVis3D with the small modification that I simulate the camera with the FileCameraZividOne.zfc file. Whenever it tries to executes the visualization it crashes and gives me Trace/breakpoint trap (core dumped).

I'm using VTK 9.1 and have tried to use a never version from source but without luck. I'm also using PCL 1.12. This is what the terminal prints out.

Connecting to camera
Creating settings
Capturing frame
Converting Zivid point cloud to PCL format
Visualizing PCL point cloud
Press r to centre and zoom the viewer so that the entire cloud is visible
Press q to exit the viewer application
Trace/breakpoint trap (core dumped)

Hope someone can help.

Best regards, Asger Programmer LT Automation

andersfagerli commented 1 year ago

Hi, Asger

This seems to be an issue with the specific VTK or PCL version you are using. The sample runs fine on my system (using the file camera), although with some warnings from VTK. I am using PCL 1.9.1, which comes with VTK 8.1.2. I'll try to reproduce the error using your setup, but for now you might want to try PCL 1.9.1.

The samples should ideally work with newer versions of these libraries, so I will look into it.

Edit: I now ran the sample using PCL 1.12 and VTK 9.0, which worked fine. This is on Windows though. Looks like a problem with VTK, so I would check for similar issues there or make one. You can also try to reproduce it using a minimal example with PCL with visualizer (no Zivid libraries), just to verify that the error is on the VTK/PCL side.

andersfagerli commented 1 year ago

A bit late here, but there apparently is a bug with PCL/VTK for Ubuntu 22.04, which is causing this crash https://github.com/PointCloudLibrary/pcl/issues/5237.

A workaround is to build PCL from source as it seems to be fixed in master.