mirror of
https://github.com/introlab/rtabmap_ros.git
synced 2026-10-03 16:27:46 +08:00
Fixed #149
This commit is contained in:
@@ -18,8 +18,7 @@ FIND_PATH(G2O_INCLUDE_DIR g2o/core/base_vertex.h
|
|||||||
PATHS "C:\\Program Files\\g2o\\include")
|
PATHS "C:\\Program Files\\g2o\\include")
|
||||||
|
|
||||||
# Macro to unify finding both the debug and release versions of the
|
# Macro to unify finding both the debug and release versions of the
|
||||||
# libraries; this is adapted from the OpenSceneGraph FIND_LIBRARY
|
# libraries; this is adapted from the rtabmap config
|
||||||
# macro.
|
|
||||||
|
|
||||||
MACRO(FIND_G2O_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
MACRO(FIND_G2O_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
||||||
|
|
||||||
@@ -31,11 +30,14 @@ MACRO(FIND_G2O_LIBRARY MYLIBRARY MYLIBRARYNAME)
|
|||||||
NAMES "g2o_${MYLIBRARYNAME}"
|
NAMES "g2o_${MYLIBRARYNAME}"
|
||||||
PATHS "C:\\Program Files\\g2o\\lib")
|
PATHS "C:\\Program Files\\g2o\\lib")
|
||||||
|
|
||||||
IF(NOT ${MYLIBRARY}_DEBUG)
|
IF(${MYLIBRARY}_DEBUG AND ${MYLIBRARY})
|
||||||
IF(MYLIBRARY)
|
SET(${MYLIBRARY}
|
||||||
SET(${MYLIBRARY}_DEBUG ${MYLIBRARY})
|
debug ${${MYLIBRARY}_DEBUG}
|
||||||
ENDIF(MYLIBRARY)
|
optimized ${${MYLIBRARY}}
|
||||||
ENDIF( NOT ${MYLIBRARY}_DEBUG)
|
)
|
||||||
|
ELSEIF(${MYLIBRARY}_DEBUG)
|
||||||
|
SET(${MYLIBRARY} ${${MYLIBRARY}_DEBUG})
|
||||||
|
ENDIF()
|
||||||
|
|
||||||
ENDMACRO(FIND_G2O_LIBRARY LIBRARY LIBRARYNAME)
|
ENDMACRO(FIND_G2O_LIBRARY LIBRARY LIBRARYNAME)
|
||||||
|
|
||||||
|
|||||||
@@ -523,10 +523,6 @@ std::map<int, Transform> OptimizerG2O::optimize(
|
|||||||
}
|
}
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
optimizer.clear();
|
|
||||||
g2o::Factory::destroy();
|
|
||||||
g2o::OptimizationAlgorithmFactory::destroy();
|
|
||||||
g2o::HyperGraphActionLibrary::destroy();
|
|
||||||
}
|
}
|
||||||
else if(poses.size() == 1 || iterations() <= 0)
|
else if(poses.size() == 1 || iterations() <= 0)
|
||||||
{
|
{
|
||||||
|
|||||||
@@ -19,9 +19,10 @@ using namespace Eigen;
|
|||||||
EdgeSE2Switchable::EdgeSE2Switchable() : g2o::BaseMultiEdge<3, g2o::SE2>()
|
EdgeSE2Switchable::EdgeSE2Switchable() : g2o::BaseMultiEdge<3, g2o::SE2>()
|
||||||
{
|
{
|
||||||
resize(3);
|
resize(3);
|
||||||
_jacobianOplus[0].resize(3,3);
|
_jacobianOplus.clear();
|
||||||
_jacobianOplus[1].resize(3,3);
|
_jacobianOplus.push_back(JacobianType(0, 3, 3));
|
||||||
_jacobianOplus[2].resize(3,1);
|
_jacobianOplus.push_back(JacobianType(0, 3, 3));
|
||||||
|
_jacobianOplus.push_back(JacobianType(0, 3, 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|||||||
@@ -22,9 +22,10 @@ using namespace Eigen;
|
|||||||
EdgeSE3Switchable::EdgeSE3Switchable() : g2o::BaseMultiEdge<6, Eigen::Isometry3d>()
|
EdgeSE3Switchable::EdgeSE3Switchable() : g2o::BaseMultiEdge<6, Eigen::Isometry3d>()
|
||||||
{
|
{
|
||||||
resize(3);
|
resize(3);
|
||||||
_jacobianOplus[0].resize(6,6);
|
_jacobianOplus.clear();
|
||||||
_jacobianOplus[1].resize(6,6);
|
_jacobianOplus.push_back(JacobianType(0, 6, 6));
|
||||||
_jacobianOplus[2].resize(6,1);
|
_jacobianOplus.push_back(JacobianType(0, 6, 6));
|
||||||
|
_jacobianOplus.push_back(JacobianType(0, 6, 1));
|
||||||
|
|
||||||
}
|
}
|
||||||
// ================================================
|
// ================================================
|
||||||
|
|||||||
Reference in New Issue
Block a user