Files
calibration/雷达与RTK标定说明书.md
T

168 lines
4.9 KiB
Markdown
Raw Blame History

This file contains ambiguous Unicode characters
This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.
# 雷达与 RTK 标定说明书
本文说明如何用本仓库完成 **双天线 RTK ↔ 3D 激光雷达** 外参标定,得到可直接使用的 `T_RTK_lidar`
默认交付坐标系为 **基线系**`HeadingOffsetDeg = 0`)。更完整的指标与本次结果见根目录 [`README.md`](README.md)。
---
## 1. 标定目标
```text
p_RTK = T_RTK_lidar · p_lidar
```
| 项目 | 说明 |
|---|---|
| 输出文件 | `final_T_RTK_lidar.json` |
| 坐标系 | **基线系**GGA 原点 + `rawHeading` 基线方向为 X(不是车体后轮轴系) |
| 不用到的量 | 车体航向偏置、天线 XY 杆臂、IMU 姿态 |
| 必须提供 | RTK 参考点(通常 ANT1)**相位中心**离地高度 |
| pair 配准 | **禁止**使用外参 seed |
| 求解初值 | 可用 `run/rtk_lidar_mechanical_initial.json`(仅 AX=XB |
当前车(2026-08)示例参数:高度 **1.9165 m**,地面 ROI **`[-2.5, -1.5]`**,期望站数 **27**
若下游需要车体外参:
```text
T_body_lidar = T_body_rtk · T_RTK_lidar
```
---
## 2. 环境准备
- 系统:Windows + PowerShell
- Python3.11
- `python -m pip install -r requirements.txt`NumPy、SciPy、Open3D、small_gicp
---
## 3. 数据采集
### 3.1 每站独立目录
```text
raw_dataset/
├── stations/001|002|.../
└── captures/rtk.rscap , imu.rscap
```
### 3.2 G90 连续录制 + 站时间窗(本次 27 站)
`tools/export_g90_h32_windows_to_combined.py`(见 [`run/README.md`](run/README.md)),时间基多为 host UTC。
### 3.3 采集要求
| 要求 | 建议 |
|---|---|
| 站点数 | ≥ 30(更好 40~60);本批 27 为最低可跑规模 |
| 相邻站转角 | 约 **15°~30°**,避免一长串同朝向 |
| 车辆状态 | **完全静止**后再记点云 |
| RTK | 固定解,航向有效;站内航向圆标准差 ≤ 0.5° |
| 必测量 | ANT1 相位中心离地高度 |
现场确认:GGA 对应哪根天线、`rawHeading` 方向、离地高度测法(改高度必须重跑求解)。
---
## 4. 一键标定
### 4.1 站目录 → combined
```powershell
python tools\export_raw_to_combined.py `
--stations-root "E:\calibration_data\stations" `
--rtk-rscap "E:\calibration_data\captures\rtk.rscap" `
--imu-rscap "E:\calibration_data\captures\imu.rscap" `
--out "E:\calibration_output\exported" `
--overwrite
```
### 4.2 导出 + 求解
```powershell
$Repo = (Resolve-Path ".").Path
$Raw = "E:\calibration_data\stations_batch"
$Out = "E:\calibration_output\rtk_lidar"
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$Repo\run\run_full_pipeline.ps1" `
-DataRoot "$Raw\stations" `
-RtkCapture "$Raw\captures\rtk.rscap" `
-ImuCapture "$Raw\captures\imu.rscap" `
-OutputRoot $Out `
-RtkReferenceHeightAboveGroundM 1.9165 `
-HeadingOffsetDeg 0 `
-ExpectedStations 27 `
-GroundZMin -2.5 `
-GroundZMax -1.5
```
| 参数 | 含义 |
|---|---|
| `-RtkReferenceHeightAboveGroundM` | 相位中心离地高(m),**必填**;本车 1.9165 |
| `-HeadingOffsetDeg` | 默认 0 = 基线系 |
| `-GroundZMin/Max` | 约 2 m 雷达用 `[-2.5,-1.5]` |
| `-ExpectedStations` / `-MinStations` | 本批 27 / 20 |
### 4.3 已有 combined
```powershell
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$Repo\run\run_direct_rtk_lidar.ps1" `
-CombinedRoot "D:\data\rtk_lidar_run\combined" `
-WorkRoot "D:\data\rtk_lidar_run\prepared_baseline_h19165" `
-OutputRoot "D:\data\rtk_lidar_run\outputs_baseline_h19165" `
-RtkReferenceHeightAboveGroundM 1.9165 `
-HeadingOffsetDeg 0 `
-ExpectedStations 27 `
-GroundZMin -2.5 `
-GroundZMax -1.5
```
> 历史文档中的 **0.758 m / 34 站** 属于另一台车(data4),不要用于本车。
---
## 5. 输出说明
```text
$OutputRoot/
├── open3d_gicp/ small_gicp/ consensus/
├── common/ground_planes.csv
├── summary.json
└── final_T_RTK_lidar.json
```
`summary.json` 的共识对数、AX 残差、bootstrap、双后端差。内部一致性 ≠ ±3 cm 绝对真值。
---
## 6. 可视化
```powershell
$Repo = "D:\First-dev-dept\calibration-rtk-run"
$Out = "D:\data\rtk_lidar_run\outputs_baseline_h19165"
$Work = "D:\data\rtk_lidar_run\prepared_baseline_h19165"
powershell.exe -NoProfile -ExecutionPolicy Bypass -File "$Repo\run\view_result.ps1" `
-Frames "$Work\frames_all" `
-Pairs "$Out\consensus\B_consensus.npz" `
-Extrinsic "$Out\final_T_RTK_lidar.json" `
-PairIndex 0
```
重点看模式 **3 与 4**;用 `N`/`P` 多看**大转角**运动对。
---
## 7. 注意事项
1. z 靠实测天线高度约束;改高度必须重跑求解。
2. 不要改站点顺序;pair 索引依赖顺序。
3. 只用 `points_raw`,禁止已变到车体的点。
4. pair 阶段禁止外参 seed。
5. IMU 只关联,不求解 IMU 外参。
6. 尾部残差(P95/max)常被同朝向小转角站拉高,见根 README 第 7 节。
更细算法与本次数值结果见 [`README.md`](README.md)。