Compatibility between LevenbergMarquadt and triangulation

Issue #386 resolved
Csautier created an issue

When you try to do a LevenbergMarquadt optimization, if the method "TriangulatePoint3" is somewhere in the code, the optimization will not do anything. This happen as long as the TriangulatePoint3 is compiled, even if it is never actually used. In the attached file, I create a very simple graph, having only one pose, and a prior. Then in an unused function, I add a TriangulatePoint3. If you comment the TriangulatePoint3 line it will give expected results, but if not, the LevenbergMarquadt won't optimize anything.

I tried this with different clang and gcc, with the same results A way to solve this at least partially, is by adding -o3 to the makefile

Comments (6)

  1. Csautier reporter

    I don't know, my first thought was that a static variable in TriangulatePoint3 was interfering with the Levenberg Marquadt Optimizer implementation, but I don't understand why enabling the compiler optimization (-O3) would prevent that. This bug does not seem to happen with the Dogleg Optimizer

  2. Frank Dellaert

    Sorry, on my mac it does not repro, with Debug. Could you do me a favor and: 1) pull the latest version of develop and try again? You will need to use Point2Vector after PR #313 2) if still does not work, tell me what platform you're on, including OS version, and print out the cmake output with all the flags.

  3. Csautier reporter

    The use of Point2Vector solved the issue, I guess the problem is not relevant anymore since PR 313. Thank you

  4. Frank Dellaert

    Not entirely convinced whether it was Point2Vector or something else in latest develop, but great :-)

  5. Log in to comment