arm_dev d289168dd0 P4s:模型审计 —— 移出零引用模型,修掉代码里三处悬空 best.pt
先回答"这些模型到底有没有人用",用全仓库引用扫描判定,不靠猜:

  在用   yolo/detect_best_0.onnx + .engine   ← paths.yolo_weights
  在用   hole_insert/detect_best_1.onnx      ← hole_detect.weights / workpiece_weights
  零引用 detect_hc90(pt/onnx/engine)       ← 只剩注释里的历史说明
  零引用 detect_yolo26_gongjian.pt
  零引用 detect_best(onnx/engine)          ← 仅代码兜底候选,而那个候选是 .pt,不存在

所以 detect_hc90 不需要修复,是不用的东西:连同另两个一起移出仓库。
注意**二进制权重被 gitignore**,删掉就找不回来了,因此是移出到
~/ros2-models-unused-20260923/ 而非 rm。搬回 models/ 即可被 list 重新发现。

顺手挖出并修掉三处悬空引用(和之前 site.yaml 里那个 best.pt 同一类问题):
- hole_detector.weights_from_site:兜底路径写死 models/hole_insert/best.pt(不存在)
- hole_detector._default_model_path:三个候选路径**全都不存在**,函数却
  `return candidates[0]`,于是永远返回不存在的 best.pt;报错路径看着很合理,
  极易被误判成"文件被误删"。现改为以 site.yaml 为准,再退到规范模型。
- config/hole_insert.yaml 顶部注释同样写的是 best.pt

新增 test_hole_detector.py(8 项)锁住这个回归。测试刻意**不断言文件存在**
——二进制不进 git,新克隆的仓库里 models/ 是空的——只断言解析结果指向规范模型名。

体检从 4 处问题降到 0:bash scripts/weights.sh doctor --check-engines → "没有发现问题"

测试 233 项通过;18 个包构建通过。

Co-authored-by: Cursor <cursoragent@cursor.com>
2026-09-23 13:08:11 +08:00

Flexiv Rizon 视觉伺服(~/ros2)

独立工作空间:腕部 D405 眼在手上、手眼标定、YOLO 找工件、法兰悬停跟踪、DH 夹爪、入孔检测。
一份仓库即可跑完整跟踪与检测,不依赖 camera_test 或装配 HMI。

工作目录必须是 ASCII 路径(推荐克隆到 ~/ros2)。

项 值
配置 config/site.yaml(从 example 复制,不进 git)
操作 scripts/
目录说明 docs/WORKSPACE.md(每个文件夹做什么)
Conda ros_flexiv
ROS Humble

克隆后

cd ~/ros2
cp config/site.example.yaml config/site.yaml
# 编辑 site.yaml:robot.sn / robots[].ip / camera.serial / paths.yolo_weights
# 权重文件放到 models/yolo/(二进制不在 git 里)

conda activate ros_flexiv
source scripts/env.sh
./scripts/build_all.sh
source scripts/env.sh

示教器:AUTO + Remote Ethernet,关掉 Flexiv Studio(RDK 独占)。

# 三个终端必须带同一个 --arm(89=左  91=右)
bash ~/ros2/scripts/run_real.sh --arm 89
bash ~/ros2/scripts/run_camera_d405.sh --arm 89 --preview
bash ~/ros2/scripts/run_visual_servo_rt.sh --arm 89 --control

改 site.yaml:锁高 / YOLO / 伺服 → 重启第三终端;分辨率 / 曝光 → 重启相机。

功能入口

功能 命令
实机 scripts/run_real.sh --arm 89|91
腕部相机 scripts/run_camera_d405.sh --arm … --preview
顶视 D435 scripts/run_camera_d435.sh --preview
列出相机 scripts/list_realsense.sh
跟踪 scripts/run_visual_servo_rt.sh --arm … [--control]
回 home scripts/go_home.sh --arm …
手眼 scripts/run_handeye.sh --arm … teach → merge → calibrate
PGEA / RGI 夹爪 scripts/run_gripper.sh --arm 89|91 --cli …
双爪 ROS scripts/run_dual_gripper.sh
入孔检测 scripts/run_hole_detect.sh --arm … --preview
Orisys 触觉 scripts/run_tactile.sh [--cli]
看配置 scripts/show_site_config.sh

89 与 91 各有 手眼、相机序列号、锁高、named poses,禁止混用。

文档

文档 内容
docs/WORKSPACE.md 每个目录 / 脚本 / 包
docs/QUICKSTART.md 环境与第一次跑通
docs/ARCHITECTURE.md 进程与几何
docs/SITE_CONFIG.md site.yaml 字段
docs/HANDEYE.md 手眼标定
docs/TRACKING.md 视觉伺服
docs/GRIPPER.md PGEA + RGI
docs/HOLE_DETECT.md 入孔检测
docs/TACTILE.md Orisys 视触觉
docs/INTERFACES.md ROS / 脚本接口
docs/TRAJECTORIES.md 轨迹回放

上传 git 时

  • 要提交:src/ scripts/ docs/ config/site.example.yaml models/yolo/README.md models/hole_insert/README.md
  • 不要提交:config/site.yaml(含本机 IP/序列号)、build/ install/ log/、YOLO .pt/.onnx/.engine、thirdparty/ vendor/
  • 规则已写在 .gitignore

别人克隆后必须自己 cp site.example.yaml site.yaml 并重新手眼标定(不要直接用仓库里某台现场的 T_4x4 当真值)。

S
Description
No description provided
Readme 193 MiB
Languages
Makefile 34.3%
Python 24.2%
C 20%
C++ 14.6%
CMake 5.2%
Other 1.7%