Files
RealSense-D435i-G1/docker-compose.yml
T
robot 07d95792e3 Initial commit: RealSense D435 API server
Drop-in replacement for the Nuwa-HP60C camera container, exposing RGB +
aligned depth + intrinsics via REST/WebSocket so the existing
pestello-pose-detector pipeline can consume frames without changes.

Key adaptations for D4xx on USB 2.0 (this robot has no USB 3 port exposed
externally — see STATUS.md):
- pyrealsense2 built from source; the librealsense v2.55.1 install rule
  doesn't ship the main .so, so we copy it from the build dir and add an
  __init__.py that re-exports the submodule.
- Color stream uses YUYV format on USB 2.x (BGR8/RGB8 time out on this
  bus); converted to BGR via cv2.cvtColor in capture().
- rs.align is skipped on USB 2 (incompatible with YUYV); color is
  cv2-resized to depth shape for approximate per-pixel alignment.
- Driver auto-detects usb_type_descriptor and falls back to the
  full-resolution BGR8 + rs.align pipeline when on USB 3.

Tested: /api/{health,status,discover,rgb,depth,depth/color,capture,
intrinsics} all return 200 with valid payloads at 640x480.
2026-05-19 00:58:23 +02:00

60 lines
1.5 KiB
YAML

services:
# -- NATS Server ----------------------------
nats:
image: nats:latest
profiles: ["nats"]
ports:
- "4222:4222"
- "8222:8222"
command: >
--auth ${NATS_TOKEN:-realsense-dev-token}
--http_port 8222
restart: unless-stopped
healthcheck:
test: ["CMD", "nats-server", "--help"]
interval: 5s
timeout: 3s
retries: 3
start_period: 5s
# -- Backend --------------------------------
backend:
build:
context: .
dockerfile: Dockerfile
# network: host so that build-time apt/git/pip can reach the
# tinyproxy running on the host at localhost:8888.
network: host
privileged: true
ports:
- "${API_PORT:-8878}:8878"
devices:
- "/dev/bus/usb:/dev/bus/usb"
volumes:
- ./images:/app/images
- ./models:/app/models:ro
env_file: .env
depends_on:
nats:
condition: service_healthy
required: false
restart: unless-stopped
healthcheck:
test: ["CMD", "python3", "-c", "import urllib.request; urllib.request.urlopen('http://localhost:8878/api/health')"]
interval: 10s
timeout: 5s
retries: 3
# -- Frontend React Dev (hot reload) --------
frontend-dev:
image: node:20-alpine
working_dir: /app
volumes:
- ./src/frontend/react:/app
- /app/node_modules
command: sh -c "npm ci && npm run dev -- --host 0.0.0.0"
ports:
- "5173:5173"
profiles: [dev]