feat: 升级算法包 delivery_v1.1 → v1.2,新增任务级 CAD 与测距面板

- 算法包替换为 delivery_v1.2(coupler_panel 新增 autotune/layer_select,underframe_deflection 新增 single_beam 管线),删除 delivery_v1.1
- manifests/adapters 的 PYTHONPATH 与版本说明同步更新到 v1.2
- 新增任务级 CAD 文件支持(task_cad_files 表、上传/读取路由、TaskManager 全选与加载显示)
- 新增 train-measurement 自定义前端面板(YAML 编辑器 + 可视化 ROI 配置 + 3D 取点)
- PointCloudViewer 支持 PLY 叠加层渲染与 ROI 拾取
- Dockerfile 改用 Miniforge 安装 pythonocc-core,修复 libgomp/libstdc++ 依赖
This commit is contained in:
2026-06-11 02:30:04 +00:00
parent 16811100d1
commit cec0766e67
143 changed files with 3087 additions and 12604 deletions

View File

@@ -0,0 +1,17 @@
# Profile: high-density scan (≈100w points, sub-mm spacing).
sampling:
spacing_mm: 0.25
num_points: 1000000
denoise:
steps:
- type: passthrough
bbox_padding_mm: 50.0
- type: voxel
voxel_mm: 0.25
- type: statistical
nb_neighbors: 50
std_ratio: 2.0
detection:
grid_pixel_mm: 0.25
plane_fit:
ransac_iterations: 500

View File

@@ -0,0 +1,18 @@
# Profile: low-density scan (≈1w points, ≈2 mm spacing).
sampling:
spacing_mm: 2.0
num_points: 10000
denoise:
steps:
- type: passthrough
bbox_padding_mm: 50.0
- type: voxel
voxel_mm: 1.0
- type: statistical
nb_neighbors: 15
std_ratio: 2.5
detection:
grid_pixel_mm: 1.0
hole_min_area_mm2: 20.0
plane_fit:
ransac_iterations: 100

View File

@@ -0,0 +1,106 @@
# Profile tuned for the lu1-M000004835653_AF4_ASMP072708187_N_AF4.stp panel.
#
# Topology summary (from cad/iter_circular_edges):
# - locating holes: r = 16 mm × 4 corners at (y=±100, z=±180)
# - central hole: r = 100 mm at (y≈1, z=0)
# - panel size: ~200 × 360 mm in y-z, ~76 mm thick along x
#
# Use:
# coupler-measure --stp <path> --out-dir <dir> --profile lu1_af4
cad:
linear_deflection_mm: 0.5
angular_deflection_rad: 0.1
# CAD-side: strict band that selects only the r=16 mm corner holes.
locating_hole_radius_mm: [14.0, 18.0]
central_hole_radius_min_mm: 80.0
rectangle_aspect_tol: 0.30
sampling:
method: poisson_disk
spacing_mm: null
num_points: 500000
seed: 42
# Critical: simulate a single-view "+x looking at -x" scan. Without this,
# back-face points project into the hole regions and detection fails.
scan_simulator:
enabled: true
view_origin: [10000.0, 0.0, 0.0]
hpr_radius_mm: 200000.0
# --- Panel deflection injection -------------------------------------------
# This is the *signal* we want the algorithm to recover. By default it is
# off — sweeps override these.
panel_deflection:
enabled: true
theta_right_deg: 0.5 # rotation around z so n_y > 0
theta_ref_deg: 0.3 # rotation around -y so n_z > 0
# --- Realistic LiDAR / structured-light noise -----------------------------
noise:
enabled: true
sigma_mm: 0.05 # ≈ 50 µm; matches typical industrial scanners
mode: isotropic
seed: 43
# --- Scanner-pose jitter --------------------------------------------------
# Modest values: 4-hole Kabsch should remove this completely.
transform:
enabled: true
rotation_deg: 0.5
translation_mm: 2.0
rotation_axis: random
translation_dir: random
seed: 44
denoise:
steps:
- type: passthrough
bbox_padding_mm: 50.0
- type: voxel
voxel_mm: 0.5 # finer voxel for low-noise data
- type: statistical
nb_neighbors: 20
std_ratio: 2.5
detection:
panel_normal_seed: pca # critical: use cloud's own PCA, not CAD seed
grid_pixel_mm: 2.0
closing_iters: 0
fill_bg_below_mm2: 100.0
panel_min_area_ratio: 0.15
hole_min_area_mm2: 600.0
hole_max_area_mm2: 5000.0
locating_hole_radius_mm: [14.0, 22.0]
circle_fit:
method: algebraic_then_lsq
inlier_residual_mm: 1.5
rectangle_aspect_tol: 0.40
roi:
hole_dilate_mm: 5.0
central_hole_dilate_mm: 10.0
edge_buffer_mm: 8.0
chamfer_normal_dot_min: 0.80
outlier_z_score: 3.0
plane_fit:
ransac_iterations: 300
ransac_inlier_thresh_mm: auto
min_inlier_ratio: 0.5
enforce_nx_positive: true
metrics:
right_axis_sign: 1
angle_clamp_deg: 0.0
artifacts:
save_intermediate: true
ply_format: binary
image_dpi: 150
heatmap_colormap: viridis
registration:
method: kabsch_four_holes
refuse_if_residual_above_mm: 5.0

