SteveMacenski / slam_toolbox

Slam Toolbox for lifelong mapping and localization in potentially massive maps with ROS
GNU Lesser General Public License v2.1
1.68k stars 528 forks source link

Information-theoretic lifelong mapping #407

Open hidmic opened 3 years ago

hidmic commented 3 years ago

Feature description

As an alternative to SLAM Toolbox's lifelong mapping support (still experimental, as #101 suggests), implement:

H. Kretzschmar, C. Stachniss and G. Grisetti, "Efficient information-theoretic graph pruning for graph-based SLAM with laser range finders," 2011 IEEE/RSJ International Conference on Intelligent Robots and Systems, San Francisco, CA, USA, 2011, pp. 865-871, DOI: 10.1109/IROS.2011.6094414.

which, in practice, implies:

  1. Scoring nodes (i.e. laser scans) based on an estimate of their contribution to the reduction in the overall uncertainty of the resulting occupancy grid.
  2. Finding nodes in excess to a configurable graph size that score the lowest in uncertainty reduction (i.e. information gain).
  3. Marginalizing nodes using a Chow-Liu tree approximation to keep the sparse structure of the graph.

(1.) can coexist with the current geometrical score, and (2.) is one possible answer to: https://github.com/SteveMacenski/slam_toolbox/blob/6fce7fa0cf64a21720e4a3a76c68fcb7f27604c1/slam_toolbox/src/experimental/slam_toolbox_lifelong.cpp#L307

If published results hold ground, it may be an interesting step towards enabling lifelong mapping in production.

Implementation considerations

One possible path forward would be:

However, note that node marginalization can be done in parallel and leveraged immediately by the current lifelong mapping support. I also wonder whether having a two-stage pipeline with coarse and fine grid resolutions would help speed. But I haven't thought it through yet.

hidmic commented 3 years ago

An efficient implementation of this wonderful piece of research may be an interesting addition and a solution to past issue reports (such as https://github.com/SteveMacenski/slam_toolbox/issues/309).

Would you be willing to accept such a contribution @SteveMacenski?

SteveMacenski commented 3 years ago

I'd also make sure you consider the program of losing "key" frames. There are sometimes in SLAM sessions "key" nodes that regardless of the information it supplies, is the "backbone" of a loop closure or important tie-in that removing will substantially decompose the map. I've seen that happen in practice and one of the main reasons I didn't continue working on the problem (definitely solvable, just didn't have the time at that point). I can't tell you all the situations of how a "key" node forms, but certainly any node pair that solves a loop closure shouldn't be decayed, but some checking on entropy might reveal that implicitly.

That plan seems reasonable to me and I'd be open to a PR that were to replace the existing lifelong mapping mode for this one if it is able to function better to be "really" used vs a tech demo like mine! I'd thrown that out as an experimental demo hoping it would spark someone's creativity / interest to use the toolset I've provided to do better!

hidmic commented 3 years ago

There are sometimes in SLAM sessions "key" nodes that regardless of the information it supplies, is the "backbone" of a loop closure or important tie-in that removing will substantially decompose the map.

Yeah, intuitively I can see that too. I'd expect the information gain of such nodes to be high as a result, but we won't know for a fact until it is implemented.

That plan seems reasonable to me and I'd be open to a PR that were to replace the existing lifelong mapping mode for this one if it is able to function better to be "really" used vs a tech demo like mine!

Right. I personally foresee both approaches coexisting, for some time at least. No matter how much we work in a comprehensive enough demonstration of the system capabilities, it is no substitute for all the real world experience that fellow ROS users can bring. Time will tell if either approach should be dropped entirely. Having said that, I do believe this paper has potential.

I'd thrown that out as an experimental demo hoping it would spark someone's creativity / interest to use the toolset I've provided to do better!

And it worked? :smiley: