[codex] Add vehicle-constrained GICP prior#7
Open
FieldDiTian wants to merge 4 commits into
Open
Conversation
Match Luminar aux sweeps by per-point absolute timestamp range instead of header stamp alone. The right Luminar header can be closest to the primary while its point timestamps are one scan period early, which expands the merged sweep window before prev_scan_stamp and makes integrateImu reject deskew with 0 frames. Add a localization/lidar_concat/luminar_time_threshold parameter, reuse the raw timestamp decoder for primary anchoring and aux matching, and drop timestamp-misaligned aux scans rather than appending a wrong sweep. Verified with gicp-test smoke on Run5 data / Run3 local ENU map at start-offset 160 for 60s: build passes, debug-only bag passes, authoritative 666-frame audit, IMU integration failed count 0, scan_time_span_s p50/max about 0.049s.
Keep GICP on a single-hypothesis path while replacing the raw free-IMU prior with a vehicle-constrained prior when a trusted motion reference is available. The vehicle prior is derived from the last trusted pose, observer velocity, scan dt, and IMU yaw-rate, then clamps vertical drift, forward speed, lateral speed, and yaw-rate before GICP alignment. Rejected frames fall back to the selected vehicle prior when it was used, otherwise the raw IMU prior. Add debug outputs for vehicle prior pose, prior deltas, and use state, and tighten motion-consistency defaults so accepted candidates obey ground-vehicle speed, heading, curvature, and yaw-rate limits.
There was a problem hiding this comment.
Pull request overview
This PR updates gicp_localization to better match AV-24 race-car motion assumptions by (1) making Luminar deskew/aux concatenation rely on absolute per-point time alignment, and (2) adding a vehicle-constrained prior plus motion-consistency gating/diagnostics to stabilize GICP initialization and rejection handling.
Changes:
- Preserve the configured Luminar sensor type through startup and improve aux Luminar sweep matching using per-point absolute timestamp ranges.
- Add motion-consistency diagnostics/gating and a vehicle-constrained prior used as the single GICP initial guess when control is ready.
- Add debug topics and documentation updates covering the active prior path and new gates.
Reviewed changes
Copilot reviewed 4 out of 4 changed files in this pull request and generated 1 comment.
| File | Description |
|---|---|
| gicp_localization/src/localization.cc | Implements Luminar timestamp-range matching, motion-consistency gate, and vehicle prior; wires debug publishers and integrates the prior into GICP initialization/fallback logic. |
| gicp_localization/include/gicp_localization/localization.h | Adds data structures and parameters for motion consistency and vehicle-prior computation, plus new debug publishers/state. |
| gicp_localization/cfg/localization.yaml | Adds/tightens defaults for Luminar time-range thresholding, motion-consistency gating, and vehicle-prior limits for race-car dynamics. |
| gicp_localization/README.md | Updates pipeline documentation to describe the vehicle-prior correction path, additional gates, and new debug metrics. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Comment on lines
+3121
to
+3124
| if (luminar_time_match) { | ||
| const LuminarTimestampRangeNs aux_range = | ||
| luminarTimestampRangeFromCloud(*msg, aux_clock_off); | ||
| if (!aux_range.valid) { |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Summary
This PR updates
gicp_localizationto make the LiDAR deskew path, aux-Luminar matching, and GICP prior more consistent with the AV-24 race-car platform.Final diff scope:
gicp_localization/src/localization.ccgicp_localization/include/gicp_localization/localization.hgicp_localization/cfg/localization.yamlgicp_localization/README.mdMain behavior changes:
Commit-by-commit
8cd08b8- deskew timestep fixgetParams()solocalization/sensor_type: "luminar"remains active after parameter loading.evaluateMotionConsistency()to compare a candidate against the last trusted trajectory point.current_pose, observer state, or the next trusted reference.99a9699- Fix Luminar aux timestamp matchinglocalization/lidar_concat/luminar_time_threshold.20afcae- Add vehicle-constrained GICP priorVehiclePriorResultandcomputeVehiclePrior().T_vehicle_priorfrom the last trusted pose, observer/world velocity, scan dt, and IMU yaw rate.T_priorfallback.gicp/localization/debug/vehicle_prior_posegicp/localization/debug/prior_delta_trans_mgicp/localization/debug/prior_delta_yaw_deggicp/localization/debug/vehicle_prior_usedT_prior,T_vehicle_prior, candidate gating, and GT snap recovery responsibilities.Validation
git diff --check origin/art-jazzy...HEADpassed.source /opt/ros/jazzy/setup.bash && colcon build --packages-select gicp_localization --symlink-install --cmake-args -DCMAKE_BUILD_TYPE=Releasepassed.