<?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=Detour%E8%BD%AF%E4%BB%B6%E6%9E%B6%E6%9E%84</id>
	<title>Detour软件架构 - 版本历史</title>
	<link rel="self" type="application/atom+xml" href="https://wiki2.lessokaji.com/index.php?action=history&amp;feed=atom&amp;title=Detour%E8%BD%AF%E4%BB%B6%E6%9E%B6%E6%9E%84"/>
	<link rel="alternate" type="text/html" href="https://wiki2.lessokaji.com/index.php?title=Detour%E8%BD%AF%E4%BB%B6%E6%9E%B6%E6%9E%84&amp;action=history"/>
	<updated>2026-05-16T16:54:04Z</updated>
	<subtitle>本wiki上该页面的版本历史</subtitle>
	<generator>MediaWiki 1.40.0</generator>
	<entry>
		<id>https://wiki2.lessokaji.com/index.php?title=Detour%E8%BD%AF%E4%BB%B6%E6%9E%B6%E6%9E%84&amp;diff=1017&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=Detour%E8%BD%AF%E4%BB%B6%E6%9E%B6%E6%9E%84&amp;diff=1017&amp;oldid=prev"/>
		<updated>2026-05-16T11:42:51Z</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;
&lt;br /&gt;
== 概述 / Overview ==&lt;br /&gt;
Detour 是 MDCS 的定位系统：它整合 ''激光 SLAM''、''地纹 SLAM''、''天花板 SLAM''、''二维码导航'' 等多种定位手段，输出统一的 6-DoF 位姿给上层（Clumsy 自动驾驶 / SimpleComposer 调度）。Detour 不接受外部插件 —— 它通过 [[Special:MyLanguage/DObject|DObject]] 共享内存订阅 Medulla 发布的传感器数据，并通过 ''外部反馈接口''接收里程计 / IMU / RTK / UWB。&lt;br /&gt;
&lt;br /&gt;
Detour is the MDCS positioning subsystem. It fuses laser SLAM, ground-texture SLAM, ceiling SLAM, QR navigation, and other localisation sources into a unified 6-DoF pose for the upper layers (Clumsy autopilot / SimpleComposer fleet). Detour does not accept plugins — it consumes Medulla sensor publications via DObject, and external poses (odometry / IMU / RTK / UWB) via the external-feed API.&lt;br /&gt;
&lt;br /&gt;
== 子模块 / Subsystems ==&lt;br /&gt;
{| class=&amp;quot;wikitable&amp;quot;&lt;br /&gt;
! 模块 / Module !! 文件 / File !! 用途 / Use&lt;br /&gt;
|-&lt;br /&gt;
| Lidar consumer || `D:\src\Detour\DetourCore\CartDefinition\Lidar.cs:302-311` || 从 Medulla DObject 订阅雷达帧&lt;br /&gt;
|-&lt;br /&gt;
| Tight coupler || `D:\src\Detour\DetourCore\Algorithms\TightCoupler.ExternalCoupler.cs` || 接收外部位姿、做紧耦合融合&lt;br /&gt;
|-&lt;br /&gt;
| Laser SLAM || `D:\src\Detour\DetourCore\Algorithms\LaserSLAM*` || 见 [[Special:MyLanguage/Detour激光SLAM算法详解|Detour 激光 SLAM 算法详解]]&lt;br /&gt;
|-&lt;br /&gt;
| Ground-texture SLAM || `D:\src\Detour\DetourCore\Algorithms\GroundTexture*` || 见 [[Special:MyLanguage/Detour地面纹理SLAM算法详解|地面纹理 SLAM 算法详解]]&lt;br /&gt;
|-&lt;br /&gt;
| QR / fiducial || `D:\src\Detour\DetourCore\Algorithms\QR*` || 见 [[Special:MyLanguage/二维码识别导航|二维码识别导航]]&lt;br /&gt;
|-&lt;br /&gt;
| Multi-source fuser || `TightCoupler` || 见 [[Special:MyLanguage/多定位源的自动综合|多定位源的自动综合]]&lt;br /&gt;
|}&lt;br /&gt;
&lt;br /&gt;
== 数据流 / Data flow ==&lt;br /&gt;
&lt;br /&gt;
  Medulla 传感器插件&lt;br /&gt;
       │ output() → DObject(name)&lt;br /&gt;
       ▼&lt;br /&gt;
  Detour 订阅:&lt;br /&gt;
   - LidarConsumer.ReadLidar()&lt;br /&gt;
   - CameraConsumer (ground-texture / ceiling / QR)&lt;br /&gt;
       │&lt;br /&gt;
       ▼&lt;br /&gt;
  各 SLAM 后端 (laser / texture / ceiling / QR)&lt;br /&gt;
       │ 每个产生一组 ''观测约束''&lt;br /&gt;
       ▼&lt;br /&gt;
  TightCoupler (位姿图优化)&lt;br /&gt;
       │ + 外部反馈 (PostExternalFeed)&lt;br /&gt;
       ▼&lt;br /&gt;
  统一位姿 (x, y, z, th, pitch, roll, tick)&lt;br /&gt;
       │ 发布到 DObject &amp;quot;pose&amp;quot;&lt;br /&gt;
       ▼&lt;br /&gt;
  Clumsy / SimpleComposer 订阅&lt;br /&gt;
