ArduCam ToF camera distance values nan and missing ArduCamDepthCamera.h on Raspberry Pi 3B+

Hi, I’m trying to get the Arducam Time-of-Flight camera working on a Raspberry Pi 3B+. When I run the test_c C file I get this warning:

TOFCamera: Could not set current frame format

Also, when I try to compile in Geany it tells me there’s no ArduCamDepthCamera.h file in the folder. I followed the troubleshooting steps and ran:

pip3 list | grep ArduCamDepthCamera

but nothing appears in the terminal at all. Any idea what’s going on?

That mix of the frame format warning and the missing header usually means the Tof project download is outdated or incomplete. If the header isn’t there and the Python package check comes back empty, you’re probably missing parts of the project. Can you re-download the full project from GitHub - ArduCAM/Arducam_tof_camera · GitHub and try again from that fresh copy? Let me know what changes.

So I re-downloaded the project and ran it again. Now the preview windows pop up and the images look correct, but the select rect distance values are showing nan. I still get TOFCamera: Could not set current frame format when running the test_c file, Geany still complains about ArduCamDepthCamera.h, and pip3 list | grep ArduCamDepthCamera still returns nothing. I’ve attached a screenshot of what I’m seeing.

Good to hear the preview images are coming up now. For the nan distance values, the most common cause is that the window/panel hasn’t actually been selected before the distance is read. Try clicking directly on the panel of the window to select the rect region, then check the values again. Can you also share those preview screenshots so I can see the window state?

Sure, here are the preview images of the ToF camera windows I’m getting.

Thanks. Looking at these, it seems the window hadn’t been selected when the distance values were read. nan in the select rect distance usually means no valid distance region was being measured. Click the panel of the window first to select it, and the rect distance values should start showing real numbers instead of nan.

Thanks, I’ll try that. On a different note, I’m now working with the point cloud preview. When I run cmake inside the build folder of pcl_preview, I get a bunch of warnings (screenshots attached). The build completes, but running the built point cloud code gives me segmentation fault. Could some packages be missing? I’ve already checked and updated the Arducam_tof_camera files/folder, and I also looked through the Python code and noticed the clicking events.

That segmentation fault after a successful build of the pcl_preview point cloud code sounds like a known Point Cloud Library issue, possibly related to missing packages or a PCL defect. Please refer to this PCL GitHub issue thread for guidance: [Visualization] CloudViewer segfaults with PCL 1.12.1 and VTK 9.1 on Ubuntu 22.04 · Issue #5237 · PointCloudLibrary/pcl · GitHub