Skip to content

Commit

Permalink
fixing python bindings for FGraphDiff
Browse files Browse the repository at this point in the history
  • Loading branch information
nosmokingsurfer committed May 29, 2024
1 parent 08e6d91 commit 4c00262
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 8 deletions.
5 changes: 3 additions & 2 deletions python_examples/FGraphDiff_2d.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,8 @@
graph.add_factor_1pose_2d(np.array([0,0,np.pi/4]),n1,1e6*invCov)
graph.add_factor_2poses_2d(np.ones(3),n1,n2,invCov)

graph.solve(mrob.LM)
graph.print(True)
for i in range(10):
graph.solve(mrob.FGraphDiff_GN)
graph.print(True)


12 changes: 6 additions & 6 deletions src/pybind/FGraphDiffPy.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -96,12 +96,12 @@ class FGraphDiffPy : public FGraphDiffSolve

void init_FGraphDiff(py::module &m)
{
// py::enum_<FGraphDiffSolve::optimMethod>(m, "FGraphDiff.optimMethod")
// .value("GN", FGraphDiffSolve::optimMethod::GN)
// .value("LM", FGraphDiffSolve::optimMethod::LM)
// .value("LM_ELLIPS", FGraphDiffSolve::optimMethod::LM_ELLIPS)
// .export_values()
// ;
py::enum_<FGraphDiffSolve::optimMethod>(m, "FGraphDiff.optimMethod")
.value("FGraphDiff_GN", FGraphDiffSolve::optimMethod::GN)
.value("FGraphDiff_LM", FGraphDiffSolve::optimMethod::LM)
.value("FGraphDiff_LM_ELLIPS", FGraphDiffSolve::optimMethod::LM_ELLIPS)
.export_values()
;
// py::enum_<DiffFactor::robustFactorType>(m, "FGraphDiff.robustFactorType")
// .value("QUADRATIC", DiffFactor::robustFactorType::QUADRATIC)
// .value("CAUCHY", DiffFactor::robustFactorType::CAUCHY)
Expand Down

0 comments on commit 4c00262

Please sign in to comment.