&lt;br /&gt;
== 外部反馈 / External feeds ==&lt;br /&gt;
非传感器位姿（轮编里程计 / IMU / RTK / UWB / 二次定位源）通过 ''外部反馈''进入 Detour：&lt;br /&gt;
&lt;br /&gt;
Non-sensor poses (wheel odometry, IMU, RTK, UWB, secondary sources) enter Detour through the ''external-feed'' API:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
TightCoupler.PostExternalFeed(new ExternalFeed&lt;br /&gt;
{&lt;br /&gt;
    name = &amp;quot;wheel_imu&amp;quot;,&lt;br /&gt;
    counter = tick++,&lt;br /&gt;
    hasTranslation = true,&lt;br /&gt;
    hasRotation = true,&lt;br /&gt;
    is2D = true,&lt;br /&gt;
    integrated = true,           // 积分量 / cumulative&lt;br /&gt;
    x = odom_x, y = odom_y, th = odom_th&lt;br /&gt;
}, &amp;quot;WheelOdom&amp;quot;);&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
字段含义见 `TightCoupler.ExternalCoupler.cs`：`hasTranslation/hasRotation`（包含的自由度）、`integrated`（积分量 vs 单帧量）、`toRemap`（绝对参考系下，需要全局重映射）、`startingTick`（首帧基准）。&lt;br /&gt;
&lt;br /&gt;
Field semantics in `TightCoupler.ExternalCoupler.cs`: `hasTranslation/hasRotation` (DOFs), `integrated` (cumulative vs single-frame), `toRemap` (absolute, needs global remap), `startingTick` (reference baseline).&lt;br /&gt;
&lt;br /&gt;
== 多 SLAM 共存策略 / Multi-SLAM coexistence ==&lt;br /&gt;
* '''并行运行''': 默认每种 SLAM 后端都开，各产生自己的观测约束。&lt;br /&gt;
* '''置信加权''': TightCoupler 根据每个后端的协方差矩阵做加权融合。&lt;br /&gt;
* '''场景切换''': 某个后端连续 ''N 帧''置信度 &amp;lt; 阈值 → 临时禁用其约束。&lt;br /&gt;
* '''硬切换''': 用户可在 UI 中强制选择&amp;quot;单一定位源&amp;quot;模式（调试用）。&lt;br /&gt;
&lt;br /&gt;
* All SLAM backends run in parallel by default.&lt;br /&gt;
* TightCoupler weights by per-backend covariance.&lt;br /&gt;
* A backend that's degraded for N frames is temporarily disabled.&lt;br /&gt;
* A user can force single-source mode (debug).&lt;br /&gt;
&lt;br /&gt;
== 定位输出 / Positioning output ==&lt;br /&gt;
Detour 把当前最优位姿写到 ''pose'' 命名的 DObject：&lt;br /&gt;
&lt;br /&gt;
The current best pose is published to a DObject named `pose`:&lt;br /&gt;
&lt;br /&gt;
&amp;lt;syntaxhighlight lang=&amp;quot;csharp&amp;quot;&amp;gt;&lt;br /&gt;
public struct DetourPose&lt;br /&gt;
{&lt;br /&gt;
    public double x, y, z;       // mm&lt;br /&gt;
    public double th;            // 偏航 / yaw rad&lt;br /&gt;
    public double pitch, roll;   // rad&lt;br /&gt;
    public long   tick;          // 时间戳 / system tick&lt;br /&gt;
    public double cov_xy;        // 平面协方差 / planar covariance&lt;br /&gt;
    public double cov_th;        // 偏航协方差 / yaw covariance&lt;br /&gt;
    public string activeBackend; // 当前主用 SLAM 后端&lt;br /&gt;
}&lt;br /&gt;
&amp;lt;/syntaxhighlight&amp;gt;&lt;br /&gt;
&lt;br /&gt;
== 与 Medulla 的关系 / Relation to Medulla ==&lt;br /&gt;
Detour ''不是'' Medulla 的插件；它是独立的 .NET 进程，与 Medulla 同主机但不同进程，二者只通过 DObject 共享内存通讯。这种设计使得 Detour 可以独立部署 / 升级 / 切换 SLAM 算法而不影响 Medulla。&lt;br /&gt;
&lt;br /&gt;
Detour is '''not''' a Medulla plugin. It's a separate .NET process on the same host, communicating with Medulla only via DObject shared memory. This decoupling lets Detour deploy / upgrade / swap SLAM algorithms independently.&lt;br /&gt;
&lt;br /&gt;
== DetourStandalone 与 DetourLite / Standalone &amp;amp; Lite variants ==&lt;br /&gt;
* '''DetourStandalone''': 完整 Detour，含全部 SLAM + UI。详见 [[Special:MyLanguage/DetourStandalonePluginGuide|DetourStandalonePluginGuide]]。&lt;br /&gt;
* '''DetourLite''': 精简版，只含必要功能 + 检查表自检。见 [[Special:MyLanguage/DetourLite检查表|DetourLite 检查表]]。&lt;br /&gt;
&lt;br /&gt;
== 相关页面 / See also ==&lt;br /&gt;
* [[Special:MyLanguage/Detour|Detour]]&lt;br /&gt;
* [[Special:MyLanguage/Detour简介|Detour简介]]&lt;br /&gt;
* [[Special:MyLanguage/Detour-API|Detour-API]]&lt;br /&gt;
* [[Special:MyLanguage/Detour激光SLAM算法详解|Detour激光SLAM算法详解]]&lt;br /&gt;
* [[Special:MyLanguage/Detour地面纹理SLAM算法详解|Detour地面纹理SLAM算法详解]]&lt;br /&gt;
* [[Special:MyLanguage/多定位源的自动综合|多定位源的自动综合]]&lt;br /&gt;
&lt;br /&gt;
[[Category:开发手册]]&lt;/div&gt;</summary>
		<author><name>Artheru</name></author>
	</entry>
</feed>