Skip to content

Step 1: add independent display-only cloud and trajectory overlays - #615

Closed
dancmari wants to merge 5 commits into
MapsHD:mainfrom
dancmari:HDMapping-legacy
Closed

dancmari wants to merge 5 commits into
MapsHD:mainfrom
dancmari:HDMapping-legacy

Conversation

@dancmari

@dancmari dancmari commented Nov 2, 2026 •

Copy link
Copy Markdown
Contributor

Compare the live Step 1 trajectory against earlier runs and external point clouds without changing the odometry inputs or results. Refs #614.

This draft now covers display-only overlays. Automatic trajectory LAZ export has been separated from this PR. The branch includes the current main (3d3a8054); the net change is limited to four overlay/GUI/CMake files.

Behavior

  • Import LAS/LAZ/E57 clouds and XYZ, header-based CSV, or TUM trajectories through the file dialog or multi-file drag-and-drop. Dropping a raw-data folder preserves the existing processing workflow.
  • A floating, resizable Layers window starts collapsed. Ctrl+L and the View/Progress/Loading controls open it; closing it preserves loaded layers.
  • Each layer has visibility/removal, a name, point size, load-time point budget/spatial sampling, an independent render stride, uniform/native RGB/intensity/elevation coloring, shared palettes, and optional intensity shading. Text trajectories support points and connected lines.
  • Confirm an automatic or manual XYZ offset before adding an import. Related files can reuse one offset; it remains editable per layer. Source coordinates are preserved, and subtraction happens in double precision before GPU conversion. Offsets do not perform registration or reprojection.
  • Imports run in the background. Overlays and camera navigation remain available during raw-data loading/cache preparation.

Integration

OverlayLayers owns the import UI and rendering in its own header/source pair. It reuses core_e57, shared native file dialogs, raylib buffer parts, and the shared GLSL palettes. The existing link interface already supplies E57, so no extra application dependency is introduced.

LAS/text imports stream data to enforce a retained-point budget and support cancellation while preserving source order; the existing session/TUM loaders materialize complete inputs. The small overlay shader supplies native RGB and independent intensity shading across color modes, which the current ScanRenderer does not expose. GPU packing uses Eigen Map/cast. Unchanged geometry stays resident; appearance/camera changes reuse it, and render-stride changes update indices.

Processing, saving, command-line options, and output formats match main. Overlay data never enters the processing bucket maps.

Validation of this revision

  • Windows x64 Release builds: Step 1 GUI and legacy Step 1.
  • CTest: shared, core, and Step 1 suites passed (3/3).
  • Windows GUI/GPU checks: all six import formats, sampled attributes, failures/cancellation, offset confirmation/reuse, window shortcuts, RGB/scalar palettes, stride, visibility, and resource cleanup.
  • Four-chunk recording processed with overlays disabled and enabled: all 6,000 pose matrices were byte-identical. Both runs completed 300 workers and published 301 processing-head updates. Camera navigation and persistent overlay buffers were also checked during cache preparation.
  • Repository clang-format check passed with 21.1.8.
  • Updated Linux/macOS/Python CI checks are pending.

Limits and placement

E57 uses the existing full-file decoder before sampling, so its peak RAM is not bounded by the retained-point budget and cancellation waits for decoding. Render stride does not release retained geometry. Layer settings are not persisted across restarts.

The PR remains a draft for agreement on Step 1 placement in light of the maintainer discussion about a future HDMAPPING-SLAM application.

Add cloud and trajectory layers with asynchronous import, confirmed coordinate offsets and persistent raylib buffers. Expose controls through a collapsed Layers panel and Ctrl+L, and keep overlays and navigation active during cache preparation.
Write trajectory_step1.laz alongside saved results with twelve named Extra Bytes for indices, clocks, optimized orientation, distance and derived speed. Include all stored poses, declare missing values as NaN and report failures through the export result.
@dancmari

dancmari commented Nov 2, 2026

Copy link
Copy Markdown
Contributor Author

I have attempted to build the foundation for working with the imported point clouds. I followed a similar approach for the automatic export of the trajectory. Aspects related to ergonomics, as well as the implementation of additional features, can be addressed in future iterations—potentially following some specific proposals.

@dancmari
dancmari marked this pull request as ready for review November 3, 2026 05:10
@dancmari

dancmari commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

“Reference point clouds for initial alignment” and “Overlay / Layers” currently use separate loading mechanisms. Reference clouds feed the NDT alignment process, while overlay clouds are used only for visualization. A cloud loaded as an overlay therefore needs to be loaded separately as a reference to align the initial points to it.

In the future, we could connect these workflows by allowing an existing overlay cloud to be selected as the alignment reference, avoiding the need to load the same file twice.

@dancmari

dancmari commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

The primary purpose of this PR is to compare trajectories visually while a new trajectory is being computed. Users can overlay trajectories generated with different parameter settings to understand where the results diverge and how those differences develop. The live trajectory visualization introduced in PR #611 supports this comparison.

Point clouds representing real surfaces can also be added as spatial references, helping users assess the trajectories against the surrounding geometry.

