Skip to content

Move the interpolation caches to ENU along with the state at GPS init - #134

Open
woosik2510 wants to merge 1 commit into
masterfrom
fix/gps-enu-stale-caches
Open

woosik2510 wants to merge 1 commit into
masterfrom
fix/gps-enu-stale-caches

Conversation

@woosik2510

Copy link
Copy Markdown
Collaborator

Found while testing #58.

transform_state_to_ENU moves the IMU and the clones from the VIO world frame into ENU, but three things in State stay in the world frame:

  • intr_jcb, the cache of interpolated poses per sensor and time. A camera or lidar time interpolated before GPS init gets its old world-frame pose back afterwards.
  • cpis[*].v, the clone velocities get_interpolated_pose_imu integrates from (use_imu_res).
  • the fej and estimate interpolation polynomials. Their position differences are in the world frame, and they are only refit when their clone set changes.

The new State::rotate_interpolation_data clears the cache, rotates the velocities and refits the polynomials. transform_state_to_ENU calls it at the end.

CI never hit this. The GPS sims start from the true ENU transform (init_use_gt_gnss defaults to true), so the transform never runs. With an online init and an identity world-to-ENU transform the stale values happen to be right. Real data always has a yaw between the two.

Test

GPSInitialization.APoseInterpolatedBeforeTheMoveComesBackInENU interpolates a camera time, initializes GPS, and checks that the same request now returns the ENU pose and that a CPI velocity was rotated. On master it fails on position, rotation and velocity. Without the polynomial refit it still fails on position. All 10 test binaries pass.

Sim

Stereo + GPS, online GPS init (init_use_gt_gnss:=false), sim T_WtoE set to a 90 deg yaw with offset (10, -5, 2), 20 seeds. IMU pose after GPS init against the ENU truth, no alignment:

ATE pos ATE ori NEES pos NEES ori
master 0.877 m 0.77 deg 114 145
this PR 0.102 m 0.24 deg 3.1 3.2

Scored from Release builds with a local fix to State_Logger.h: its assert(sim->get_imu_state(...)) compiles out in Release, so imu_gt.txt holds no truth there. Separate fix, not in this PR.

KAIST

ICGLW on 15 sequences, the same change on top of #133 (local, m/km): tune mean 1.046 -> 1.034, hold-out 1.347 -> 1.336. Small, which fits: KAIST is scored after SE3 alignment, and the stale values only last until the clones they were built on leave the window. The KAIST CI on this PR gives the numbers against master.

@github-actions

Copy link
Copy Markdown

Unit Test Results

Test Cases Result Duration
test_WheelTypes 7/7 ✅ Passed 0.00s

10/10 test binaries passed, 147/147 cases

@github-actions

Copy link
Copy Markdown

Unit Test Code Coverage

Area master this branch
update/cam 0.0% 0.0% (0/623)
update/gps 92.0% 92.1% (464/504)
update/lidar 61.9% 61.7% (1096/1775) -0.1
update/vicon 98.9% 98.9% (86/87)
update/wheel 98.9% 98.9% (527/533)
update 38.8% 38.8% (31/80)
state 49.2% 49.5% (708/1429) +0.4
init 0.0% 0.0% (0/704)
options 48.1% 48.1% (366/761)
core 0.0% 0.0% (0/962)
sim 0.0% 0.0% (0/1094)
utils 11.6% 11.6% (68/587)
other 41.1% 41.1% (387/941)

Overall 37.0% (3733/10080) across mins/src, master is 37.0%.

Full HTML report is in the coverage-report artifact of this run.

@github-actions

Copy link
Copy Markdown

Simulation regression report - master vs PR

8 seeds/config, sim UD_Warehouse, informational only (does not block merge).
Delta is PR relative to master (mean). Lower is better for RMSE / Time; NEES closer to ~1-3 is well-calibrated.

