diff --git a/README.md b/README.md index 237327f..2f824ff 100644 --- a/README.md +++ b/README.md @@ -28,7 +28,7 @@ ROS 1/2 bridge container with dual Humble + Jazzy targets — `ros:${ROS2_DISTRO ```bash ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # pick a bridge config (gitignored, per-clone). Skip to use the demo fallback. -./build.sh && ./run.sh # default ROS2_DISTRO=humble (set via setup.conf [build] arg_4) +make build && make run # default ROS2_DISTRO=humble (set via setup.conf [build] arg_4) ``` Skipping the `ln -sf` step is fine — the Dockerfile falls back to @@ -65,13 +65,13 @@ for the full migration rationale. ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # 1. Build -./build.sh +make build # 2. Run (requires ROS master running) -./run.sh +make run # 3. Enter running container -./exec.sh +make exec ``` ## Switch ROS 2 distro @@ -80,17 +80,17 @@ Default is `humble` (jammy 22.04). To switch to `jazzy` (noble 24.04), update `setup.conf [build] arg_4` via the CLI: ```bash -./setup.sh set build.arg_4 ROS2_DISTRO=jazzy -./build.sh && ./run.sh +make setup -- set build.arg_4 ROS2_DISTRO=jazzy +make build && make run ``` `set` writes the value into `setup.conf [build] arg_4` (creating the -section / key if absent). `./build.sh` then detects the drift via the +section / key if absent). `make build` then detects the drift via the `setup.conf` hash baked into `.env`, regenerates `.env` + `compose.yaml`, and rebuilds. The image tag (`yunchien/ros1_bridge:devel` etc.) is unchanged across distros — switching rebuilds in place. -For an interactive picker, run `./setup_tui.sh` (dialog / whiptail +For an interactive picker, run `make setup-tui` (dialog / whiptail frontend) and change `[build] arg_4` there. CI builds both distros in parallel via the matrix in `.github/workflows/main.yaml`, @@ -103,9 +103,9 @@ regardless of what `setup.conf` says. ### Build ```bash -./build.sh # Build devel (default) -./build.sh -t test # Build with smoke tests -./build.sh -t runtime # Build the lean runtime image +make build # Build devel (default) +make build test # Build with smoke tests +make build -- -t runtime # Build the lean runtime image ``` ### Run @@ -113,14 +113,14 @@ regardless of what `setup.conf` says. Two modes, picked by stage target: ```bash -./run.sh # devel: interactive bash shell, bridge NOT running -./run.sh -d # devel detached, join via ./exec.sh +make run # devel: interactive bash shell, bridge NOT running +make run -- -d # devel detached, join via make exec ``` For `runtime` (auto-starts the bridge via the Dockerfile `CMD`): ```bash -./run.sh -t runtime # Start runtime service. Entrypoint sources both +make run -- -t runtime # Start runtime service. Entrypoint sources both # ROS distros, rosparam loads /bridge.yaml, then # exec's `ros2 run ros1_bridge parameter_bridge`. # Requires roscore already running on the host network. @@ -129,8 +129,8 @@ For `runtime` (auto-starts the bridge via the Dockerfile `CMD`): ### Enter running container ```bash -./exec.sh -./exec.sh bash +make exec +make exec bash ``` ## Bridge Configuration @@ -198,19 +198,19 @@ use the same pattern: a **server** terminal that owns `roscore` + | Demo | Terminal 1 (server) | Terminal 2 (client) | |------|---------------------|---------------------| -| A — ROS 1 → ROS 2 | `./exec.sh /root/demo/ros1_server.sh` | `./exec.sh /root/demo/ros2_client.sh` | -| B — ROS 2 → ROS 1 | `./exec.sh /root/demo/ros2_server.sh` | `./exec.sh /root/demo/ros1_client.sh` | +| A — ROS 1 → ROS 2 | `make exec -- /root/demo/ros1_server.sh` | `make exec -- /root/demo/ros2_client.sh` | +| B — ROS 2 → ROS 1 | `make exec -- /root/demo/ros2_server.sh` | `make exec -- /root/demo/ros1_client.sh` | -Steps (assuming the container is up via `./run.sh -d`): +Steps (assuming the container is up via `make run -- -d`): ```bash # Terminal 1 (server) — pick one demo -./exec.sh /root/demo/ros1_server.sh # Demo A -./exec.sh /root/demo/ros2_server.sh # Demo B +make exec -- /root/demo/ros1_server.sh # Demo A +make exec -- /root/demo/ros2_server.sh # Demo B # Terminal 2 (client) — matching pair -./exec.sh /root/demo/ros2_client.sh # Demo A -./exec.sh /root/demo/ros1_client.sh # Demo B +make exec -- /root/demo/ros2_client.sh # Demo A +make exec -- /root/demo/ros1_client.sh # Demo B ``` Server scripts log every step (`[ros1_server] step N/5: ...`) so it's @@ -218,7 +218,7 @@ clear when `roscore` and `parameter_bridge` are up. Override the published string with `MESSAGE`: ```bash -./exec.sh env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh +make exec -- env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh ``` `Ctrl+C` on the server terminal tears down `parameter_bridge` and @@ -258,13 +258,16 @@ ros1_bridge/ ├── compose.yaml # Docker Compose definition ├── Dockerfile # Multi-stage build (devel + runtime + test); source-builds Noetic + ros1_bridge ├── setup.conf # Repo override; [build] arg_4=ROS2_DISTRO selects humble|jazzy -├── build.sh -> .base/script/docker/build.sh # Symlink -├── run.sh -> .base/script/docker/run.sh # Symlink -├── exec.sh -> .base/script/docker/exec.sh # Symlink -├── stop.sh -> .base/script/docker/stop.sh # Symlink -├── Makefile -> .base/script/docker/Makefile # Symlink +├── Makefile -> .base/script/docker/Makefile # Symlink (canonical entry: make build/run/exec/stop) ├── .base/ # Shared scripts, tests, CI (git subtree; version pinned in .base/.version) ├── script/ +│ ├── build.sh -> ../.base/script/docker/build.sh # Wrapper symlinks +│ ├── run.sh -> ../.base/script/docker/run.sh +│ ├── exec.sh -> ../.base/script/docker/exec.sh +│ ├── stop.sh -> ../.base/script/docker/stop.sh +│ ├── setup.sh -> ../.base/script/docker/setup.sh +│ ├── setup_tui.sh -> ../.base/script/docker/setup_tui.sh +│ ├── prune.sh -> ../.base/script/docker/prune.sh │ ├── entrypoint.sh # Sources ROS 1 + ROS 2, loads bridge config │ ├── ros_entrypoint.sh # ROS env only (osrf-compatible) │ ├── ros1_server.sh # Demo A publisher (bootstraps roscore + bridge) diff --git a/doc/README.ja.md b/doc/README.ja.md index f903ee7..2a0b66d 100644 --- a/doc/README.ja.md +++ b/doc/README.ja.md @@ -28,7 +28,7 @@ ROS 1/2 ブリッジコンテナ、**Humble + Jazzy のデュアルターゲッ ```bash ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # ブリッジ設定を選択(gitignored、clone 単位)。スキップしても demo にフォールバック。 -./build.sh && ./run.sh # デフォルト ROS2_DISTRO=humble(setup.conf [build] arg_4 で設定) +make build && make run # デフォルト ROS2_DISTRO=humble(setup.conf [build] arg_4 で設定) ``` `ln -sf` ステップをスキップしても問題ありません — Dockerfile が @@ -67,13 +67,13 @@ Fast-DDS のメジャーバージョン差 + REP-2011 type-hash 不一致によ ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # 1. ビルド -./build.sh +make build # 2. 実行(ROS master が起動済みであること) -./run.sh +make run # 3. 起動中のコンテナに接続 -./exec.sh +make exec ``` ## ROS 2 distro の切り替え @@ -82,17 +82,17 @@ ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml CLI 経由で `setup.conf [build] arg_4` を更新します: ```bash -./setup.sh set build.arg_4 ROS2_DISTRO=jazzy -./build.sh && ./run.sh +make setup -- set build.arg_4 ROS2_DISTRO=jazzy +make build && make run ``` `set` は値を `setup.conf [build] arg_4` に書き込みます(section / key が -無ければ作成)。`./build.sh` は `.env` 内の `setup.conf` hash で変更を +無ければ作成)。`make build` は `.env` 内の `setup.conf` hash で変更を 検知し、`.env` + `compose.yaml` を自動再生成して rebuild します。image tag(`yunchien/ros1_bridge:devel` 等)は distro を跨いで変わらず、 切り替えはその場で rebuild されます。 -対話的に編集する場合は `./setup_tui.sh`(dialog / whiptail フロントエンド) +対話的に編集する場合は `make setup-tui`(dialog / whiptail フロントエンド) を実行し、TUI で `[build] arg_4` を変更します。 CI は `.github/workflows/main.yaml` の matrix で両 distro を並列 build します。 @@ -104,9 +104,9 @@ setup.conf の変更はローカル build のみに影響し、`ghcr.io/ycpss912 ### ビルド ```bash -./build.sh # devel をビルド(デフォルト) -./build.sh -t test # smoke test 付きビルド -./build.sh -t runtime # 軽量な runtime image をビルド +make build # devel をビルド(デフォルト) +make build test # smoke test 付きビルド +make build -- -t runtime # 軽量な runtime image をビルド ``` ### 実行 @@ -114,14 +114,14 @@ setup.conf の変更はローカル build のみに影響し、`ghcr.io/ycpss912 stage target に応じて 2 モード: ```bash -./run.sh # devel:対話 bash シェル、bridge は自動起動しない -./run.sh -d # devel をバックグラウンド起動、./exec.sh で接続 +make run # devel:対話 bash シェル、bridge は自動起動しない +make run -- -d # devel をバックグラウンド起動、make exec で接続 ``` `runtime`(Dockerfile `CMD` 経由で bridge 自動起動): ```bash -./run.sh -t runtime # runtime service を起動。entrypoint が両 ROS を +make run -- -t runtime # runtime service を起動。entrypoint が両 ROS を # source、rosparam load /bridge.yaml、その後 # `ros2 run ros1_bridge parameter_bridge` を exec # します。前提:host network 上に roscore が @@ -131,8 +131,8 @@ stage target に応じて 2 モード: ### 起動中のコンテナに接続 ```bash -./exec.sh -./exec.sh bash +make exec +make exec bash ``` ## ブリッジ設定 @@ -202,19 +202,19 @@ terminal は subscribe するだけです。 | Demo | Terminal 1 (server) | Terminal 2 (client) | |------|---------------------|---------------------| -| A — ROS 1 → ROS 2 | `./exec.sh /root/demo/ros1_server.sh` | `./exec.sh /root/demo/ros2_client.sh` | -| B — ROS 2 → ROS 1 | `./exec.sh /root/demo/ros2_server.sh` | `./exec.sh /root/demo/ros1_client.sh` | +| A — ROS 1 → ROS 2 | `make exec -- /root/demo/ros1_server.sh` | `make exec -- /root/demo/ros2_client.sh` | +| B — ROS 2 → ROS 1 | `make exec -- /root/demo/ros2_server.sh` | `make exec -- /root/demo/ros1_client.sh` | -実際の手順(コンテナを `./run.sh -d` で起動済みとして): +実際の手順(コンテナを `make run -- -d` で起動済みとして): ```bash # Terminal 1 (server) — どちらかを選択 -./exec.sh /root/demo/ros1_server.sh # Demo A -./exec.sh /root/demo/ros2_server.sh # Demo B +make exec -- /root/demo/ros1_server.sh # Demo A +make exec -- /root/demo/ros2_server.sh # Demo B # Terminal 2 (client) — 対応するもう一方 -./exec.sh /root/demo/ros2_client.sh # Demo A -./exec.sh /root/demo/ros1_client.sh # Demo B +make exec -- /root/demo/ros2_client.sh # Demo A +make exec -- /root/demo/ros1_client.sh # Demo B ``` Server スクリプトは各ステップを明示的にログ出力します @@ -223,7 +223,7 @@ Server スクリプトは各ステップを明示的にログ出力します `MESSAGE` 環境変数で上書き可能です: ```bash -./exec.sh env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh +make exec -- env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh ``` Server terminal で `Ctrl+C` を押すと `parameter_bridge` と `roscore` @@ -263,13 +263,16 @@ ros1_bridge/ ├── compose.yaml # Docker Compose 定義 ├── Dockerfile # マルチステージビルド(devel + runtime + test);source-builds Noetic + ros1_bridge ├── setup.conf # Repo override;[build] arg_4=ROS2_DISTRO で humble|jazzy を選択 -├── build.sh -> .base/script/docker/build.sh # Symlink -├── run.sh -> .base/script/docker/run.sh # Symlink -├── exec.sh -> .base/script/docker/exec.sh # Symlink -├── stop.sh -> .base/script/docker/stop.sh # Symlink -├── Makefile -> .base/script/docker/Makefile # Symlink +├── Makefile -> .base/script/docker/Makefile # Symlink ├── .base/ # 共有スクリプト、テスト、CI(git subtree;バージョンは .base/.version) ├── script/ +│ ├── build.sh -> ../.base/script/docker/build.sh # Wrapper symlinks +│ ├── run.sh -> ../.base/script/docker/run.sh +│ ├── exec.sh -> ../.base/script/docker/exec.sh +│ ├── stop.sh -> ../.base/script/docker/stop.sh +│ ├── setup.sh -> ../.base/script/docker/setup.sh +│ ├── setup_tui.sh -> ../.base/script/docker/setup_tui.sh +│ ├── prune.sh -> ../.base/script/docker/prune.sh │ ├── entrypoint.sh # ROS 1 + ROS 2 を source、bridge 設定を読み込み │ ├── ros_entrypoint.sh # ROS 環境のみ source(osrf 互換) │ ├── ros1_server.sh # Demo A publisher(roscore + bridge を自起動) diff --git a/doc/README.zh-CN.md b/doc/README.zh-CN.md index 1de16ff..d7c1828 100644 --- a/doc/README.zh-CN.md +++ b/doc/README.zh-CN.md @@ -28,7 +28,7 @@ ROS 1/2 bridge 容器,**Humble + Jazzy 双 target** — `ros:${ROS2_DISTRO}-ro ```bash ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # 挑一份 bridge 配置(gitignored、每个 clone 各自选)。略过则走 demo fallback。 -./build.sh && ./run.sh # 默认 ROS2_DISTRO=humble(在 setup.conf [build] arg_4 设置) +make build && make run # 默认 ROS2_DISTRO=humble(在 setup.conf [build] arg_4 设置) ``` 略过 `ln -sf` 也没问题 — Dockerfile 会自动 fallback 到 @@ -64,13 +64,13 @@ multi-arch(amd64 + arm64 含 Jetson)。完整 migration rationale 见 ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # 1. 构建 -./build.sh +make build # 2. 执行(需要 ROS master 已启动) -./run.sh +make run # 3. 进入已启动的容器 -./exec.sh +make exec ``` ## 切换 ROS 2 distro @@ -79,16 +79,16 @@ ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml 更新 `setup.conf [build] arg_4`: ```bash -./setup.sh set build.arg_4 ROS2_DISTRO=jazzy -./build.sh && ./run.sh +make setup -- set build.arg_4 ROS2_DISTRO=jazzy +make build && make run ``` `set` 把值写进 `setup.conf [build] arg_4`(section / key 不存在会创建)。 -`./build.sh` 接着通过 `.env` 里的 `setup.conf` hash 检测到变动,自动 +`make build` 接着通过 `.env` 里的 `setup.conf` hash 检测到变动,自动 重生 `.env` + `compose.yaml` 并 rebuild。image tag(`yunchien/ros1_bridge:devel` 等)跨 distro 不变,切换 = 原地 rebuild。 -要交互式编辑,跑 `./setup_tui.sh`(dialog / whiptail 前端),在 TUI 里 +要交互式编辑,跑 `make setup-tui`(dialog / whiptail 前端),在 TUI 里 改 `[build] arg_4`。 CI 通过 `.github/workflows/main.yaml` 的 matrix 同时 build 两个 distro,所以 @@ -100,9 +100,9 @@ setup.conf 改动只影响本地 build;发布到 `ghcr.io/ycpss91255-docker/ro ### 构建 ```bash -./build.sh # 构建 devel(默认) -./build.sh -t test # 构建含 smoke test -./build.sh -t runtime # 构建精简的 runtime image +make build # 构建 devel(默认) +make build test # 构建含 smoke test +make build -- -t runtime # 构建精简的 runtime image ``` ### 执行 @@ -110,14 +110,14 @@ setup.conf 改动只影响本地 build;发布到 `ghcr.io/ycpss91255-docker/ro 按 stage target 分两种模式: ```bash -./run.sh # devel:交互 bash shell,不会自动运行 bridge -./run.sh -d # devel 后台运行,之后用 ./exec.sh 进入 +make run # devel:交互 bash shell,不会自动运行 bridge +make run -- -d # devel 后台运行,之后用 make exec 进入 ``` `runtime`(通过 Dockerfile `CMD` 自动启动 bridge): ```bash -./run.sh -t runtime # 启动 runtime service。entrypoint 会 source 两个 +make run -- -t runtime # 启动 runtime service。entrypoint 会 source 两个 # ROS、rosparam load /bridge.yaml,然后 exec # `ros2 run ros1_bridge parameter_bridge`。 # 前提:host network 上已启动 roscore。 @@ -126,8 +126,8 @@ setup.conf 改动只影响本地 build;发布到 `ghcr.io/ycpss91255-docker/ro ### 进入已启动的容器 ```bash -./exec.sh -./exec.sh bash +make exec +make exec bash ``` ## Bridge 设置 @@ -192,19 +192,19 @@ services_2_to_1: | Demo | Terminal 1 (server) | Terminal 2 (client) | |------|---------------------|---------------------| -| A — ROS 1 → ROS 2 | `./exec.sh /root/demo/ros1_server.sh` | `./exec.sh /root/demo/ros2_client.sh` | -| B — ROS 2 → ROS 1 | `./exec.sh /root/demo/ros2_server.sh` | `./exec.sh /root/demo/ros1_client.sh` | +| A — ROS 1 → ROS 2 | `make exec -- /root/demo/ros1_server.sh` | `make exec -- /root/demo/ros2_client.sh` | +| B — ROS 2 → ROS 1 | `make exec -- /root/demo/ros2_server.sh` | `make exec -- /root/demo/ros1_client.sh` | -实际操作(假设容器已用 `./run.sh -d` 起好): +实际操作(假设容器已用 `make run -- -d` 起好): ```bash # Terminal 1 (server) — 二选一 -./exec.sh /root/demo/ros1_server.sh # Demo A -./exec.sh /root/demo/ros2_server.sh # Demo B +make exec -- /root/demo/ros1_server.sh # Demo A +make exec -- /root/demo/ros2_server.sh # Demo B # Terminal 2 (client) — 对应的另一半 -./exec.sh /root/demo/ros2_client.sh # Demo A -./exec.sh /root/demo/ros1_client.sh # Demo B +make exec -- /root/demo/ros2_client.sh # Demo A +make exec -- /root/demo/ros1_client.sh # Demo B ``` Server 脚本每一步都打印进度(`[ros1_server] step N/5: ...`),所以 @@ -212,7 +212,7 @@ Server 脚本每一步都打印进度(`[ros1_server] step N/5: ...`),所 `MESSAGE` 环境变量: ```bash -./exec.sh env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh +make exec -- env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh ``` Server terminal 按 `Ctrl+C` 会收掉 `parameter_bridge` 跟 `roscore`, @@ -252,13 +252,16 @@ ros1_bridge/ ├── compose.yaml # Docker Compose 定义 ├── Dockerfile # 多阶段构建(devel + runtime + test);source-builds Noetic + ros1_bridge ├── setup.conf # Repo override;[build] arg_4=ROS2_DISTRO 选 humble|jazzy -├── build.sh -> .base/script/docker/build.sh # Symlink -├── run.sh -> .base/script/docker/run.sh # Symlink -├── exec.sh -> .base/script/docker/exec.sh # Symlink -├── stop.sh -> .base/script/docker/stop.sh # Symlink -├── Makefile -> .base/script/docker/Makefile # Symlink +├── Makefile -> .base/script/docker/Makefile # Symlink ├── .base/ # 共用脚本、测试、CI(git subtree;版本记录在 .base/.version) ├── script/ +│ ├── build.sh -> ../.base/script/docker/build.sh # Wrapper symlinks +│ ├── run.sh -> ../.base/script/docker/run.sh +│ ├── exec.sh -> ../.base/script/docker/exec.sh +│ ├── stop.sh -> ../.base/script/docker/stop.sh +│ ├── setup.sh -> ../.base/script/docker/setup.sh +│ ├── setup_tui.sh -> ../.base/script/docker/setup_tui.sh +│ ├── prune.sh -> ../.base/script/docker/prune.sh │ ├── entrypoint.sh # Source ROS 1 + ROS 2,载入 bridge 设置 │ ├── ros_entrypoint.sh # 仅 source ROS 环境(兼容 osrf) │ ├── ros1_server.sh # Demo A publisher(自起 roscore + bridge) diff --git a/doc/README.zh-TW.md b/doc/README.zh-TW.md index f3f3b51..cbdd56c 100644 --- a/doc/README.zh-TW.md +++ b/doc/README.zh-TW.md @@ -28,7 +28,7 @@ ROS 1/2 bridge 容器,**Humble + Jazzy 雙 target** — `ros:${ROS2_DISTRO}-ro ```bash ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # 挑一份 bridge 設定(gitignored、每個 clone 各自選)。略過則走 demo fallback。 -./build.sh && ./run.sh # 預設 ROS2_DISTRO=humble(在 setup.conf [build] arg_4 設定) +make build && make run # 預設 ROS2_DISTRO=humble(在 setup.conf [build] arg_4 設定) ``` 略過 `ln -sf` 也沒關係 — Dockerfile 會自動 fallback 到 @@ -64,13 +64,13 @@ multi-arch(amd64 + arm64 含 Jetson)。完整 migration rationale 見 ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml # 1. 建置 -./build.sh +make build # 2. 執行(需要 ROS master 已啟動) -./run.sh +make run # 3. 進入已啟動的容器 -./exec.sh +make exec ``` ## 切換 ROS 2 distro @@ -79,16 +79,16 @@ ln -sf config/ros1_bridge/demo_bridge.yaml bridge.yaml 更新 `setup.conf [build] arg_4`: ```bash -./setup.sh set build.arg_4 ROS2_DISTRO=jazzy -./build.sh && ./run.sh +make setup -- set build.arg_4 ROS2_DISTRO=jazzy +make build && make run ``` `set` 把值寫進 `setup.conf [build] arg_4`(section / key 不存在會建好)。 -`./build.sh` 接著透過 `.env` 裡的 `setup.conf` hash 偵測到變動,自動 +`make build` 接著透過 `.env` 裡的 `setup.conf` hash 偵測到變動,自動 重生 `.env` + `compose.yaml` 並 rebuild。image tag(`yunchien/ros1_bridge:devel` 等)跨 distro 不變,切換 = 原地 rebuild。 -要互動式編輯,跑 `./setup_tui.sh`(dialog / whiptail 前端),在 TUI 裡 +要互動式編輯,跑 `make setup-tui`(dialog / whiptail 前端),在 TUI 裡 改 `[build] arg_4`。 CI 透過 `.github/workflows/main.yaml` 的 matrix 同時 build 兩個 distro,所以 @@ -100,9 +100,9 @@ setup.conf 改動只影響本地 build;發布到 `ghcr.io/ycpss91255-docker/ro ### 建置 ```bash -./build.sh # 建置 devel(預設) -./build.sh -t test # 建置含 smoke test -./build.sh -t runtime # 建置精簡的 runtime image +make build # 建置 devel(預設) +make build test # 建置含 smoke test +make build -- -t runtime # 建置精簡的 runtime image ``` ### 執行 @@ -110,14 +110,14 @@ setup.conf 改動只影響本地 build;發布到 `ghcr.io/ycpss91255-docker/ro 依 stage target 分兩種模式: ```bash -./run.sh # devel:互動 bash shell,不會自動跑 bridge -./run.sh -d # devel 背景執行,之後用 ./exec.sh 進入 +make run # devel:互動 bash shell,不會自動跑 bridge +make run -- -d # devel 背景執行,之後用 make exec 進入 ``` `runtime`(透過 Dockerfile `CMD` 自動啟動 bridge): ```bash -./run.sh -t runtime # 啟動 runtime service。entrypoint 會 source 兩個 +make run -- -t runtime # 啟動 runtime service。entrypoint 會 source 兩個 # ROS、rosparam load /bridge.yaml,然後 exec # `ros2 run ros1_bridge parameter_bridge`。 # 前提:host network 上已啟動 roscore。 @@ -126,8 +126,8 @@ setup.conf 改動只影響本地 build;發布到 `ghcr.io/ycpss91255-docker/ro ### 進入已啟動的容器 ```bash -./exec.sh -./exec.sh bash +make exec +make exec bash ``` ## Bridge 設定 @@ -192,19 +192,19 @@ services_2_to_1: | Demo | Terminal 1 (server) | Terminal 2 (client) | |------|---------------------|---------------------| -| A — ROS 1 → ROS 2 | `./exec.sh /root/demo/ros1_server.sh` | `./exec.sh /root/demo/ros2_client.sh` | -| B — ROS 2 → ROS 1 | `./exec.sh /root/demo/ros2_server.sh` | `./exec.sh /root/demo/ros1_client.sh` | +| A — ROS 1 → ROS 2 | `make exec -- /root/demo/ros1_server.sh` | `make exec -- /root/demo/ros2_client.sh` | +| B — ROS 2 → ROS 1 | `make exec -- /root/demo/ros2_server.sh` | `make exec -- /root/demo/ros1_client.sh` | -實際操作(假設容器已用 `./run.sh -d` 起好): +實際操作(假設容器已用 `make run -- -d` 起好): ```bash # Terminal 1 (server) — 二選一 -./exec.sh /root/demo/ros1_server.sh # Demo A -./exec.sh /root/demo/ros2_server.sh # Demo B +make exec -- /root/demo/ros1_server.sh # Demo A +make exec -- /root/demo/ros2_server.sh # Demo B # Terminal 2 (client) — 對應的另一半 -./exec.sh /root/demo/ros2_client.sh # Demo A -./exec.sh /root/demo/ros1_client.sh # Demo B +make exec -- /root/demo/ros2_client.sh # Demo A +make exec -- /root/demo/ros1_client.sh # Demo B ``` Server 腳本每一步都印出進度(`[ros1_server] step N/5: ...`),所以 @@ -212,7 +212,7 @@ Server 腳本每一步都印出進度(`[ros1_server] step N/5: ...`),所 `MESSAGE` 環境變數: ```bash -./exec.sh env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh +make exec -- env MESSAGE="hi from ROS 1" /root/demo/ros1_server.sh ``` Server terminal 按 `Ctrl+C` 會收掉 `parameter_bridge` 跟 `roscore`, @@ -252,13 +252,16 @@ ros1_bridge/ ├── compose.yaml # Docker Compose 定義 ├── Dockerfile # 多階段建置(devel + runtime + test);source-builds Noetic + ros1_bridge ├── setup.conf # Repo override;[build] arg_4=ROS2_DISTRO 選 humble|jazzy -├── build.sh -> .base/script/docker/build.sh # Symlink -├── run.sh -> .base/script/docker/run.sh # Symlink -├── exec.sh -> .base/script/docker/exec.sh # Symlink -├── stop.sh -> .base/script/docker/stop.sh # Symlink -├── Makefile -> .base/script/docker/Makefile # Symlink +├── Makefile -> .base/script/docker/Makefile # Symlink(統一入口:make build/run/exec/stop) ├── .base/ # 共用腳本、測試、CI(git subtree;版本紀錄在 .base/.version) ├── script/ +│ ├── build.sh -> ../.base/script/docker/build.sh # Wrapper symlinks +│ ├── run.sh -> ../.base/script/docker/run.sh +│ ├── exec.sh -> ../.base/script/docker/exec.sh +│ ├── stop.sh -> ../.base/script/docker/stop.sh +│ ├── setup.sh -> ../.base/script/docker/setup.sh +│ ├── setup_tui.sh -> ../.base/script/docker/setup_tui.sh +│ ├── prune.sh -> ../.base/script/docker/prune.sh │ ├── entrypoint.sh # Source ROS 1 + ROS 2,載入 bridge 設定 │ ├── ros_entrypoint.sh # 僅 source ROS 環境(相容 osrf) │ ├── ros1_server.sh # Demo A publisher(自起 roscore + bridge)