Thanks to visit codestin.com
Credit goes to github.com

Skip to content

Peach-CN/ros2_docker

 
 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

10 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

🚀 Raspberry Pi Docker Setup with ROS 2 & Picamera

Platform: Raspberry Pi Docker ROS 2 Jazzy

This repository helps you run ROS 2 Jazzy inside Docker with full support for:

  • 🖼️ libcamera (via Picamera2)
  • 🧠 Hailo AI HAT (for real-time edge AI)

🛠️ Requirements

  • Raspberry Pi running 64-bit Debian Bookworm
  • Docker installed on both Raspberry Pi and development machine

📦 Docker Image Build

✅ Initialize multi arch builder on amd64 (your desktop/laptop)

docker buildx create --name multiarch-builder --node amd64-node --platform liunx/amd64 --driver docker-container
docker buildx create --name multiarch-builder --node arm64-node --platform linux/arm64 --driver docker-container ssh://PI_USER@PI_IP_ADDRESS --append
docker buildx inspect --bootstrap

✅ On amd64 (your desktop/laptop)

Cross-compile the image for the Raspberry Pi (ARM64) and push it to your container registry or use --load:

docker buildx build \
  --platform linux/arm64 \
  -t ghcr.io/open-vehicle-control-system/ovcs-ros2-bookworm-jazzy-rpi:latest \
  -f dockerfile/debian-bookworm-jazzy/raspberry/Dockerfile \
  --push \
  dockerfile/debian-bookworm-jazzy/raspberry
docker buildx build \
  --platform linux/arm64,linux/amd64 \
  -t ghcr.io/open-vehicle-control-system/zenoh:1.4.0 \
  -f dockerfile/zenoh/Dockerfile \
  --push \
  dockerfile/zenoh
docker build \
  -t ghcr.io/open-vehicle-control-system/ovcs-ros2-noble-jazzy-desktop:latest \
  -f dockerfile/ubuntu-24-04-jazzy/desktop/Dockerfile \
  dockerfile/ubuntu-24-04-jazzy/desktop

🍓 On Raspberry Pi

🔧 Build the image locally:

docker build \
  -t ghcr.io/open-vehicle-control-system/ovcs-ros2-bookworm-jazzy-rpi:latest \
  -f dockerfile/debian-bookworm-jazzy/raspberry/Dockerfile \
  dockerfile/debian-bookworm-jazzy/raspberry

🎥 Run the container with Picamera2 support:

docker run --rm -it \
  --privileged \
  -v /run/udev:/run/udev:ro \
  ghcr.io/open-vehicle-control-system/ovcs-ros2-bookworm-jazzy-rpi:latest

🔐 The --privileged flag and /run/udev volume mount are required for camera hardware access.


🔄 Resetting cloud-init State (Optional)

If you need to reset your cloud-init setup (for example, to regenerate SSH keys or re-run first boot configs):

sudo vi /boot/firmware/user-data
cloud-init schema --config-file /boot/firmware/user-data
sudo cloud-init clean

📚 Resources


🧪 Tested On

  • Raspberry Pi 5 (64-bit Ubuntu 24.04)
  • Docker >= 24.x
  • ROS 2 Jazzy
  • Picamera2 v0.3+

Happy hacking! 🧪🔬

ls /dev/input/by-id/ readlink -f /dev/input/by-id/usb-Microsoft_Controller_3039373130343938333434343332-event-joystick

docker run --rm -ti --net host --device=/dev/input/js0 --device=/dev/input/event18 ghcr.io/open-vehicle-control-system/ovcs-ros2-noble-jazzy-desktop:latest ros2 run joy joy_node https://docs.ros.org/en/jazzy/p/joy/

About

No description, website, or topics provided.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

  • Dockerfile 94.2%
  • Shell 5.8%