diff --git a/CMakeLists.txt b/CMakeLists.txt index dea914f147b2a7ffcb4831dd05d15c7d91107859..75d015f9de17913bc4134e23bbf5770cd04b28c6 100644 --- a/CMakeLists.txt +++ b/CMakeLists.txt @@ -195,8 +195,6 @@ ENDIF (SPDLOG_INCLUDE_DIR) INCLUDE_DIRECTORIES(${EIGEN_INCLUDE_DIRS}) include_directories("include") -include_directories(.) -# include_directories("templinks") IF(Ceres_FOUND) INCLUDE_DIRECTORIES(${CERES_INCLUDE_DIRS}) ENDIF(Ceres_FOUND) @@ -455,14 +453,14 @@ IF (Ceres_FOUND) include/core/ceres_wrapper/ceres_manager.h include/core/ceres_wrapper/cost_function_wrapper.h include/core/ceres_wrapper/create_numeric_diff_cost_function.h - include/core/ceres_wrapper/local_parametrization_wrapper.h + include/core/ceres_wrapper/local_parametrization_wrapper.h include/core/solver/solver_manager.h include/core/solver_suitesparse/sparse_utils.h ) SET(SRCS_WRAPPER #ceres_wrapper/qr_manager.cpp src/ceres_wrapper/ceres_manager.cpp - src/ceres_wrapper/local_parametrization_wrapper.cpp + src/ceres_wrapper/local_parametrization_wrapper.cpp src/solver/solver_manager.cpp ) ELSE(Ceres_FOUND) @@ -493,15 +491,15 @@ IF(YAMLCPP_FOUND) src/yaml/sensor_odom_3D_yaml.cpp ) ENDIF(YAMLCPP_FOUND) - + # create the shared library -ADD_LIBRARY(${PROJECT_NAME} - SHARED +ADD_LIBRARY(${PROJECT_NAME} + SHARED ${SRCS} - ${SRCS_BASE} + ${SRCS_BASE} ${SRCS_CAPTURE} ${SRCS_COMMON} - ${SRCS_DTASSC} + ${SRCS_DTASSC} ${SRCS_FACTOR} ${SRCS_FEATURE} ${SRCS_FRAME} diff --git a/src/capture/capture_base.cpp b/src/capture/capture_base.cpp index fef9c2ae958e13f8d21d06038694892ad9123b53..78904aa8baac91d47d2300454b8a77b2f1160001 100644 --- a/src/capture/capture_base.cpp +++ b/src/capture/capture_base.cpp @@ -109,9 +109,9 @@ void CaptureBase::addFeatureList(FeatureBasePtrList& _new_ft_list) feature_ptr->setCapture(shared_from_this()); if (getProblem() != nullptr) feature_ptr->setProblem(getProblem()); - feature_list_.push_back(feature_ptr); + // feature_list_.push_back(feature_ptr); } -// feature_list_.splice(feature_list_.end(), _new_ft_list); + feature_list_.splice(feature_list_.end(), _new_ft_list); } void CaptureBase::getFactorList(FactorBasePtrList& _fac_list) diff --git a/src/map/map_base.cpp b/src/map/map_base.cpp index 94041ad51ae003acbf36f9a383af73654240ce2c..204fc7b8ffd3d1b1a8c49030c74c0e803e11b7c4 100644 --- a/src/map/map_base.cpp +++ b/src/map/map_base.cpp @@ -37,14 +37,16 @@ void MapBase::addLandmarkList(LandmarkBasePtrList& _landmark_list) { for (auto lmk : _landmark_list) addLandmark(lmk); -// LandmarkBasePtrList lmk_list_copy = _landmark_list; //since _landmark_list will be empty after addDownNodeList() -// for (LandmarkBasePtr landmark_ptr : lmk_list_copy) -// { -// landmark_ptr->setMapPtr(shared_from_this()); -// landmark_ptr->setProblem(getProblem()); -// landmark_ptr->registerNewStateBlocks(); -// } -// landmark_list_.splice(landmark_list_.end(), _landmark_list); + + //TEMPORARY FIX, should be made compliant with the new emplace methodology + LandmarkBasePtrList lmk_list_copy = _landmark_list; //since _landmark_list will be empty after addDownNodeList() + for (LandmarkBasePtr landmark_ptr : lmk_list_copy) + { + landmark_ptr->setMap(shared_from_this()); + landmark_ptr->setProblem(getProblem()); + landmark_ptr->registerNewStateBlocks(); + } + landmark_list_.splice(landmark_list_.end(), _landmark_list); } void MapBase::load(const std::string& _map_file_dot_yaml) diff --git a/test/gtest_capture_base.cpp b/test/gtest_capture_base.cpp index e52b5497c4ee16ee6de44ddbee8abb6334d2e10b..8bb84231d13a800845d80703025e2c382d187f8b 100644 --- a/test/gtest_capture_base.cpp +++ b/test/gtest_capture_base.cpp @@ -99,7 +99,7 @@ TEST(CaptureBase, addFeatureList) C->addFeatureList((fl)); ASSERT_EQ(C->getFeatureList().size(), (unsigned int) 4); -// ASSERT_EQ(fl.size(), (unsigned int) 0); // features have been moved, not copied // EDIT 02-2019: features have been copied + ASSERT_EQ(fl.size(), (unsigned int) 0); // features have been moved, not copied // EDIT 02-2019: features have been copied ASSERT_EQ(C->getFeatureList().front(), f_first); ASSERT_EQ(C->getFeatureList().back(), f_last); }