fix: remove hardcoded ROS shell paths
This commit is contained in:
@@ -48,10 +48,12 @@ cd ~/smart-healthcare-2026/src/mtran
|
||||
|
||||
## 3. 准备依赖、sidecar 和模型
|
||||
|
||||
从 `smart-healthcare-2026/src/mtran` 执行:
|
||||
先加载日常终端环境,再执行:
|
||||
|
||||
```bash
|
||||
./dependencies/auto_install.sh
|
||||
source ~/.bashrc
|
||||
cd ~/smart-healthcare-2026/src/mtran/dependencies
|
||||
./auto_install.sh
|
||||
```
|
||||
|
||||
脚本会请求 `sudo` 安装非 ROS apt 包,在 `dependencies/tools` 安装固定版本 Bun,
|
||||
@@ -66,9 +68,10 @@ Then: source install/setup.bash && ros2 launch mtran translator.launch.py
|
||||
|
||||
## 4. 检查准备结果
|
||||
|
||||
仍从 `smart-healthcare-2026/src/mtran` 执行:
|
||||
返回 `smart-healthcare-2026/src/mtran` 执行:
|
||||
|
||||
```bash
|
||||
cd ..
|
||||
file runtime/bin/mtranserver
|
||||
test -s runtime/config/records.json
|
||||
ls -lh models/en_zh-Hans
|
||||
@@ -96,7 +99,7 @@ models/en_zh-Hans/trgvocab.enzh.spm
|
||||
从工作区根目录 `smart-healthcare-2026` 执行,而不是从包目录执行:
|
||||
|
||||
```bash
|
||||
source /opt/ros/humble/setup.bash
|
||||
source ~/.bashrc
|
||||
PYTHONNOUSERSITE=1 colcon build --packages-select mtran
|
||||
```
|
||||
|
||||
@@ -115,7 +118,7 @@ CMake 不会联网、安装依赖或调用 Bun。它只检查第 4 节的准备
|
||||
从 `smart-healthcare-2026` 执行:
|
||||
|
||||
```bash
|
||||
source /opt/ros/humble/setup.bash
|
||||
source ~/.bashrc
|
||||
source install/setup.bash
|
||||
PYTHONNOUSERSITE=1 ros2 launch mtran translator.launch.py
|
||||
```
|
||||
@@ -132,7 +135,7 @@ MTranServer is healthy and the en-to-zh-Hans model is warm
|
||||
保留启动终端,在第二个终端中从 `smart-healthcare-2026` 执行:
|
||||
|
||||
```bash
|
||||
source /opt/ros/humble/setup.bash
|
||||
source ~/.bashrc
|
||||
source install/setup.bash
|
||||
ros2 service call /translate_en_to_zh \
|
||||
mtran/srv/TranslateEnglishToChinese \
|
||||
@@ -215,20 +218,20 @@ C++ 源码和模型数据不区分 CPU 架构。`auto_install.sh` 在运行机
|
||||
- 架构正确的 sidecar
|
||||
- 哈希和大小正确的四个模型文件
|
||||
|
||||
只重新构建 sidecar,从 `smart-healthcare-2026/src/mtran` 执行:
|
||||
只重新构建 sidecar,从 `smart-healthcare-2026/src/mtran/dependencies` 执行:
|
||||
|
||||
```bash
|
||||
rm -f runtime/bin/mtranserver
|
||||
rm -rf .build/mtranserver
|
||||
./dependencies/auto_install.sh
|
||||
rm -f ../runtime/bin/mtranserver
|
||||
rm -rf ../.build/mtranserver
|
||||
./auto_install.sh
|
||||
```
|
||||
|
||||
完全重新准备,从同一目录执行:
|
||||
|
||||
```bash
|
||||
rm -rf dependencies/tools .build runtime/config models/en_zh-Hans
|
||||
rm -f runtime/bin/mtranserver
|
||||
./dependencies/auto_install.sh
|
||||
rm -rf tools ../.build ../runtime/config ../models/en_zh-Hans
|
||||
rm -f ../runtime/bin/mtranserver
|
||||
./auto_install.sh
|
||||
```
|
||||
|
||||
清理 ROS2 构建结果,从 `smart-healthcare-2026` 执行:
|
||||
|
||||
Reference in New Issue
Block a user