Skip to content
New issue

Have a question about this project? # for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “#”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? # to your account

graphslam-engine: Integrate with 3rd party optimization Libraries #317

Closed
bergercookie opened this issue Aug 23, 2016 · 11 comments
Closed

Comments

@bergercookie
Copy link
Contributor

bergercookie commented Aug 23, 2016

Goal: Add support for optional usage of other optimization modules. The following optimization modules are suggested:

@jlblancoc
Copy link
Member

Good! Just recall that any code fragment making use of an optional lib must be properly guarded with #ifdef's to ensure compilation without it.
I'm sure you knew it, but I need to insist ;-)

@jlblancoc jlblancoc added this to the GraphSLAM engine improvements milestone Aug 23, 2016
@jbriales
Copy link
Contributor

Hi guys, I was currently looking into the possible addition of a new optimization procedure in the context of graphslam. Since you have been working with the related classes more recently than me, do you have any quick insight in which would be the best approach to wrap e.g. g2o? Just some simple hints to take as a reference for exploring the code would be most useful! :)

@bergercookie
Copy link
Contributor Author

Hi @jbriales,

Happy to know you are interested in helping on this. I am not familiar to how g2o works or optimizes the graph, however I can make a quick overview on what needs to be implemented for a functional GraphSLAM Optimizer class to be used as part of the mrpt-graphslam library (or any corresponding application).

The main class executing graphSLAM is the CGraphSlamEngine which in turn delegates graph-related tasks to 3 other classes most notably:

  • a NodeRegistrationDecider class
  • a EdgeRegistrationDecidder class
  • a GraphSLAM Optimizing class/framework.

Each one of theses classes must abide to its corresponding interface all of which are described here. So during the execution of graphSLAM CGraphSlamEngine code calls the interface classes which in turn come down to implementation calls to the corresponding decider or graphSLAM optimizer class that has been selected by the user.

Currently only one optimization framework is availeble CLevMarqGSO which is another wrapper around the graphslam::optimize_spa_levmarq method.

So to wrap it up, you'd have to implement the CGraphSlamOptimizer interface with wrappers around the optimization methods of g2o and/or conversion methods for passing the data (graph nodes/edges, perhaps a graph object itself) from MRPT CNetworkOfPoses form to its g2o counterpart.

P.S. I am still tinkering with the library from my fork since I am implementing a multi-robot graphSLAM algorithm so in case you spot a bug or try to modify any existing code there, check that fork in case I have already made any modification. It might even make sense to fork that branch instead (graphslam-devel2) just so that we minimize the git conflicts that would arise when we try and merge it.

Let me know if you need further assistance on this.
Cheers,
Nikos

@jbriales
Copy link
Contributor

Thanks for the detailed answer @bergercookie, this is just what I needed to get on track :)
I do not expect to get into this anytime soon yet, but I'm preparing a GSOC project in this direction. So it will be good to keep these notes for future reference.

Best,
Jesus

@jlblancoc
Copy link
Member

jlblancoc commented Feb 21, 2017 via email

@jbriales
Copy link
Contributor

Good to hear it though @jlblancoc :)
When you say automatically, it means really automatic? I didn't know about the ExternalProject tool, but it seems really powerful :)

@jlblancoc
Copy link
Member

jlblancoc commented Feb 21, 2017 via email

@jolting
Copy link
Member

jolting commented Feb 21, 2017

Awesome.

Just a thought...what about manifest file similar to a gemlock in the Ruby which pins dependency versions, but in this case saving the git hash for the version that we should build against. Reproducing builds might be tricky if we always fetch master branch from some 3rd party repo.

Also it would be useful to by default use the system package first and fail over to ExternalProject. They already packages up libg2o for ros-kinetic and it would be nice to pick that up automatically when building against ROS.

@jlblancoc
Copy link
Member

jlblancoc commented Feb 21, 2017 via email

@jolting
Copy link
Member

jolting commented Feb 22, 2017

Agreed, for now we should just remember to pin a the version on a release.
ExternalProject_Add has a field for GIT_TAG which can be a git hash.

Basically, if .external.cmake file does not exist then fetch master of each project and record git hashes in .external.cmake by executing the git command in each directory[1]. If .external.cmake exists use git hashes from .external.cmake by including this file. Periodically regenerating .external.cmake should be trivial.

  1. http://xit0.org/2013/04/cmake-use-git-branch-and-commit-details-in-project/

@jlblancoc jlblancoc removed this from the GraphSLAM engine improvements milestone Aug 20, 2017
@jlblancoc
Copy link
Member

I'm afraid this one is outdated by now... :-(
Closing it...

(Done in other external packages/projects outside of mrpt)

# for free to join this conversation on GitHub. Already have an account? # to comment
Projects
None yet
Development

No branches or pull requests

4 participants