feat: support multiple camera previews and concurrent agent code navigation

This commit is contained in:
2026-10-20 10:10:48 +09:00
parent c17763f59d
commit af54e875df
13 changed files with 525 additions and 160 deletions
+29 -2
View File
@@ -2563,6 +2563,23 @@ async function startRemoteVisualizationBridge(
].join('\n'), 900_000)
}
const command = bridgeContainerCommand(stack)
let bridgeContextRevision: string | null = null
if (stack !== 'autoware') {
const context = resolveResourceContextPath('resources/slam-ros-bridge')
if (!context) throw new Error('Bundled SLAM bridge source is missing')
const files = { 'bridge.py': await readFile(join(context, 'bridge.py'), 'utf8'), 'requirements.txt': await readFile(join(context, 'requirements.txt'), 'utf8') }
bridgeContextRevision = createHash('sha256').update(JSON.stringify(files)).digest('hex')
await runUnqueuedSshOutput(target, `python3 -c ${quoteShellSingle([
'import json, os, pathlib, sys',
'data = json.load(sys.stdin)',
'root = pathlib.Path.home() / ".autonomy-studio/runtime/bridges" / data["revision"]',
'root.mkdir(parents=True, exist_ok=True)',
'for name in ("bridge.py", "requirements.txt"):',
' temporary = root / ("." + name + "." + str(os.getpid()) + ".tmp")',
' temporary.write_text(data["files"][name], encoding="utf-8")',
' temporary.replace(root / name)',
].join('\n'))}`, 30_000, JSON.stringify({ revision: bridgeContextRevision, files }))
}
reportVisualizationProgress('시각화 시작 중...')
@@ -2580,6 +2597,7 @@ async function startRemoteVisualizationBridge(
'docker run -d --name "$CONTAINER" --net=host',
'-v /dev/shm:/dev/shm',
'-v "$ROOT:/workspace"',
...(bridgeContextRevision ? [`-v "$HOME/.autonomy-studio/runtime/bridges/${bridgeContextRevision}:/app:ro"`] : []),
...(fastDdsConfigPath ? ['-v "$FASTDDS_CONFIG_PATH:/fastdds_profiles.xml:ro"', '-e FASTDDS_DEFAULT_PROFILES_FILE=/fastdds_profiles.xml', '-e FASTRTPS_DEFAULT_PROFILES_FILE=/fastdds_profiles.xml'] : []),
'-e "ROS_DOMAIN_ID=$ROS_DOMAIN_ID"',
'-e ROS_LOCALHOST_ONLY=0',
@@ -4777,10 +4795,19 @@ function buildNav2DockerRunScript(): string {
'test -f "$MODULE_ROOT/$MODULE_FOLDER/install/setup.bash" || { echo "Module is not built: $MODULE_FOLDER" >&2; exit 1; }',
...yahboomDevicePreflight(),
'CAMERA_DEVICE=""',
'CAMERA_DEVICES=()',
'if [[ "$MODULE_FOLDER" == *lms-nav2-camera-test* ]]; then',
' CAMERA_DEVICE=/dev/video0',
' for arg in "$@"; do case "$arg" in video_device:=*) CAMERA_DEVICE=${arg#video_device:=} ;; esac; done',
' [[ "$CAMERA_DEVICE" =~ ^/dev/video[0-9]+$ ]] && [ -c "$CAMERA_DEVICE" ] || { echo "Camera device not found: $CAMERA_DEVICE" >&2; exit 1; }',
' if [ "$CAMERA_DEVICE" = /dev ]; then',
' CAMERA_DISCOVERY="$MODULE_ROOT/$MODULE_FOLDER/src/camera_test_pkg/camera_test_pkg/devices.py"',
' test -f "$CAMERA_DISCOVERY" || { echo "Update and rebuild the camera module for automatic discovery" >&2; exit 1; }',
' camera_devices=$(python3 "$CAMERA_DISCOVERY" /dev) || exit 1',
' mapfile -t CAMERA_DEVICES <<< "$camera_devices"',
' else CAMERA_DEVICES=("$CAMERA_DEVICE"); fi',
' for camera_device in "${CAMERA_DEVICES[@]}"; do',
' [[ "$camera_device" =~ ^/dev/video[0-9]+$ ]] && [ -c "$camera_device" ] || { echo "Camera device not found: $camera_device" >&2; exit 1; }',
' done',
'fi',
'docker rm -f "$CONTAINER_NAME" >/dev/null 2>&1 || true',
'',
@@ -4800,7 +4827,7 @@ function buildNav2DockerRunScript(): string {
')',
'if [ -n "$YAHBOOM_DEVICE" ]; then args+=(--device "$YAHBOOM_DEVICE:$YAHBOOM_DEVICE"); fi',
'if [ -n "$CAMERA_DEVICE" ]; then',
' args+=(--device "$CAMERA_DEVICE:$CAMERA_DEVICE")',
' for camera_device in "${CAMERA_DEVICES[@]}"; do args+=(--device "$camera_device:$camera_device"); done',
' for capture_device in /dev/capture-vi-channel*; do',
' if [ -c "$capture_device" ]; then args+=(--device "$capture_device:$capture_device"); fi',
' done',