full
Metric master PR Delta (mean)
RMSE ori (deg) 0.164 +/- 0.038 0.164 +/- 0.038 +0.0%
RMSE pos (m) 0.053 +/- 0.009 0.053 +/- 0.009 +0.0%
NEES ori 3.400 +/- 1.300 3.400 +/- 1.300 +0.0%
NEES pos 2.700 +/- 0.700 2.700 +/- 0.700 +0.0%
Time (s) 30.900 +/- 0.300 31.000 +/- 0.400 +0.3%
stereo_gps
Metric master PR Delta (mean)
RMSE ori (deg) 0.158 +/- 0.033 0.158 +/- 0.033 +0.0%
RMSE pos (m) 0.076 +/- 0.012 0.076 +/- 0.012 +0.0%
NEES ori 4.400 +/- 2.100 4.400 +/- 2.100 +0.0%
NEES pos 3.800 +/- 1.200 3.800 +/- 1.200 +0.0%
Time (s) 10.400 +/- 0.100 10.600 +/- 0.200 +1.9%
vicon
Metric master PR Delta (mean)
RMSE ori (deg) 0.148 +/- 0.005 0.148 +/- 0.005 +0.0%
RMSE pos (m) 0.008 +/- 0.000 0.008 +/- 0.000 +0.0%
NEES ori 4.200 +/- 0.200 4.200 +/- 0.200 +0.0%
NEES pos 4.200 +/- 0.200 4.200 +/- 0.200 +0.0%
Time (s) 0.700 +/- 0.000 0.700 +/- 0.000 +0.0%
vicon_lidar
Metric master PR Delta (mean)
RMSE ori (deg) 0.132 +/- 0.005 0.132 +/- 0.005 +0.0%
RMSE pos (m) 0.008 +/- 0.000 0.008 +/- 0.000 +0.0%
NEES ori 3.900 +/- 0.300 3.900 +/- 0.300 +0.0%
NEES pos 4.100 +/- 0.200 4.100 +/- 0.200 +0.0%
Time (s) 8.300 +/- 0.100 8.600 +/- 0.100 +3.6%
vio_stereo
Metric master PR Delta (mean)
RMSE ori (deg) 0.174 +/- 0.036 0.174 +/- 0.036 +0.0%
RMSE pos (m) 0.111 +/- 0.032 0.111 +/- 0.032 +0.0%
NEES ori 2.000 +/- 0.900 2.000 +/- 0.900 +0.0%
NEES pos 12.600 +/- 16.500 12.600 +/- 16.500 +0.0%
Time (s) 18.600 +/- 0.500 19.100 +/- 0.200 +2.7%
wheel_2d_ang
Metric master PR Delta (mean)
RMSE ori (deg) 0.129 +/- 0.004 0.129 +/- 0.004 +0.0%
RMSE pos (m) 0.007 +/- 0.000 0.007 +/- 0.000 +0.0%
NEES ori 3.900 +/- 0.300 3.900 +/- 0.300 +0.0%
NEES pos 4.000 +/- 0.200 4.000 +/- 0.200 +0.0%
Time (s) 0.800 +/- 0.000 0.800 +/- 0.000 +0.0%
wheel_2d_cen
Metric master PR Delta (mean)
RMSE ori (deg) 0.129 +/- 0.004 0.129 +/- 0.004 +0.0%
RMSE pos (m) 0.007 +/- 0.000 0.007 +/- 0.000 +0.0%
NEES ori 3.800 +/- 0.300 3.800 +/- 0.300 +0.0%
NEES pos 4.100 +/- 0.200 4.100 +/- 0.200 +0.0%
Time (s) 0.800 +/- 0.000 0.800 +/- 0.000 +0.0%
wheel_2d_lin
Metric master PR Delta (mean)
RMSE ori (deg) 0.130 +/- 0.005 0.130 +/- 0.005 +0.0%
RMSE pos (m) 0.007 +/- 0.000 0.007 +/- 0.000 +0.0%
NEES ori 3.900 +/- 0.300 3.900 +/- 0.300 +0.0%
NEES pos 4.000 +/- 0.300 4.000 +/- 0.300 +0.0%
Time (s) 0.400 +/- 0.000 0.400 +/- 0.000 +0.0%
wheel_3d_ang
Metric master PR Delta (mean)
RMSE ori (deg) 0.113 +/- 0.004 0.113 +/- 0.004 +0.0%
RMSE pos (m) 0.006 +/- 0.000 0.006 +/- 0.000 +0.0%
NEES ori 3.700 +/- 0.200 3.700 +/- 0.200 +0.0%
NEES pos 3.700 +/- 0.200 3.700 +/- 0.200 +0.0%
Time (s) 0.500 +/- 0.000 0.500 +/- 0.000 +0.0%
wheel_3d_cen
Metric master PR Delta (mean)
RMSE ori (deg) 0.115 +/- 0.004 0.115 +/- 0.004 +0.0%
RMSE pos (m) 0.006 +/- 0.000 0.006 +/- 0.000 +0.0%
NEES ori 3.900 +/- 0.200 3.900 +/- 0.200 +0.0%
NEES pos 3.900 +/- 0.200 3.900 +/- 0.200 +0.0%
Time (s) 0.600 +/- 0.000 0.600 +/- 0.000 +0.0%
wheel_3d_lin
Metric master PR Delta (mean)
RMSE ori (deg) 0.114 +/- 0.004 0.114 +/- 0.004 +0.0%
RMSE pos (m) 0.006 +/- 0.000 0.006 +/- 0.000 +0.0%
NEES ori 3.800 +/- 0.200 3.800 +/- 0.200 +0.0%
NEES pos 3.800 +/- 0.200 3.800 +/- 0.200 +0.0%
Time (s) 0.500 +/- 0.000 0.500 +/- 0.000 +0.0%

