Skip to content

extract ComputeResidual2D/ComputeJacobians2D, add unit test#77

Open
woosik2510 wants to merge 2 commits into
masterfrom
feat/unit-test-wheel-jacobian-2d
Open

extract ComputeResidual2D/ComputeJacobians2D, add unit test#77
woosik2510 wants to merge 2 commits into
masterfrom
feat/unit-test-wheel-jacobian-2d

Conversation

@woosik2510

Copy link
Copy Markdown
Collaborator

Full unit test coverage for wheel updater Jacobians

# Scope Status
1/4 2D: extract ComputeResidual2D + ComputeJacobians2D (pose + extrinsic), unit test THIS PR
2/4 3D: extract ComputeResidual3D + ComputeJacobians3D (pose + extrinsic), unit test next
3/4 2D + 3D: time-offset Jacobian unit tests upcoming
4/4 2D + 3D: intrinsic preintegration Jacobian unit tests upcoming

Summary

  • Extracts the 2D wheel residual computation and pose/extrinsic Jacobians from compute_linear_system_2D into two public static functions: ComputeResidual2D and ComputeJacobians2D.
  • ComputeJacobians2D returns std::pair<MatrixXd, MatrixXd> - {H_poses (3x12), H_ext (3x6)} - avoiding output parameters.
  • compute_linear_system_2D is refactored to call these; FEJ values are passed for Jacobians, current values for residuals. The time-offset column is reconstructed from H_poses sub-blocks, removing the need for local intermediate variables.
  • mins/tests/test_UpdaterWheel2D.cpp verifies both Jacobians with central finite differences (eps=1e-6) plus a sign check for entries where the numerical magnitude exceeds the tolerance.

Verification

Build in WSL2 Noetic environment and run:

catkin build mins && rosrun mins mins_test --gtest_filter=WheelJacobian2D*

Chain

Next in chain: PR 2/4 - 3D pose + extrinsic Jacobians.

PR 1/4 of wheel Jacobian unit test campaign.
Extracts 2D residual and pose+extrinsic Jacobians into public static
functions, refactors compute_linear_system_2D to call them, and adds
test_UpdaterWheel2D.cpp with central finite-difference and sign checks.
@github-actions

github-actions Bot commented Jul 25, 2026

Copy link
Copy Markdown

Unit Test Results

Test Result Duration
test_UpdaterVicon ✅ Passed 0.07s
test_UpdaterWheel2D ✅ Passed 0.07s

2/2 passed

@github-actions

github-actions Bot commented Jul 25, 2026

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.165 +/- 0.038 0.166 +/- 0.038 +0.6%
RMSE pos (m) 0.052 +/- 0.009 0.052 +/- 0.009 +0.0%
NEES ori 3.400 +/- 1.200 3.400 +/- 1.300 +0.0%
NEES pos 2.600 +/- 0.600 2.600 +/- 0.600 +0.0%
Time (s) 29.000 +/- 0.200 29.000 +/- 0.500 +0.0%
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) 18.700 +/- 0.200 18.800 +/- 0.200 +0.5%
stereo_lidar
Metric master PR Delta (mean)
RMSE ori (deg) 0.144 +/- 0.040 0.144 +/- 0.040 +0.0%
RMSE pos (m) 0.057 +/- 0.012 0.057 +/- 0.012 +0.0%
NEES ori 1.600 +/- 1.000 1.600 +/- 1.000 +0.0%
NEES pos 5.100 +/- 5.200 5.100 +/- 5.300 +0.0%
Time (s) 31.400 +/- 0.200 31.100 +/- 0.300 -1.0%
stereo_wheel
Metric master PR Delta (mean)
RMSE ori (deg) 0.202 +/- 0.037 0.202 +/- 0.037 +0.0%
RMSE pos (m) 0.074 +/- 0.020 0.074 +/- 0.020 +0.0%
NEES ori 3.100 +/- 0.900 3.100 +/- 0.900 +0.0%
NEES pos 27.600 +/- 26.900 27.600 +/- 26.900 +0.0%
Time (s) 21.300 +/- 0.200 21.300 +/- 0.400 +0.0%
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.500 +/- 0.000 0.500 +/- 0.000 +0.0%
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) 19.100 +/- 0.300 19.100 +/- 0.200 +0.0%

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