Quantcast
Channel: Raspberry Pi Forums
Viewing all articles
Browse latest Browse all 8023

Camera board • Problem: Using Picamera2 from ROS2 Docker (Jazzy/Humble) on Raspberry Pi

$
0
0
Hi everyone,

I'm working on a project where I want to stream video from the Raspberry Pi Camera using Picamera2 within a ROS2 Docker container.

📌 What I’ve Done So Far:

1.Camera works fine on host OS
I tested the Raspberry Pi Camera using tools like rpicam-hello and it works perfectly outside the container.

2.Started with a ROS2 Jazzy Docker Image
I pulled and ran the ros:jazzy Docker image using:

Code:

docker run -it --privileged -v /run/udev:/run/udev ros:jazzy
Then I tried to install and run picamera2, but got the error:

Code:

ModuleNotFoundError: No module named 'picamera2'
3.Tried to install picamera2 manually
Attempted to install it via pip, but it depends on system-level packages like libcamera, pykms, etc., which caused additional issues.

4.Switched to prebuilt ROS2 Humble Docker with Picamera2
I found this repository, which looked promising because it includes ROS2 Humble with picamera2 support preconfigured.
can found in this link:
https://github.com/nagtsnegge/PiCamera2 ... le-Docker

5. Build failed with KMS++ error
When building the Docker image from that repo:

Code:

docker build -t ros2-picamera2-demo .
It failed during the kmsxx installation step with a ninja build error:

Code:

FAILED: kms++/libkms++.so.0.0.0.p/src_crtc.cpp.o‘matPlaneInfo’ does not have ‘constexpr’ destructor
I even tried patching the build process with:

Code:

RUN sed -i '/meson.get_compiler/a add_project_arguments('\''-std=c++20'\'', language: '\''cpp'\'')' kmsxx/meson.build
But it didn’t fix the error.

🤔 My Goal:
I want to run picamera2 inside a ROS2 Docker container (Jazzy or Humble, doesn't matter), streaming from the Raspberry Pi camera, and eventually use this camera input in ROS2 nodes.

🙏 What I Need Help With:
- Has anyone successfully used picamera2 in a Docker container with ROS2?

- Is there a better base image or Dockerfile example that works out of the box?

- How can I work around the kmsxx / pykms build errors?

Any suggestions, working examples, or ideas are welcome!

Thanks in advance 🙏

dockerfile
Copy
Edit

Statistics: Posted by shlomu — Thu Apr 10, 2025 1:27 pm



Viewing all articles
Browse latest Browse all 8023

Trending Articles