Arducam TOF point cloud preview segfaults and RViz crashes on Raspberry Pi 3 ROS2

Hi all. I’m trying to get a point cloud from my Arducam TOF camera and it’s just not working. The camera gives me center distance, raw capture and a depth image, and the depth preview actually looks accurate. But the preview_pointcloud script segfaults every time. On top of that, in ROS2/Rviz the /point_cloud topic shows up with both PointCloud and PointCloud2 types, and Rviz crashes as soon as I try to add the topic. Anyone run into this?

Hi, could you give some details on your setup? Board, OS, and ROS2/Rviz versions would help narrow this down.

Sure. Raspberry Pi 3 running the latest PiOS. ROS2 is on Ubuntu 22.04.2 LTS and I’m using Rviz. Here’s the depth image so you can see the camera itself is producing decent output: Depth_Image

Thanks. When you run preview_pointcloud, what exactly is printed before the crash? Could you also run it with sudo and paste both outputs?

Without sudo it prints: VIDIOC_S_CTRL: Inappropriate ioctl for device, then segfaults. With sudo it’s: VIDIOC_S_CTRL: Inappropriate ioctl for device / No protocol specified / Aborted.

That VIDIOC_S_CTRL error usually means the code is trying to set a control the camera doesn’t support, so it might just be noise before the actual crash. Could you also post the cmake output from when you built the pointcloud preview? I want to check the dependency warnings.

Here it is: Cmake_Output.txt. There were warnings about missing packages/files for PCL, Boost and VTK. I also grabbed the exact Rviz warning when adding the topic: [WARN] [1676838211.107829390] [rviz2]: topic ‘/point_cloud’ has more than one types associated, rviz will arbitrarily use the type ‘sensor_msgs/msg/PointCloud’ – all types for the topic: ‘sensor_msgs/msg/PointCloud’ ‘sensor_msgs/msg/PointCloud2’.

Thanks. Can you list everything you’ve already tried? Also, when you add /point_cloud in Rviz, does it offer PointCloud instead of PointCloud2 before it crashes?

What I’ve tried so far: ran preview_pointcloud normally (segfault), ran it with sudo (No protocol specified, Aborted), verified ros2 talker/listener work fine, and opened Rviz to add the topic - it showed PointCloud instead of PointCloud2 and then crashed. My suspicion is the missing Boost/VTK/PCL dependencies are the root cause. Here’s the pointcloud visualization from before the crash: PointCloud_Visualization

Thanks, that’s really helpful. Based on all this, the /point_cloud topic is advertising two types at once - sensor_msgs/msg/PointCloud and sensor_msgs/msg/PointCloud2. Rviz arbitrarily picks PointCloud, and that mismatch is what leads to the crash. The missing PCL/Boost/VTK packages may also explain the pointcloud preview failure, but I can’t confirm the root cause from this alone yet. Could you run a diagnostic script on the device so we can see the full picture? I’ve sent you the bug report tool and exact steps via private message. In short: reboot the device, run the tool, and it will produce arducam-bug-report.txt in the current directory. Please attach that file here when it’s done.

Got it. I’ll run the script and attach arducam-bug-report.txt once it’s generated.

Perfect. Once we have the report we can dig into the missing PCL/Boost/VTK packages and the PointCloud vs PointCloud2 conflict properly. Quick summary of where we are: the Rviz crash appears to come from the topic advertising both types and Rviz selecting PointCloud, and the preview_pointcloud failure may be related to the missing dependencies, but the root cause isn’t confirmed yet. We’ll continue once your report is attached.