@michalpelka michalpelka left a comment •

Copy link
Copy Markdown
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I do not understand why it should be in step1 . Step 1 is simple LIO.
Next tools should be used for analysis and export.
In step2 you can register to TUM trajcetory. I really see no need for this feature.
We have whole suite for benchmarking here https://mapshd.github.io/benchmark_results/#bunker-dvi-reg-1.
It should not be done in step1 GUI.

@dancmari

dancmari commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

First of all, why should I have to wait until step 2 to verify a trajectory, when it is actually generated during step 1? Currently, in step 2, I can only load a session to view or save a trajectory.
The SLAM process is highly sensitive to parameter changes, which means we can expect various types of drift to accumulate. Such drift becomes less significant in step 2, where the focus shifts toward loop closure and point cloud registration.
In step 1, we have multiple sets of parameters and solvers. If I encounter difficulty in obtaining a realistic result, how—given the current setup—can one determine where the issue originates, or how it compares to previous attempts?
My goal has been to leverage the existing capabilities within step 1—utilizing implementations specifically designed for this purpose—without compromising the underlying processes (in fact, I have secured them and allocated additional resources). The alternative processing methods are not of my design.
If you are not currently comparing trajectories from step 1 to improve the results in step 2, then it suggests we have different approaches to data processing. In my view, relying solely on "edges" does not solve everything.

@dancmari

dancmari commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

Secondly, I don’t believe that the tools in step 2 are equivalent; its purpose is different.
Step 1 is not just simple LIO (Lidar-Inertial Odometry); it is the only stage where you can understand why there is higher noise, why and when certain solvers fail, and what alternatives are available. In step 2, you can only patch up what didn’t work in step 1—ultimately, even loop closure is just a patch.

@dancmari

dancmari commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

From my point of view, once the instances of non-closure fall predominantly below 0.5%, step 2 will become uninteresting, given that it only addresses a single session. An intelligent PGS, followed by an export of the registered point cloud.

@dancmari

dancmari commented Nov 3, 2026 •

Copy link
Copy Markdown
Contributor Author

Regarding the benchmark, it shouldn't be viewed as a crystal ball that reveals exactly what needs to be done; rather, it is a fair assessment of your proposal. It doesn't specify the conditions under which the deviation (error) tends to accumulate the most. In this sense, a result could be substantially improved by adjusting just a single parameter—meaning you might actually be close to success, even when the results suggest otherwise. The solution lies in details other than RPE.
I actually don't use the sets of parameters with which I obtain the best APE and RPE results.

@dancmari

dancmari commented Nov 3, 2026

Copy link
Copy Markdown
Contributor Author

I remain open to suggestions. Beyond the points already mentioned, there are other reasons why I understand your concern regarding the inclusion of this functionality in Step 1; however, it is not yet clear to me what specific changes you would like me to make. The intended use case is to compare previous trajectories with the currently calculated trajectory, allowing users to evaluate parameter choices during processing. Would a more limited approach within Step 1 be acceptable, or are you requesting that the overlay functionality be moved entirely to a different tool?

@dancmari
dancmari marked this pull request as draft November 3, 2026 17:46
@JanuszBedkowski

Copy link
Copy Markdown
Member

Hi

It is great opportunity to introduce HDMAPPING-SLAM

@dancmari can You move all Your effort to HDMAPPING-SLAM tool.

Please start working on it.

@michalpelka can You help us with clearing step1? By removing functionalities that will go to HDMAPPING-SLAM tool.

HDMAPPING-SLAM = step_1 + step_2 + step_3

@JanuszBedkowski

Copy link
Copy Markdown
Member

Comparing trajectories is one in step3

So, please prepare
HDMAPPING-SLAM = step_1 + step_2 + step_3

@dancmari

dancmari commented Nov 4, 2026

Copy link
Copy Markdown
Contributor Author

Regarding the benchmark, it shouldn't be viewed as a crystal ball that reveals exactly what needs to be done; rather, it is a fair assessment of your proposal. It doesn't specify the conditions under which the deviation (error) tends to accumulate the most. In this sense, a result could be substantially improved by adjusting just a single parameter—meaning you might actually be close to success, even when the results suggest otherwise. The solution lies in details other than RPE. I actually don't use the sets of parameters with which I obtain the best APE and RPE results.

MapsHD/benchmark-HDMapping-Orchestration#41

@dancmari

Copy link
Copy Markdown
Contributor Author

One of the ideas guiding me is to make Step 1 visually engaging—to let users see and understand the process as it unfolds. There is also a quiet CLI version at the other end of the spectrum, which has not yet received much attention

@dancmari dancmari changed the title Step 1: add display-only overlays and automatic trajectory LAZ export Step 1: add independent display-only cloud and trajectory overlays Nov 14, 2026
@dancmari
dancmari marked this pull request as ready for review November 14, 2026 10:34
@JanuszBedkowski

Copy link
Copy Markdown
Member

please design seprate tool for this PR. Do not affect existing workflow. Step 1 - single trajectory, Step 2 - single trajectory, step 3 - multiple trajectory

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.

3 participants