feat(camera): discover and publish multiple capture devices

This commit is contained in:
2026-10-20 10:05:58 +09:00
parent 7e76921c5e
commit 87b452035b
6 changed files with 199 additions and 14 deletions
+12 -2
View File
@@ -11,11 +11,21 @@ DEVICE=/dev/video0
for arg in "$@"; do
case "$arg" in video_device:=*) DEVICE=${arg#video_device:=} ;; esac
done
[[ "$DEVICE" =~ ^/dev/video[0-9]+$ ]] && [ -c "$DEVICE" ] || { echo "Camera device not found: $DEVICE" >&2; exit 1; }
devices=()
if [ "$DEVICE" = /dev ]; then
discovered=$(python3 "$MODULE_PATH/src/camera_test_pkg/camera_test_pkg/devices.py" /dev) || exit 1
mapfile -t devices <<< "$discovered"
else
devices=("$DEVICE")
fi
for device in "${devices[@]}"; do
[[ "$device" =~ ^/dev/video[0-9]+$ ]] && [ -c "$device" ] || { echo "Camera device not found: $device" >&2; exit 1; }
done
test -f "$MODULE_PATH/install/setup.bash" || { echo 'Module is not built' >&2; exit 1; }
docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true
device_args=(--device "$DEVICE:$DEVICE")
device_args=()
for device in "${devices[@]}"; do device_args+=(--device "$device:$device"); done
# Jetson VI capture opens additional channel devices from the container.
for capture_device in /dev/capture-vi-channel*; do
if [ -c "$capture_device" ]; then