View File

@@ -0,0 +1,94 @@
# Profile for the train_2 coupler mounting panel measured from a full-vehicle
# scan (train_2_1T.ply, cropped to the coupler ROI).
#
# Part topology (measured from the 1T cloud, dataset frame x=length,
# y=height, z=width):
# - a wide base plate with a RAISED central square mounting plate
# - the central plate has 4 corner bolt holes, r≈15.6 mm,
# rectangle 360 mm (z) × 200 mm (y), at z=±180, y=835/1035
# - NO central pass-through hole
# - the ROI box also slices a roof truss + the base plate behind the
# raised plate, so a normal-direction layer isolation is required
#
# Use:
# run_coupler_measurement_pipeline(input_cloud=roi.ply,
# profile="train2_coupler", roi_spec=<bbox>) # no CAD, no Kabsch
# --- CAD block (not used for STP parse here; kept for radius thresholds) ---
cad:
linear_deflection_mm: 0.5
angular_deflection_rad: 0.1
locating_hole_radius_mm: [11.0, 19.0] # r≈15.6 corner bolt holes
central_hole_radius_min_mm: 999.0 # this part has NO central hole
rectangle_aspect_tol: 0.40
# --- Normal-direction layer isolation (the key pre-processing step) -------
# Isolate the frontmost dominant layer = the raised central plate, so the
# back plate + truss don't fill the holes / pollute the plane fit.
layer_select:
enabled: true
normal_seed: pca # pca | from_cad
half_width_mm: 8.0 # slab half-thickness around the chosen layer
pick: frontmost # frontmost (toward scanner) | densest
bins: 240
# --- Denoise: drop the density-fragile radius filter (sparse-ish scan) ----
denoise:
steps:
- type: passthrough
bbox_padding_mm: 50.0
- type: voxel
voxel_mm: 0.5
- type: statistical
nb_neighbors: 20
std_ratio: 2.5
# --- 4-hole detection tuned for r≈15.6 mm bolt holes ----------------------
detection:
panel_normal_seed: pca
grid_pixel_mm: 2.0
closing_iters: 1
fill_bg_below_mm2: 60.0
panel_min_area_ratio: 0.15
hole_min_area_mm2: 300.0 # r=15.6 -> ~765 mm²; floor well below
hole_max_area_mm2: 1400.0 # ceil above; excludes larger back-layer holes
locating_hole_radius_mm: [11.0, 19.0]
rectangle_aspect_tol: 0.40
circle_fit:
method: algebraic_then_lsq
inlier_residual_mm: 1.5
# --- Panel ROI extraction -------------------------------------------------
roi:
hole_dilate_mm: 5.0
central_hole_dilate_mm: 10.0
edge_buffer_mm: 8.0
chamfer_normal_dot_min: 0.80
outlier_z_score: 3.0
# --- Plane fit ------------------------------------------------------------
plane_fit:
ransac_iterations: 400
ransac_inlier_thresh_mm: 1.0
min_inlier_ratio: 0.3
enforce_nx_positive: true
# --- Metrics --------------------------------------------------------------
# NOTE: this dataset's frame is x=length, y=height, z=width — i.e. y and z
# are swapped relative to the package's nominal (y=width, z=height). The
# angle formulas are symmetric in form; here theta_right = atan2(n_y,n_x)
# is the tilt toward car-height and theta_ref = atan2(n_z,n_x) is the tilt
# toward car-width. Both are ~0 for an undeflected panel.
metrics:
right_axis_sign: 1
angle_clamp_deg: 0.0
registration:
method: kabsch_four_holes
refuse_if_residual_above_mm: 5.0
artifacts:
save_intermediate: true
ply_format: binary
image_dpi: 150
heatmap_colormap: viridis