Files

168 lines
4.9 KiB
Markdown
Raw Permalink Normal View History

# 雷达与 RTK 标定说明书
本文说明如何用本仓库完成 **双天线 RTK ↔ 3D 激光雷达** 外参标定,得到可直接使用的 `T_RTK_lidar`
默认交付坐标系为 **车头向前**`HeadingOffsetDeg = -90`)。更完整的指标与本次结果见根目录 [`README.md`](README.md)。
---
## 1. 标定目标
```text
p_RTK = T_RTK_lidar · p_lidar
```
| 项目 | 说明 |
|---|---|
| 输出文件 | `final_T_RTK_lidar.json` |
| 坐标系 | **车头向前**GGA 原点 + 车头 X(本车 `HeadingOffsetDeg=-90` |
| 不用到的量 | 车体航向偏置、天线 XY 杆臂、IMU 融合姿态(双天线 pitch/roll 默认进入参考位姿) |
| 必须提供 | 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 -90 `
-ExpectedStations 27 `
-GroundZMin -2.5 `
-GroundZMax -1.5
```
| 参数 | 含义 |
|---|---|
| `-RtkReferenceHeightAboveGroundM` | 相位中心离地高(m),**必填**;本车 1.9165 |
| `-HeadingOffsetDeg` | 默认 **-90** = 车头向前(本车主从装反) |
| `-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_vehicle_h19165" `
-OutputRoot "D:\data\rtk_lidar_run\outputs_vehicle_h19165" `
-RtkReferenceHeightAboveGroundM 1.9165 `
-HeadingOffsetDeg -90 `
-ExpectedStations 27 `
-GroundZMin -2.5 `
-GroundZMax -1.5
```
> 不得复用其他车辆或历史采集的天线离地高度、站点数量与外参结果。
---
## 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_vehicle_h19165"
$Work = "D:\data\rtk_lidar_run\prepared_vehicle_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)。