Arducam 12MP PTZ camera not detected on Raspberry Pi Ubuntu 20 with Picamera2 import error

Hi everyone, I just got the Arducam 12MP PTZ camera module and I’m trying to use it with ROS on a Raspberry Pi. My plan is to build a ROS node that can dynamically change focal length/zoom and focus distance/focus. Is there any existing code or library I can use to send zoom/focus commands? I’ve followed all the tutorial steps, but the board doesn’t detect the camera at all.

Can you share a bit more about your setup? Which OS and board are you using, and which tutorial did you follow? If you have the exact command or error output that’s failing, paste it here so we can take a look.

I’m on Ubuntu 20 running on a Raspberry Pi with the Arducam 12MP PTZ module. The meson build step fails with this command:

meson build --buildtype=release -Dpipelines=raspberrypi -Dipas=raspberrypi -Dv4l2=true -Dgstreamer=enabled -Dtest=false -Dlc-compliance=disabled -Dcam=disabled -Dqcam=enabled -Ddocumentation=disabled -Dpycamera=enabled

Also, when I try to run AutoFocus.py I get:

ImportError: cannot import name ‘Picamera2’ from ‘picamera2’

Thanks, that helps narrow things down. The Picamera2 import error usually points to libcamera/picamera2 not being installed correctly or not being on the Python path, and the meson failure suggests the libcamera build didn’t complete cleanly. Which tutorial link are you working from? Also, have you tried a basic detection step to see whether the camera shows up before going through the full build?

I’ve been following this tutorial: https://www.arducam.com/doc-old/cameras-for-raspberry-pi/ptz-camera/how-to-run-ptz-cameras-in-ubuntu/ - I went through the whole thing and even reinstalled the OS three times, but Ubuntu still doesn’t recognize the camera. Honestly, if I could just get example Python code to change the focal length, that would be enough - I can write the ROS node myself.

Thanks for all the details. I’ve checked this against what you’re describing, and the Arducam 12MP PTZ camera is not currently compatible with ROS. The tutorial you followed is the right path for using the camera standalone, but there’s no ROS integration available right now, which is why the node and the dynamic focal-length/zoom/focus workflow you’re after isn’t working. The meson build failure and the ‘Cannot import name Picamera2 from picamera2’ error are consistent with the camera not being supported in that ROS setup. At the moment there’s no ROS code we can provide for zoom/focus control.

So there’s no workaround at all for sending zoom/focus commands from ROS? All I really need is a way to change the focal length dynamically.

Right now there’s no ROS compatibility available for this module, so we don’t have a working ROS node or sample we can point you to for focal length/zoom/focus control. I’m sorry for the trouble - if you have any further questions or concerns, feel free to post back and we’ll help however we can.