52c108de07
修复:run_all.sh 不存在,但被三处依赖 - docs/HOLE_DETECT.md 有 4 处用法示例; - pipeline.launch.py 文件头写着"相机 / 触觉由 scripts/run_all.sh 负责拉起一次"; - run_pipeline.sh 唯一职责就是 exec 它。 也就是说文档在教用户跑一个不存在的脚本,而 run_pipeline.sh 执行必然失败。 按 pipeline.launch.py 的实际参数(skip_stage1/2/3、target_hole、insert_depth_mm、 screw_pitch_mm、preview、resnap)重建:先确认控制器 ACTIVE,再拉起相机与触觉 (都已就绪则跳过),最后 exec pipeline.launch.py。无硬件时会明确报错退出。 修复:判活循环反复撞超时,脚本看起来像卡死 服务/话题不存在时,`ros2 service call` / `ros2 topic echo` 每次都要耗满 timeout 才返回。原写法 30 次循环最坏等 165s(实测无 ROS 时白等 63s)。改成先 `ros2 service list` / `topic list` 探测,再决定要不要 call/echo。 - run_stage2_locate.sh、run_stage3_search.sh 同步修复(165s → ~0s) - run_all.sh 一开始就按正确顺序写 - run_handeye.sh 原本就是对的(这次是向它对齐) 标注:site.yaml 的 sim 段没有任何消费者 它声明 platform: gazebo,但 Gazebo 尚未接线,改它不会有任何效果。 加注释说明真实现状,避免用户以为改了就生效。 澄清:camera 与 cameras 不是重复键,两者都在读 - camera(单数)= 当前激活相机的参数,被各 launch 与节点读 - cameras(复数)= 相机目录(型号/序列号),被 export_site_env.py 读 命名容易混淆,但删任一个都会坏的。 保留:fetch_isaac_flexiv.sh 一度按"0 引用"删除,随后发现 thirdparty/ 里确实存在 isaac_sim_ws 与 flexiv_sim_plugin,说明这条路线被真实使用过;且该脚本还负责 clone flexiv_rdk(核心依赖)。已恢复,并在 scripts/README.md 标为"搁置未用"。 docs/scripts/README.md 补上 run_all.sh、rdk_drag_bridge.py、fetch_isaac_flexiv.sh, 并新增"排查脚本卡住时的常识"一节记录判活顺序。 测试:198 passed
37 lines
1.9 KiB
Markdown
37 lines
1.9 KiB
Markdown
# scripts — 唯一操作入口
|
||
|
||
实现细节在 [docs/WORKSPACE.md](../docs/WORKSPACE.md) 和 [docs/](../docs/)。
|
||
|
||
**每天:** `run_real.sh` · `run_camera_d405.sh` · `run_visual_servo_rt.sh` · `go_home.sh`
|
||
**三阶段串联:** `run_all.sh --arm 89 [--hole k2] [--skip-stage1]`(`run_pipeline.sh` 是它的旧名别名)
|
||
**手眼:** `run_handeye.sh`(`teach` / `merge` / `calibrate` / `show`)
|
||
**夹爪:** `run_gripper.sh --arm 89|91` · `run_dual_gripper.sh`
|
||
**入孔:** `run_hole_detect.sh --arm … [--preview]`
|
||
**触觉:** `run_tactile.sh [--cli]`
|
||
**权重:** `export_yolo_trt.sh`
|
||
**配置:** `show_site_config.sh` · `lib/export_site_env.py`
|
||
**环境:** `env.sh` · `build_all.sh`
|
||
**RDK:** `test_rdk_python.sh` · `rdk_switch_tool.sh` · `rdk_drag_bridge.py`
|
||
**搁置未用:** `fetch_isaac_flexiv.sh`(拉 Flexiv 的 Isaac Sim / RDK 源码到 `thirdparty/`;Isaac 路线目前搁置,Gazebo 是选定平台)
|
||
|
||
`lib/parse_arm_args.sh` 解析 `--arm 89|91`。
|
||
`lib/load_site_config.sh` 把 `config/site.yaml` 变成 `SITE_*`。
|
||
|
||
## 排查脚本卡住时的常识
|
||
|
||
几个脚本开头会等外部条件(控制器 ACTIVE、相机出图、触觉就绪)。**正确的判活顺序是
|
||
先 `ros2 service list` / `ros2 topic list` 看目标在不在,再去 call / echo**:
|
||
|
||
```bash
|
||
# 对:服务不存在时立刻返回
|
||
timeout 3 ros2 service list | grep -q '^/controller_manager/list_controllers$' || exit 1
|
||
timeout 3 ros2 service call /controller_manager/list_controllers ...
|
||
|
||
# 错:服务不存在时每次 call 都要耗满超时才返回,
|
||
# 30 次循环 = 白等两三分钟(实测 63s),看起来就像脚本卡死了
|
||
for _i in $(seq 1 30); do timeout 5 ros2 service call ... ; done
|
||
```
|
||
|
||
`run_all.sh` / `run_stage2_locate.sh` / `run_stage3_search.sh` 已按正确顺序改过;
|
||
`run_handeye.sh` 一开始就是对的。
|