@github-actions

Copy link
Copy Markdown

Calibration Convergence Report

10 seeds · sim UD_Warehouse · informational only (does not block merge).

Scenario Parameters ±3σ
Camera Time Offset 1/1 params ✅
Camera Extrinsic (IMU↔Cam) 6/6 params ✅
Camera Intrinsics 8/8 params ✅
GPS Time Offset 1/1 params ✅
GPS Extrinsic (IMU↔GPS) 3/3 params ✅
GPS World-to-ENU Init (one-shot) 4/4 params ✅
LiDAR Time Offset 1/1 params ✅
LiDAR Extrinsic (IMU↔LiDAR) 6/6 params ✅
Vicon Time Offset 1/1 params ✅
Vicon Extrinsic (IMU↔Vicon) 6/6 params ✅
Wheel Time Offset 1/1 params ✅
Wheel Extrinsic (IMU↔Wheel) 6/6 params ✅
Wheel Intrinsics (Wheel2DAng) 3/3 params ✅
Wheel Intrinsics (Wheel3DAng) 3/3 params ✅
Per-parameter details

✅ Camera Time Offset

Parameter final abs error final σ ±3σ
time offset (s) 0.000179 0.00015 ✅

✅ Camera Extrinsic (IMU↔Cam)

Parameter final abs error final σ ±3σ
φ_x (rad) 0.00015 0.000271 ✅
φ_y (rad) 6.79e-05 0.000287 ✅
φ_z (rad) 0.000162 0.000268 ✅
p_x (m) 0.00314 0.00382 ✅
p_y (m) 0.00489 0.0049 ✅
p_z (m) 0.0039 0.00348 ✅

✅ Camera Intrinsics

Parameter final abs error final σ ±3σ
fu (px) 0.109 0.0788 ✅
fv (px) 0.115 0.0998 ✅
cu (px) 0.085 0.0998 ✅
cv (px) 0.0855 0.102 ✅
k₁ 0.000165 0.000196 ✅
k₂ 0.000104 0.000131 ✅
p₁ 2.43e-05 3.69e-05 ✅
p₂ 3.16e-05 2.35e-05 ✅

✅ GPS Time Offset

Parameter final abs error final σ ±3σ
time offset (s) 0.0031 0.00235 ✅

✅ GPS Extrinsic (IMU↔GPS)

