feat: 算法升级、整车配准集成与性能分析文档
算法更新: delivery v1.2.1、平整度v1.5、测距v2.2、整车配准v1.3 适配器: vehicle-registration 新增、各算法 manifest 和 adapter 更新 后端: taskCadFiles/source 字段迁移、derivedPointClouds 注册、取消任务联动 前端: ElapsedTime 时长显示、两步算法流程、canRun 逻辑修复 文档: 新增5份算法性能分析报告
This commit is contained in:
@@ -1,17 +1,18 @@
|
||||
"""train-measurement 算法适配器 (v1.1)。
|
||||
"""train-measurement 算法适配器 (v2.2)。
|
||||
|
||||
读 input.json → 调 TaskManager(来自 alg/点云测距v1.1)→ 写统一 result.json。
|
||||
读 input.json → 调 TaskManager(来自 alg/train_measurement_system_v2.2)→ 写统一 result.json。
|
||||
|
||||
v1.1 变更:
|
||||
- 路径从 260505列车点云测距v1 → 点云测距v1.1
|
||||
- 算法包现在是可安装的 Python 包(有 __init__.py),PYTHONPATH 指向 src/
|
||||
- TRAIN_MEAS_ROOT 指向 train_measurement_system/(用于定位 config/measurements.yaml)
|
||||
- TaskManager.run_all_tasks() 返回结构不变,data 字段含 mean_distance / std_distance 等
|
||||
v2.2 变更:
|
||||
- 算法路径从 alg/点云测距v1.1 → alg/train_measurement_system_v2.2
|
||||
- 新增孔中心拟合(hole_center_fitter)、测量日志、性能日志
|
||||
- 内置配置文件改为 config/measurements_0618.yaml
|
||||
- TRAIN_MEAS_ROOT 指向 train_measurement_system_v2.2/(用于定位 config/)
|
||||
- 算法内置 _read_binary_ply,直接支持二进制 PLY,无需 ASCII 转换
|
||||
|
||||
约定:
|
||||
- 第一个点云路径作为 pointcloud_file 注入到测量配置 YAML 中;
|
||||
- 若用户在 UI 选择「自定义 YAML」并提供 customYaml,则使用之;
|
||||
否则使用算法仓库自带的 config/measurements.yaml 作为模板。
|
||||
否则使用算法仓库自带的 config/measurements_0618.yaml 作为模板。
|
||||
- 所有任务结果合成成 measurements[] 列表,附带可视化 PLY 路径到 extra。
|
||||
"""
|
||||
|
||||
@@ -25,7 +26,6 @@ from pathlib import Path
|
||||
sys.path.insert(0, str(Path(__file__).parent))
|
||||
from _plugin_io import (
|
||||
emit_progress,
|
||||
ensure_ascii_ply,
|
||||
first_pointcloud,
|
||||
load_input,
|
||||
write_error_result,
|
||||
@@ -41,14 +41,14 @@ def main() -> int:
|
||||
out_dir.mkdir(parents=True, exist_ok=True)
|
||||
|
||||
try:
|
||||
emit_progress(0.05, "加载 train_measurement v1.1 算法包")
|
||||
emit_progress(0.05, "加载 train_measurement v2.2 算法包")
|
||||
|
||||
# TRAIN_MEAS_ROOT 由 manifest envExtra 注入,指向 train_measurement_system/
|
||||
# TRAIN_MEAS_ROOT 由 manifest envExtra 注入,指向 train_measurement_system_v2.2/
|
||||
train_root = Path(os.environ.get("TRAIN_MEAS_ROOT") or "")
|
||||
if not train_root.exists():
|
||||
# 回退:从 ALG_ROOT 推导
|
||||
alg_root = Path(os.environ.get("ALG_ROOT") or "/alg")
|
||||
train_root = alg_root / "点云测距v1.1" / "train_measurement_system"
|
||||
train_root = alg_root / "train_measurement_system_v2.2" / "train_measurement_system_v2.2"
|
||||
|
||||
if not train_root.exists():
|
||||
raise RuntimeError(
|
||||
@@ -61,9 +61,6 @@ def main() -> int:
|
||||
pc_path = first_pointcloud(payload)
|
||||
emit_progress(0.15, f"读取点云:{os.path.basename(pc_path)}")
|
||||
|
||||
# 若是二进制 PLY,先转成 ASCII PLY(算法内置 reader 不依赖 open3d)
|
||||
pc_path = ensure_ascii_ply(pc_path, out_dir / "_ply_cache")
|
||||
|
||||
# ── 准备 YAML 配置 ────────────────────────────────────────────────────
|
||||
config_preset = str(config.get("configPreset") or "builtin")
|
||||
custom_yaml_str = str(config.get("customYaml") or "").strip()
|
||||
@@ -81,8 +78,8 @@ def main() -> int:
|
||||
# 已经是 YAML 格式,直接写盘
|
||||
yaml_path.write_text(custom_yaml_str, encoding="utf-8")
|
||||
else:
|
||||
# 使用算法仓库内置的 config/measurements.yaml
|
||||
yaml_path = train_root / "config" / "measurements.yaml"
|
||||
# 使用算法仓库内置的 config/measurements_0618.yaml
|
||||
yaml_path = train_root / "config" / "measurements_0618.yaml"
|
||||
if not yaml_path.exists():
|
||||
raise RuntimeError(f"内置配置文件不存在:{yaml_path}")
|
||||
|
||||
@@ -92,6 +89,8 @@ def main() -> int:
|
||||
tm = TaskManager()
|
||||
# 先注入点云路径,让 load_config 跳过 YAML 里的 pointcloud_file(开发测试路径)
|
||||
tm.pointcloud_path_override = pc_path
|
||||
# 把输出目录重定向到 outDir,避免写到只读的 /alg 目录
|
||||
tm.output_dir_override = str(out_dir)
|
||||
if not tm.load_config(str(yaml_path)):
|
||||
raise RuntimeError(f"TaskManager 加载配置失败:{yaml_path}")
|
||||
|
||||
|
||||
Reference in New Issue
Block a user