<?xml version="1.0"?>
<feed xmlns="http://www.w3.org/2005/Atom" xml:lang="zh-Hans-CN">
	<id>https://wiki2.lessokaji.com/index.php?action=history&amp;feed=atom&amp;title=%E6%89%98%E7%9B%98%E8%AF%86%E5%88%AB</id>
	<title>托盘识别 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki2.lessokaji.com/index.php?action=history&amp;feed=atom&amp;title=%E6%89%98%E7%9B%98%E8%AF%86%E5%88%AB"/>
	<link rel="alternate" type="text/html" href="https://wiki2.lessokaji.com/index.php?title=%E6%89%98%E7%9B%98%E8%AF%86%E5%88%AB&amp;action=history"/>
	<updated>2026-05-16T14:58:21Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki2.lessokaji.com/index.php?title=%E6%89%98%E7%9B%98%E8%AF%86%E5%88%AB&amp;diff=998&amp;oldid=prev</id>
		<title>Artheru：​Initial bilingual draft (auto-published)</title>
		<link rel="alternate" type="text/html" href="https://wiki2.lessokaji.com/index.php?title=%E6%89%98%E7%9B%98%E8%AF%86%E5%88%AB&amp;diff=998&amp;oldid=prev"/>
		<updated>2026-05-16T11:15:17Z</updated>

		<summary type="html">&lt;p&gt;Initial bilingual draft (auto-published)&lt;/p&gt;
