glim icon indicating copy to clipboard operation
glim copied to clipboard

How to Build a Second Map in the Same Global Frame as a Previously Built Map?

Open mahmood-ul-hasan opened this issue 7 months ago • 2 comments

Hi, thank you for your excellent work on GLIM!

I’m currently exploring how to build indoor maps using GLIM from LiDAR and IMU data.


🧩 What I Want to Do

  1. I use GLIM to build an initial map of an indoor environment (let’s call it Map_A).
  2. After some time, I scan the environment again, starting from a point that lies inside the previously mapped area.
  3. I want to build a second map (Map_B) such that it uses the same global coordinate system as Map_A.

In other words, I want to anchor the second session to the first one right from the start, instead of starting from a new coordinate frame.


🔎 What I've Tried

I looked into [GLIM's offline merge feature](https://koide3.github.io/glim/merge.html), but:

  • It is offline, while I need a real-time or online method.
  • The merge results are not ideal in my case, because many indoor structures look very similar across different areas. This causes confusion and poor alignment when attempting to merge maps after the fact.

❓ Questions

  • Does GLIM support any kind of localization-only mode, where I can load an existing map and localize new LiDAR-IMU data against it?
  • Alternatively, is it possible to manually initialize the second session with a starting pose in the global frame of the previous map?
  • Can I reuse previously saved pose graph, features, or map state to assist in keeping coordinate alignment across sessions?
  • If none of this is directly supported, would you suggest an external solution like ICP, NDT, or TEASER++ for registration between sessions? Or is there a better strategy specific to GLIM?

💡 Why This Matters

  • I want to maintain a consistent global coordinate system across mapping sessions.
  • This is not about loop closure or SLAM drift correction, but about ensuring that each new session can directly continue or localize within the context of a previously mapped environment.

Any advice or recommendations would be greatly appreciated. Thanks again for your amazing work and for sharing GLIM with the community!

mahmood-ul-hasan avatar Jul 09 '25 13:07 mahmood-ul-hasan

Does GLIM support any kind of localization-only mode, where I can load an existing map and localize new LiDAR-IMU data against it?

GLIM itself doesn't provide localization-only estimation. While I have a package for this purpose, it is in a private repository, unfortunately.

Alternatively, is it possible to manually initialize the second session with a starting pose in the global frame of the previous map?

Yes, you can provide an initial IMU pose by setting "initialization_mode" to "NAIVE" and providing "init_T_world_imu" describing the initial IMU pose in "config_odometry_gpu.json".

https://github.com/koide3/glim/blob/c764baa8b136cf4c8e57ce9a3651f6bd05873211/src/glim/odometry/odometry_estimation_imu.cpp#L52

Can I reuse previously saved pose graph, features, or map state to assist in keeping coordinate alignment across sessions?

No, we only provide map merging and alignment functions only in the offline viewer. Resuming the mapping session is not supported.

If none of this is directly supported, would you suggest an external solution like ICP, NDT, or TEASER++ for registration between sessions? Or is there a better strategy specific to GLIM?

I think performing TEASER++ and feeding the estimate pose to GLIM as an initial pose would be a good solution.

koide3 avatar Jul 16 '25 07:07 koide3

Thanks so much for your explanation.

mahmood-ul-hasan avatar Jul 20 '25 11:07 mahmood-ul-hasan