Repository navigation
Description
Step 1 would benefit from independent display layers for comparing the current SLAM run with a previous run, an external reference trajectory, or a larger point cloud. For example, display the trajectory produced with another parameter set alongside the live trajectory and a reference cloud, with independently adjustable density and appearance.
These overlays would be for visualization only: loading, hiding, styling or removing one must not change the SLAM inputs, bucket maps, optimization, trajectory or exported processing results.
Existing support
Source inspection at main 0d9cc5a4d2042bfc2a9032ec558005fe8609ff80:
- Related issue step1, reference point clouds #143 covered reference-cloud usability and scalar coloring, but is closed. This proposal adds independent layers and comparison trajectories, rather than reopening the earlier alignment workflow.
- Step 1 already loads LAS/LAZ reference clouds for initial alignment. However,
load_reference_point_clouds()clears and rebuilds the processing bucket maps. That path cannot simply be reused for display-only overlays. - E57 import already exists in Step 2 (Add E57 import and pose write-back to step 2 #515, Respect downsampling and add drag-and-drop for e57 in step 2 #525), using the shared
core_e57loader. Step 1 integration is still needed; a separate PR is appropriate if extending the import path requires substantial work. A second E57 parser should not be necessary. - The shared
ScanRendereralready provides persistent GPU buffers, render-time decimation and flat/intensity/elevation/distance coloring. The project also has shared palettes. Reuse these facilities where applicable; native per-point RGB support must be checked through the complete import/render path.
Proposed layer controls
Allow multiple independently named, visible/removable layers:
- Point clouds: LAS/LAZ, plus E57 through the existing shared importer.
- Trajectories: start with the existing Step 1
Save trajectory to ASCII (x y z)output. Other existing trajectory formats can be added separately once their coordinate/column conventions are agreed. A cloud file should not be assumed to encode a trajectory. - Drag and drop: accept one or multiple supported cloud/trajectory files dropped onto the 3D view or the Layers window, adding them as display-only layers. Route dropped files through the same validation, load-time downsampling choices and import pipeline as the file dialog, before decoding begins. Handle supported formats per file, report unsupported/failed files clearly, and preserve existing layers if loading is cancelled or fails. Dropping overlays must not start or replace a SLAM run.
- Load-time downsampling: a spatial spacing or retained-point budget selected before loading, reducing the retained display data without modifying the source file. Re-reading with different settings should be explicit. If a loader first decodes the full cloud, make that peak-memory limitation clear.
- Render-time downsampling: an independent density/stride control over already loaded data, adjustable interactively. Label it separately: it reduces drawing work, not necessarily RAM/VRAM allocation.
- Appearance: native RGB when available, a custom uniform color, or coloring by an available scalar. Start with intensity and elevation and reuse the existing palettes; additional scalars/palettes can follow separately. Missing RGB/scalars must have an explicit fallback, not fabricated values.
- Simple intensity shading: retain the familiar intensity-shading option for applicable color modes. Additional effects are outside the first implementation.
- Point size: independent per layer; trajectories may be displayed as connected lines and/or points.
A compact, resizable floating Layers window would contain these controls, with expandable settings for the selected layer. It should collapse to its title bar, close and reopen with Ctrl+L, and also be accessible from the View menu. Closing the window should preserve the loaded layers and their visibility. Register the shortcut in Controls / Help and avoid triggering it during text entry.
For larger clouds, show source/retained/drawn point counts and keep loading responsive, with progress and a way to cancel. Preserve RGB/scalar associations through sampling. Avoid rebuilding or uploading unchanged geometry on every frame; use the project's raylib/rlgl buffer infrastructure.
Coordinate offsets
At import, through either the dialog or drag-and-drop, show a confirmation popup with the proposed X/Y/Z offset before applying it. For large coordinates, automatically suggest the bounding-box center, so subtracting that offset places the box center at (0, 0, 0). Show the convention explicitly: display_position = source_position - offset. Allow editing the proposed values, choosing zero to retain the original placement, confirming, or cancelling the import without changing existing layers.
The applied offset must also be visible and editable per layer in the floating Layers window. Preserve source coordinates and files; apply the offset in double precision before converting positions to GPU floats. For E57, account for scan poses when calculating the file-level bounds.
For files that should remain aligned, allow reusing a common offset, including for a cloud and its reference trajectory or a batch of dropped files. Centering each file independently can otherwise destroy their relative placement; that choice must be explicit in the confirmation. Offset controls affect only the overlays, not the live SLAM data or exported processing results.
Initial scope assumes compatible coordinate systems; automatic registration/reprojection, point editing and trajectory editing are separate work. The processing-head tracking introduced by #611 should continue to work when layers are added.
Suggested delivery and acceptance
Start with LAS/LAZ cloud layers and the existing XYZ trajectory output, the Layers window, visibility, the two density controls, confirmed automatic/manual offsets, point size, uniform color and current intensity shading. Add native RGB/scalar-palette controls and Step 1 E57 integration as focused follow-ups, reusing the existing components. Full out-of-core viewing, advanced effects and persistence across restarts need not be part of this first contribution.
Acceptance should cover loading multiple overlays through both the file dialog and drag-and-drop before/during/after processing, retaining camera responsiveness, independent styling and visibility, clean resource release on removal, and unchanged processing results with overlays enabled versus disabled. Include automatic/manual/zero offsets, cancellation of the offset popup, large-coordinate precision and alignment of related files using a shared offset, as well as missing-attribute and failed-import cases. Verify the affected Windows/macOS/Ubuntu builds.
Is this separation between processing references and display-only layers appropriate? Feedback on the initial scope, supported trajectory formats and reuse of the shared renderer/importers would help establish an agreed implementation direction before a PR.
Activity