Skip to content

Remove step 1 cache after saving the session in command-line mode - #566

Merged
JanuszBedkowski merged 1 commit into
MapsHD:mainfrom
michalpelka:mp/fix-489-clean-cache
Oct 9, 2026
Merged

JanuszBedkowski merged 1 commit into
MapsHD:mainfrom
michalpelka:mp/fix-489-clean-cache

Conversation

@michalpelka

Copy link
Copy Markdown
Contributor

Fixes #489

Problem

The step 1 cache directory (<working_directory>/cache) was only removed by the GUI's on_exit (window close). The headless modes of lidar_odometry_step_1 — <input_folder> and <input_folder> <params.toml> <output_folder> — never removed it, leaving all cached chunk points on disk after every run.

Change

  • New remove_cache(params) helper in lidar_odometry.cpp (skips an empty path, reports a failure via std::error_code instead of throwing).
  • Called after the session is saved in both command-line branches of lidar_odometry_gui.cpp.
  • on_exit in lidar_odometry_gui.cpp and the precision_forestry app now uses the same helper.

In GUI mode the cache is still removed on window close, not right after the auto-save: "Save result", "Point cloud consistency…" and "Save all point clouds to single las/laz" still read the cache files after that point.

Testing

  • lidar_odometry_step_1 and drag_folder_with_mandeye_data_and_drop_here-precision_forestry build (macOS, release).
  • Not yet run on real data.

🤖 Generated with Claude Code

The cache directory was only removed by the GUI's on_exit, so headless
runs (<input_folder> and <input_folder> <params> <output_folder>) left
all cached chunk points on disk. Extract remove_cache() and call it
after the session is saved; on_exit uses the same helper.

Fixes MapsHD#489

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@JanuszBedkowski
JanuszBedkowski merged commit 6f7622b into MapsHD:main Oct 9, 2026
7 checks passed
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.

Clean cache after successfully executed step 1

2 participants