Skip to content

5. 🔀 Multi‐Session Mapping

Yuhao Zhang edited this page Jul 7, 2026 · 1 revision

ScaRF-SLAM supports multi-session mapping by reusing the pose graph and saved reconstruction graph from an earlier session. The second SLAM session can load the first session's OV-SLAM pose graph so cross-session loop closures can refine the trajectory. The second mapping run can then load the first session's saved ScaRF-SLAM optimization graph so both sessions are optimized and fused in a shared map.

Each completed mapping session writes a graph artifact under:

$SESSION_FOLDER/recon/<trajectory>/opt_graph_<suffix>

Pass this directory to --prev_slam_folder when extending a map. You can also pass the previous session folder itself if it contains exactly one recon/*/opt_graph*/manifest.json; if multiple graph artifacts exist, pass the exact graph directory.

⚠️ The current implementation assumes that all timestamps in the previous session are earlier than the first timestamp in the new session.

Run Session 1 SLAM

Terminal 1:

ros2 launch launch/run_ov_slam.launch.py \
  output_path:=$SESSION_ONE_FOLDER

Terminal 2:

ros2 bag play $SESSION_ONE_DATA_BAG --clock --rate 0.5

Run Session 1 Mapping

python3 run_mapping.py \
  --slam_folder $SESSION_ONE_FOLDER \
  --input_bag $SESSION_ONE_FOLDER/ov_slam/ov_slam_bag \
  --config config/scarf_slam/ori_insta_slam.yaml

Run Session 2 SLAM

Load the first session's OV-SLAM pose graph when starting the second session:

ros2 launch launch/run_ov_slam.launch.py \
  output_path:=$SESSION_TWO_FOLDER \
  pose_graph_load_path:=$SESSION_ONE_FOLDER/ov_slam/pose_graph

Then play the second session data bag:

ros2 bag play $SESSION_TWO_DATA_BAG --clock --rate 0.5

Run Session 2 Mapping

Load the first session's ScaRF-SLAM graph when running mapping for the second session:

python3 run_mapping.py \
  --slam_folder $SESSION_TWO_FOLDER \
  --input_bag $SESSION_TWO_FOLDER/ov_slam/ov_slam_bag \
  --prev_slam_folder $SESSION_ONE_FOLDER/recon/ov_slam/opt_graph_<suffix> \
  --config config/scarf_slam/ori_insta_slam.yaml

Quick Start Example

You can use ORI R01 as the first session and ORI R02 as the second session for a compact multi-session mapping check.

Clone this wiki locally