Skip to content

Trajectory viewer: load the exact .mjs, not the whole session folder - #575

Merged
michalpelka merged 2 commits into
mainfrom
mp/trajectory-viewer-exact-mjs
Oct 22, 2026
Merged

michalpelka merged 2 commits into
mainfrom
mp/trajectory-viewer-exact-mjs

Conversation

@michalpelka

Copy link
Copy Markdown
Contributor

Problem

The trajectory viewer kept only the directory of the .mjs it was given, then picked files from that folder by fixed names and patterns: session_poses.mrp / session_ini_poses.mri, every scan_lio_*.laz and every trajectory_lio_*.csv. When a folder held two sessions, it loaded the wrong poses and/or mixed their chunks.

Fix

  • The manifest decides what loads:
    • Poses come from poses_file_name; if that is missing or empty, from initial_poses_file_name.
    • Chunks come from laz_file_names, in manifest order.
    • Each chunk's trajectory is the trajectory_lio_N.csv next to its laz.
  • A stored path that no longer exists falls back to the same file name next to the .mjs, the same rule Session::load uses.
  • loadSession, loadCloud and the ROS export input all use this one helper.
  • --mjs, dropping a .mjs on the window, and the panel field (now "Session (.mjs)") keep the exact file. Ctrl+O is now a .mjs file picker instead of a folder picker.
  • A directory is still accepted. It resolves to its session.mjs, or to its only .mjs; if there are several and none is session.mjs, the viewer shows an error. After loading, the field shows which .mjs was used.

Testing

  • Builds cleanly (macOS, release).
  • Not yet run in the GUI on a folder with two sessions.

🤖 Generated with Claude Code

michalpelka and others added 2 commits October 22, 2026 12:06
The viewer kept only the .mjs's directory and then globbed
session_poses.mrp, scan_lio_*.laz and trajectory_lio_*.csv from it, so a
folder holding two sessions loaded the wrong poses and mixed chunks.

Poses now come from the manifest's poses_file_name (falling back to
initial_poses_file_name) and chunks from its laz_file_names, with the
same missing-path relocation as Session::load. --mjs, drag & drop and
Ctrl+O (now a .mjs picker) keep the exact file; a directory still
resolves to its session.mjs, or its only .mjs.

Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
Co-Authored-By: Claude Opus 5.5 <noreply@anthropic.com>
@michalpelka
michalpelka merged commit b0e51d3 into main Oct 22, 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.

1 participant