二维码识别导航

来自MDCS wiki2
Artheru讨论 | 贡献2026年5月16日 (六) 19:42的版本 (Initial bilingual draft (auto-published))
(差异) ←上一版本 | 最后版本 (差异) | 下一版本→ (差异)
跳到导航 跳到搜索


概述 / Overview

二维码导航(QR-based navigation)把 二维码作为地面 / 立面的人工地标,车上相机识别二维码 ID + 几何位姿,反推车体绝对位姿。它是 MDCS 中 最简单、最低成本的定位方案,但对地面平整度与维护有较高要求。

QR-code navigation uses QR tags on the floor or walls as artificial landmarks. An on-board camera reads tag ID + geometric pose, inverting to get the vehicle's absolute pose. It's the simplest, lowest-cost localisation option in MDCS, but demands smooth floors and ongoing tag maintenance.

与其它方案的对比 / vs alternatives

项 / Item 二维码 / QR 色带 / 磁条 激光 SLAM
路径自由度 / Path freedom 极高(不需要连续轨道) 强制沿铺设线 自由
部署成本 / Deploy cost 低(贴二维码) 中(贴色带 / 磁条) 高(建图 + 调试)
维护 / Maintenance 高(二维码易磨损)
定位精度 / Pose precision ±10 mm / 0.5° (单二维码) ±5 mm 横向 ±5–20 mm
地面平整度要求 / Flatness 高(防相机俯仰误差)
复用激光的能力 / Reuse with SLAM N/A

硬件 / Hardware

  • 相机: 下视工业相机 + LED 环形灯(防自然光干扰)
  • 二维码: 5–15 cm 边长;推荐用 ArUco(识别速度 + 编码效率)或 AprilTag(鲁棒性最高)
  • 贴布: 镭雕金属牌或防水贴纸 + 透明保护层
  • 分辨率: 相机像素 / 二维码尺寸需保证 ≥ 20 像素 / 二维码方格边长

算法 / Algorithm

检测与解码 / Detection & decode

1. 灰度化 + 自适应阈值 → 边缘检测 2. 多边形拟合,筛选有 4 角 + 内方框的候选 3. 透视变换矫正 4. 解码 ID(ArUco / AprilTag)

位姿解算 / Pose estimation

已知二维码的 边长 L 和 4 个角点像素坐标 → PnP 求解相机相对二维码位姿。再用 二维码 → 世界变换(预先标定的二维码绝对位姿)反推车体在世界的位姿。

Given the tag's edge length L and its four corner pixel coordinates, PnP solves the camera-relative pose. Multiplying by the tag-to-world transform (calibrated up-front) gives the vehicle's world pose.

多二维码融合 / Multi-tag fusion

单帧中若同时见到 N ≥ 2 个二维码,做 最小二乘融合,精度提升 √N。

If multiple tags are visible in one frame, fuse them by least squares; precision scales as √N.

部署 / Deployment

布点规则 / Tag placement rules:

  • 关键停靠位(取放料工位、充电位)正下方贴
  • 长直走廊每 1.5–3 m 一个
  • 分叉前后各贴一对
  • 高速段(> 1 m/s)二维码间距应 < 1 m

标定 / Calibration:

维护 / Maintenance:

  • 每周检查关键二维码完整性。
  • 磨损 / 部分遮挡 → 立即更换。
  • 二维码贴布建议用 可剥离强力胶加可清洁透明膜保护。

MDCS 集成 / MDCS integration

二维码定位作为 Detour 的一个 SLAM 后端

  • `useQRSlam = true` 在 Detour 配置中启用
  • 二维码地图存为 JSON(每条目:tagId + (x, y, z, th))
  • TightCoupler 把 QR 位姿与激光 / IMU 融合

QR localisation enters Detour as a SLAM backend. Enable `useQRSlam = true`; provide a JSON tag map (tagId + 4-DoF world pose). TightCoupler fuses QR with laser / IMU.

与"纯二维码导航"的区别 / vs pure-QR navigation

  • 混合模式(本页): QR 作为 Detour 的一个观测源,与 SLAM 共存。
  • 纯二维码: 只用二维码定位,无 SLAM;车体每帧必须看到 ≥ 1 个二维码。见 纯二维码导航

The hybrid mode (this page) lets QR coexist with SLAM. Pure-QR mode (linked page) uses no SLAM and requires the camera to see ≥ 1 tag every frame.

常见问题 / Common issues

  • 二维码反光 / Glare: 调相机角度 + LED 偏振。
  • 叉车叉齿挡住 / Forks blocking view: 相机不要装在叉齿下方。
  • 高速运动模糊 / Motion blur: 相机用 全局快门与短曝光(< 1 ms)。
  • 标定漂 / Pose drift due to calibration: 每月做一次随机抽检(5 个二维码)。

相关页面 / See also