Parameter final abs error final σ ±3σ
p_x (m) 0.0132 0.0229 ✅
p_y (m) 0.0216 0.0233 ✅
p_z (m) 0.0238 0.0237 ✅

✅ GPS World-to-ENU Init (one-shot)

Parameter final abs error final σ ±3σ
yaw (rad) 0.00211 0.0421 ✅
p_x (m) 0.0252 1.01 ✅
p_y (m) 0.088 0.576 ✅
p_z (m) 0.0723 0.413 ✅

✅ LiDAR Time Offset

Parameter final abs error final σ ±3σ
time offset (s) 0.00084 0.000187 ✅

✅ LiDAR Extrinsic (IMU↔LiDAR)

Parameter final abs error final σ ±3σ
φ_x (rad) 0.000539 0.000328 ✅
φ_y (rad) 0.000288 0.000315 ✅
φ_z (rad) 0.000253 0.000374 ✅
p_x (m) 0.00332 0.00556 ✅
p_y (m) 0.00568 0.00585 ✅
p_z (m) 0.00659 0.00836 ✅

✅ Vicon Time Offset

Parameter final abs error final σ ±3σ
time offset (s) 0.000105 0.000148 ✅

✅ Vicon Extrinsic (IMU↔Vicon)

Parameter final abs error final σ ±3σ
φ_x (rad) 0.000155 0.000546 ✅
φ_y (rad) 0.000295 0.000535 ✅
φ_z (rad) 0.000384 0.000576 ✅
p_x (m) 0.00313 0.00908 ✅
p_y (m) 0.00442 0.00919 ✅
p_z (m) 0.00327 0.00981 ✅

✅ Wheel Time Offset

Parameter final abs error final σ ±3σ
time offset (s) 8.74e-05 0.000212 ✅

✅ Wheel Extrinsic (IMU↔Wheel)

Parameter final abs error final σ ±3σ
φ_x (rad) 0.00413 0.00207 ✅
φ_y (rad) 0.000256 0.000346 ✅
φ_z (rad) 0.000184 0.00036 ✅
p_x (m) 0.000521 0.0023 ✅
p_y (m) 0.000627 0.00216 ✅
p_z (m) 0.0204 0.0237 ✅

✅ Wheel Intrinsics (Wheel2DAng)

Parameter final abs error final σ ±3σ
left radius (m) 1.42e-05 2.59e-05 ✅
right radius (m) 1.34e-05 2.59e-05 ✅
baseline (m) 0.000641 0.000938 ✅

✅ Wheel Intrinsics (Wheel3DAng)

Parameter final abs error final σ ±3σ
left radius (m) 1.51e-05 8.43e-05 ✅
right radius (m) 1.29e-05 8.5e-05 ✅
baseline (m) 0.00072 0.00209 ✅

cam_dt

cam_ext

cam_int

gps_dt

gps_ext

gps_wtoe

lidar_dt

lidar_ext

vicon_dt

vicon_ext

wheel_dt

wheel_ext

wheel_int_2d_ang

wheel_int_3d_ang

@github-actions

Copy link
Copy Markdown

KAIST Urban vs MINS paper Table 6 (SE3 ATE per GT km)

Mean m/km over the sequences where the paper, master and PR all have a full-length result.

config seq paper master pr
IC 11 2.65 3.02 3.02
ICW 22 7.43 7.12 7.12
IL 11 4.48 4.52 4.52
ILW 22 5.47 6.38 6.38
ICGLW 22 1.64 1.12 1.11
  • = no result in the paper (and none here), fail = no trajectory, * = run ended early, >1000 = diverged. Green = PR better than master, grey = same, red = worse.
