feat(nuscenes/lidar-model): add nuScenes V4 converter and lidar-model estimation lib / evaluation tool#128
Merged
Conversation
f05c1db to
f8deb39
Compare
988e4da to
9d2d19c
Compare
a08ab36 to
713b3d1
Compare
janickm
commented
Jun 3, 2026
76c9c5b to
1fc7199
Compare
8303933 to
a202ad7
Compare
janickm
commented
Jun 5, 2026
Add tools/data_converter/structured_lidar_model.py -- a generic, sensor-agnostic library for deriving structured spinning lidar models from motion-compensated point cloud data. Composable low-level steps: - extract_column_azimuths: per-column median azimuth from far-range points - compute_column_alignment: brute-force integer shift search - assign_model_columns: 1:1 or sub-column fine-grained mapping - compute_frame_timestamps: linear interpolation from column position (fencepost: col/N, not col/(N-1), next frame starts at frame_end_us) - upsample_model: interpolate column azimuths to higher resolution to compensate for per-revolution azimuth drift in mechanical spinning - optimize_model: multi-frame median correction of azimuths and offsets - compute_model_consistency: angular error metrics - compute_intra_column_firing_offsets: generic intra-column timing model - derive_model_from_decompensated: empirical model from decompensated frame High-level convenience: align_frame() orchestrates the full pipeline. When timestamps_us is provided, uses them directly (skips column-index approximation -- for sensors with known per-point timestamps). HDL-32E presets included as a reference implementation. Includes 18 unit tests (no external data dependency).
426c6e9 to
4133f44
Compare
Collaborator
Author
|
/ok to test d123655 |
Add ncore_evaluate_lidar_model -- a CLI tool that evaluates structured lidar model quality by comparing model-predicted ray directions against native directions derived from stored sensor-frame points (via compat API: get_frame_point_cloud with motion_compensation=False). Follows the standard tool CLI pattern: CLIBaseParams frozen dataclass, cli() group packs into ctx.obj, v4() constructs SequenceLoaderV4 then delegates to run(params: CLIBaseParams, loader: SequenceLoaderProtocol). Uses StructuredLidarModel.maybe_from_parameters() + elements_to_sensor_rays() (torch) for model direction computation. Metrics: - Combined angular error (mean/median/p95/max), all points and far-range - Signed azimuth error and signed elevation error (far-range) - Per-row and per-frame breakdowns for systematic issue detection - Pixel-equivalent error when --camera-id is provided Warning threshold: --warn-threshold-deg (default 0.05 deg) issues a WARNING if mean far-range error or systematic azimuth/elevation error exceeds the bound. Image output (when --camera-id + --output-dir provided): - overlay: native points (cyan) + model points (red) on camera image - error: points colored by angular error magnitude (turbo colormap) Sphinx docs added at docs/tools/lidar_model_eval.rst.
Add a nuScenes dataset converter (CLI: nuscenes-v4) that produces NCore V4 format sequences. Uses the generic structured lidar model library (tools/data_converter/structured_lidar_model.py) for all model derivation, alignment, and optimization. Handles: - 6 cameras (global shutter, undistorted) - 1 lidar (HDL-32E, motion-decompensated, structured model) - 5 radars (Continental ARS 408, radial velocity + RCS) - 3D cuboid annotations (world_global frame) Lidar model pipeline (CLI flags): - --lidar-model-source nominal|empirical (default: nominal) - --lidar-model-resolution 1|2|4 (default: 4, sub-column alignment) - --lidar-model-optimization-passes N (default: 1, multi-frame opt) Nominal + 4x + 1 opt pass achieves 0.029 deg far-range angular error, matching PAI extraction quality. Closes NVIDIA#123
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
Add a nuScenes dataset converter for NCore V4 format, a generic structured lidar model extraction library, and a lidar model evaluation tool.
Closes #123
Architecture
The work is split into three self-contained commits:
1.
feat(data_converter): add structured lidar model extraction librarytools/data_converter/structured_lidar_model.py-- a generic, reusable library for deriving structured spinning lidar models from motion-compensated point cloud data. Designed for datasets that lack raw sensor timestamps.Key features:
extract_column_azimuths,compute_column_alignment,assign_model_columns,compute_frame_timestamps,decompensate_frameupsample_model): interpolate column azimuths to 2x/4x for sub-column alignment precisionoptimize_model): median-based correction across many framesalign_frame(timestamps_us=...)for sensors with known per-point timestamps2.
feat(tools): add lidar model evaluation tooltools/ncore_evaluate_lidar_model.py-- CLI tool that evaluates model quality by comparing model-predicted vs stored native directions. Works on any V4 sequence.Outputs:
3.
feat(nuscenes): add nuScenes to NCore V4 converterFull converter handling 6 cameras, 1 lidar (HDL-32E), 5 radars, 3D cuboid annotations. Uses the generic library directly (no local lidar model code).
Lidar Model Quality
Recommended config:
--lidar-model-source nominal --lidar-model-resolution 4 --lidar-model-optimization-passes 1Key Design Decisions
timestamps_usparameter onalign_framesupports sensors with known per-point timestamps (e.g., raw PCAP data).tools/data_converter/level (not inside nuscenes/) for reuse by other converters.Testing