&lt;p&gt;&lt;b&gt;新页面&lt;/b&gt;&lt;/p&gt;&lt;div&gt;&amp;lt;languages/&amp;gt;&lt;br /&gt;
== 概述 / Overview ==&lt;br /&gt;
&amp;quot;托盘识别&amp;quot;是把 2D 或 3D 激光雷达点云中属于托盘（标准木托盘、塑料托盘、卷料 V 形托架等）的部分识别出来，给出 ''中心位姿'' 与 ''可信度'' 的算法集合。它是 [[Special:MyLanguage/自动识别托盘取放货|自动识别托盘取放货]] 的底层模块，本身不涉及任何运动控制；只负责&amp;quot;看见在哪&amp;quot;。&lt;br /&gt;
&lt;br /&gt;
&amp;quot;Pallet recognition&amp;quot; is the family of algorithms that extract, from 2D or 3D lidar clouds, the points belonging to a pallet (standard wooden / plastic pallet, V-cradle for coils, etc.) and output a centre pose with a confidence score. It is the perception module under [[Special:MyLanguage/自动识别托盘取放货|auto-pallet pick &amp;amp; place]]; it does no motion control, only &amp;quot;where is it&amp;quot;.&lt;br /&gt;
&lt;br /&gt;
== 算法分类 / Algorithm taxonomy ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 类别 / Class !! 输入 / Input !! 输出 / Output !! 适用 / Suitable&lt;br /&gt;
|-&lt;br /&gt;
| 几何检测器 / Geometric detector || 2D 激光帧 / one 2D lidar frame || 两个特征点 + 中轴线 / two feature points + midline || 叉孔标准托盘 / standard fork-pocket pallets&lt;br /&gt;
|-&lt;br /&gt;
| 边沿拟合 / Edge fit || 2D 激光帧 || 托盘前沿线段 / pallet front edge segment || 实心边、无孔结构 / solid edges, no pockets&lt;br /&gt;
|-&lt;br /&gt;
| V 槽检测 / V-groove detector || 2D 激光帧 || V 槽顶点 + 张角 / V apex + opening angle || 卷料托架、双车联动 V 槽 / coil cradle, twin-car V-feature&lt;br /&gt;
|-&lt;br /&gt;
| 三脚架检测 / 3-leg detector || 2D 激光帧 || 3 个腿点 + 中心 / 3 legs + centroid || 三腿 KIVA、T 形托盘 / 3-leg KIVA, T-shape&lt;br /&gt;
|-&lt;br /&gt;
| 3D 模板匹配 / 3D template match || 3D 点云 / 3D cloud || 6-DoF 位姿 / 6-DoF pose || 异型托盘、堆垛 / irregular / stacked&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
主入口类 / Main entry classes (Clumsy):&lt;br /&gt;
&lt;br /&gt;
* `LidarDetectTray` — 通用两点 / 三点检测器；`blobDist`, `BlobPtCount`, `PillarFindingScope` 控制聚类粒度。&lt;br /&gt;
* `LidarBlobPairDetector` — 两-blob 配对，含车头朝向先验。&lt;br /&gt;
* `LidarDetectPallet` — 托盘叉孔专用，提供 `widthMin/widthMax` 接受区间。&lt;br /&gt;
* `Lidar2dDetect3LegTray` — 3 腿托架专用。&lt;br /&gt;
* `LidarDetect3DTemplate` — 3D 点云模板（基于 [[Special:MyLanguage/CycleGUI|CycleGUI]] 录制的 reference 点云）。&lt;br /&gt;
&lt;br /&gt;
== 工作原理（几何检测器为例）/ How it works (geometric detector) ==&lt;br /&gt;
以最常用的&amp;quot;叉孔托盘两点检测&amp;quot;为例：&lt;br /&gt;
&lt;br /&gt;
# 把当前激光帧的点云转到车体坐标系。&amp;lt;br /&amp;gt;Transform the current lidar frame into the vehicle frame.&lt;br /&gt;
# 用 `angleStart/angleEnd/minDist/maxDist` 把雷达视场窄化到托盘可能出现的区域。&amp;lt;br /&amp;gt;Narrow the FOV via `angleStart/angleEnd/minDist/maxDist` to the slot where the pallet is expected.&lt;br /&gt;
# 沿距离方向做 1D 直方图聚类（bin = `resolution`），找出 2 个相邻峰，作为两个候选叉孔中心。&amp;lt;br /&amp;gt;1D distance histogram (bin = `resolution`); locate 2 adjacent peaks → 2 candidate pocket centres.&lt;br /&gt;
# 用宽度先验（`widthMin ≤ |Δ| ≤ widthMax`）剔除假阳性。&amp;lt;br /&amp;gt;Reject candidates outside the prior width interval.&lt;br /&gt;
# 用最小二乘拟合两个候选点周边的局部点云（`PillarFindingScope` 半径），得到精化后的 (x, y) 与角度。&amp;lt;br /&amp;gt;Refine each candidate by least-squares fit over a neighbourhood of radius `PillarFindingScope`; output (x, y) and the line connecting them.&lt;br /&gt;
# 计算置信度（=点云密度 × 几何吻合度）。&amp;lt;br /&amp;gt;Confidence = local density × geometric fit quality.&lt;br /&gt;
&lt;br /&gt;
最小二乘的核心代码（取自 `AutoShelfFetchingManyLegs.cs` 中的 `CalcLine`）：&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
private (double dx, double dy, float fx, float fy, double A, double B, double C)&lt;br /&gt;
    CalcLine(IEnumerable&amp;lt;float2&amp;gt; pts)&lt;br /&gt;
{&lt;br /&gt;
    var arr = pts as float2[] ?? pts.ToArray();&lt;br /&gt;
    float fx  = arr.Average(f =&amp;gt; f.x);&lt;br /&gt;
    float fy  = arr.Average(f =&amp;gt; f.y);&lt;br /&gt;
    float fxx = arr.Average(f =&amp;gt; f.x * f.x);&lt;br /&gt;
    float fxy = arr.Average(f =&amp;gt; f.x * f.y);&lt;br /&gt;
    float fyy = arr.Average(f =&amp;gt; f.y * f.y);&lt;br /&gt;
    float a = fxx - fx * fx, b = fxy - fx * fy, c = fyy - fy * fy;&lt;br /&gt;
    double sqt = Math.Sqrt((a - c) * (a - c) + 4 * b * b);&lt;br /&gt;
    double l1 = a + c + sqt;&lt;br /&gt;
    double dx, dy;&lt;br /&gt;
    if (Math.Abs(a - l1 / 2) &amp;gt; Math.Abs(c - l1 / 2)) { dy = l1/2 - a; dx = b; }&lt;br /&gt;
    else                                              { dx = l1/2 - c; dy = b; }&lt;br /&gt;
    double n = Math.Sqrt(dx*dx + dy*dy); dx /= n; dy /= n;&lt;br /&gt;
    return (dx, dy, fx, fy, dy, -dx, dx*fy - dy*fx);&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 标定与精度 / Calibration &amp;amp; accuracy ==&lt;br /&gt;
托盘识别的精度主要受三项约束：&lt;br /&gt;
The accuracy of pallet recognition is bounded by three calibration items:&lt;br /&gt;
&lt;br /&gt;
* '''激光雷达外参 / Lidar extrinsics''' — 车体到雷达的 (Δx, Δy, Δθ)。用 [[Special:MyLanguage/标定激光雷达外参|外参标定]] 工具。误差 &amp;gt; 5 mm / 1° 时，托盘姿态会有可观偏差。&lt;br /&gt;
* '''激光雷达水平度 / Lidar horizontality''' — 倾斜会引入距离偏移；卡车上需要定期复检。&lt;br /&gt;
* '''托盘几何先验 / Pallet geometry priors''' — `width`, `widthMin/Max`, `PillarFindingScope` 等都要按 ''实测'' 调；不要直接抄默认值。&lt;br /&gt;
&lt;br /&gt;
调试时先用 [[Special:MyLanguage/开发手册 - SimpleComposer界面开发 - CAD工具|CAD 工具]] 在 SimpleComposer 中可视化点云与检测结果。&lt;br /&gt;
&lt;br /&gt;
When debugging, render the live cloud and the detector output on the SimpleComposer CAD canvas first; this is usually faster than re-tuning blind.&lt;br /&gt;
&lt;br /&gt;
== 失败模式 / Failure modes ==&lt;br /&gt;
* '''两个反光板被误识为叉孔 / Two reflectors mistaken for pockets''': 启用 `intensityMin` 阈值过滤。&lt;br /&gt;
* '''并排两个托盘被合并 / Two side-by-side pallets merged''': 调小 `resolution`（更细的 bin），并启用 `widthMax` 上限。&lt;br /&gt;
* '''托盘前沿被部分遮挡 / Front edge partially occluded''': 启用 `PartialOccludeFallback`（用 3D 雷达 ROI 提升）或要求 `confidence &amp;gt; 0.7`。&lt;br /&gt;
* '''环境强光斑反射 / Strong light glints''': 强度归一化（`ReflexRange`）+ 中值滤波。&lt;br /&gt;
&lt;br /&gt;
== 相关页面 / See also ==&lt;br /&gt;
* [[Special:MyLanguage/自动识别托盘取放货|自动识别托盘取放货]]&lt;br /&gt;
* [[Special:MyLanguage/自动识别工位并取放货|自动识别工位并取放货]]&lt;br /&gt;
* [[Special:MyLanguage/识别料框并堆垛拆垛|识别料框并堆垛拆垛]]&lt;br /&gt;
* [[Special:MyLanguage/2D激光雷达适配|2D激光雷达适配]] — 提供输入的雷达插件如何写。&lt;br /&gt;
&lt;br /&gt;
[[Category:特殊技术方案]]&lt;/div&gt;</summary>
		<author><name>Artheru</name></author>
	</entry>
</feed>