config row 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39
km   3.9   3.0   3.2   3.7   3.4   3.4   4.2   2.5   4.0   5.2  11.2   3.6   5.4  11.3   7.1   7.4   7.9   3.2   9.0  11.7  11.2  10.7
IC paper     -     -     -     -     -     -     -     -  2.04  2.86  1.45  3.43  3.50  5.39  4.69  1.98  1.47     -     -     -  1.13  1.17
master     -     -     -     -     -     -     -     -  1.61  2.45  1.21  4.65  2.82  9.00  4.22  2.90  2.63     -     -     -  0.73  1.04
pr     -     -     -     -     -     -     -     - 1.61 2.45 1.21 4.65 2.82 9.00 4.22 2.90 2.63     -     -     - 0.73 1.04
ICW paper  7.13  8.74  8.24  8.47  9.16  7.10  8.17 10.73  1.57  3.85  1.10  3.16  2.03 29.79  4.15  2.46  2.43  8.15 16.47 18.50  0.94  1.23
master  8.57  8.99  8.55  9.46  9.72  7.56  8.52 10.54  2.43  2.54  1.24  5.67  3.20 16.12  6.35  2.99  2.40  8.36 14.54 16.97  1.20  0.81
pr 8.57 8.99 8.55 9.46 9.72 7.56 8.52 10.54 2.43 2.54 1.24 5.67 3.20 16.12 6.35 2.99 2.40 8.36 14.54 16.97 1.20 0.81
IL paper     -     -     -     -     -     -     -     -  2.69  2.97  2.53  3.96  6.21  5.11  5.68  9.18  5.30     -     -     -  3.50  2.17
master     -     -     -     -     -     -     -     -  2.17  3.24  2.53  4.10  6.13  6.53  5.99  8.90  4.86     -     -     -  3.04  2.17
pr     -     -     -     -     -     -     -     - 2.17 3.24 2.53 4.10 6.13 6.53 5.99 8.90 4.86     -     -     - 3.04 2.17
ILW paper  6.96  8.11  4.20  2.99  6.90  4.24  6.85  3.76  2.24  4.15  2.71  4.39  5.47  5.01  4.73  7.92  7.86  6.13 12.01  7.96  3.24  2.50
master  9.46 12.83  3.85  3.56 13.86  3.61  5.82  9.87  2.49  4.37  2.89  4.44  6.40  5.37  5.25  8.43  6.85  6.21 12.13  6.61  3.11  2.83
pr 9.46 12.83 3.85 3.56 13.86 3.61 5.82 9.87 2.49 4.37 2.89 4.44 6.40 5.37 5.25 8.43 6.85 6.21 12.13 6.61 3.11 2.83
ICGLW paper  1.52  3.46  0.85  0.79  1.49  1.38  1.85  3.44  1.06  1.72  0.79  2.58  1.83  0.70  0.77  1.16  0.94  5.46  2.38  0.60  0.64  0.56
master  1.42  0.76  0.24  0.42  0.55  0.72  1.17  2.81  0.92  1.74  0.79  2.52  1.82  0.58  0.65  1.19  0.46  1.80  2.26  0.52  0.62  0.59
pr 1.41 0.74 0.24 0.42 0.50 0.73 1.17 2.86 0.92 1.75 0.80 2.59 1.81 0.58 0.65 1.19 0.46 1.68 2.26 0.52 0.62 0.59

Trajectories bit-identical to master: 66 of 88

  • urban18 pr_ICGLW differs
  • urban19 pr_ICGLW differs
  • urban20 pr_ICGLW differs
  • urban21 pr_ICGLW differs
  • urban22 pr_ICGLW differs
  • urban23 pr_ICGLW differs
  • urban24 pr_ICGLW differs
  • urban25 pr_ICGLW differs
  • urban26 pr_ICGLW differs
  • urban27 pr_ICGLW differs
  • urban28 pr_ICGLW differs
  • urban29 pr_ICGLW differs
  • urban30 pr_ICGLW differs
  • urban31 pr_ICGLW differs
  • urban32 pr_ICGLW differs
  • urban33 pr_ICGLW differs
  • urban34 pr_ICGLW differs
  • urban35 pr_ICGLW differs
  • urban36 pr_ICGLW differs
  • urban37 pr_ICGLW differs
  • urban38 pr_ICGLW differs
  • urban39 pr_ICGLW differs

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant