Merge branch 'develop'
commit
08a54ee470
|
@ -25,8 +25,11 @@ if(NOT GTSAM_USE_SYSTEM_EIGEN)
|
||||||
FILES_MATCHING PATTERN "*.h")
|
FILES_MATCHING PATTERN "*.h")
|
||||||
endif()
|
endif()
|
||||||
|
|
||||||
|
option(GTSAM_BUILD_METIS "Build metis library" ON)
|
||||||
option(GTSAM_BUILD_METIS_EXECUTABLES "Build metis library executables" OFF)
|
option(GTSAM_BUILD_METIS_EXECUTABLES "Build metis library executables" OFF)
|
||||||
add_subdirectory(metis-5.1.0)
|
if(GTSAM_BUILD_METIS)
|
||||||
|
add_subdirectory(metis-5.1.0)
|
||||||
|
endif(GTSAM_BUILD_METIS)
|
||||||
############ NOTE: When updating GeographicLib be sure to disable building their examples
|
############ NOTE: When updating GeographicLib be sure to disable building their examples
|
||||||
############ and unit tests by commenting out their lines:
|
############ and unit tests by commenting out their lines:
|
||||||
# add_subdirectory (examples)
|
# add_subdirectory (examples)
|
||||||
|
|
|
@ -2,9 +2,13 @@ cmake_minimum_required(VERSION 2.8)
|
||||||
project(METIS)
|
project(METIS)
|
||||||
|
|
||||||
# Add flags for currect directory and below
|
# Add flags for currect directory and below
|
||||||
add_definitions(-Wno-unused-variable)
|
if ("${CMAKE_CXX_COMPILER_ID}" STREQUAL "Clang")
|
||||||
|
add_definitions(-Wno-unused-variable)
|
||||||
|
add_definitions(-Wno-sometimes-uninitialized)
|
||||||
|
endif()
|
||||||
|
|
||||||
add_definitions(-Wno-unknown-pragmas)
|
add_definitions(-Wno-unknown-pragmas)
|
||||||
add_definitions(-Wno-sometimes-uninitialized)
|
add_definitions(-Wunused-but-set-variable)
|
||||||
|
|
||||||
set(GKLIB_PATH ${PROJECT_SOURCE_DIR}/GKlib CACHE PATH "path to GKlib")
|
set(GKLIB_PATH ${PROJECT_SOURCE_DIR}/GKlib CACHE PATH "path to GKlib")
|
||||||
set(SHARED FALSE CACHE BOOL "build a shared library")
|
set(SHARED FALSE CACHE BOOL "build a shared library")
|
||||||
|
|
|
@ -33,7 +33,7 @@ if(CMAKE_COMPILER_IS_GNUCC)
|
||||||
set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC")
|
set(GKlib_COPTIONS "${GKlib_COPTIONS} -fPIC")
|
||||||
endif(NOT MINGW)
|
endif(NOT MINGW)
|
||||||
# GCC warnings.
|
# GCC warnings.
|
||||||
set(GKlib_COPTIONS "${GKlib_COPTIONS} -Wall -pedantic -Wno-unused-but-set-variable -Wno-unused-variable -Wno-unknown-pragmas")
|
set(GKlib_COPTIONS "${GKlib_COPTIONS} -Wall -pedantic -Wno-unused-variable -Wno-unknown-pragmas")
|
||||||
elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun")
|
elseif(${CMAKE_C_COMPILER_ID} MATCHES "Sun")
|
||||||
# Sun insists on -xc99.
|
# Sun insists on -xc99.
|
||||||
set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99")
|
set(GKlib_COPTIONS "${GKlib_COPTIONS} -xc99")
|
||||||
|
|
|
@ -88,6 +88,9 @@ namespace gtsam {
|
||||||
template<class DERIVEDFACTOR>
|
template<class DERIVEDFACTOR>
|
||||||
GaussianFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
GaussianFactorGraph(const FactorGraph<DERIVEDFACTOR>& graph) : Base(graph) {}
|
||||||
|
|
||||||
|
/** Virtual destructor */
|
||||||
|
virtual ~GaussianFactorGraph() {}
|
||||||
|
|
||||||
/// @name Testable
|
/// @name Testable
|
||||||
/// @{
|
/// @{
|
||||||
|
|
||||||
|
|
|
@ -151,13 +151,13 @@ void ISAM2Clique::print(const std::string& s, const KeyFormatter& formatter) con
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
ISAM2::ISAM2(const ISAM2Params& params): params_(params) {
|
ISAM2::ISAM2(const ISAM2Params& params): params_(params), update_count_(0) {
|
||||||
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
||||||
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
ISAM2::ISAM2() {
|
ISAM2::ISAM2() : update_count_(0) {
|
||||||
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
if(params_.optimizationParams.type() == typeid(ISAM2DoglegParams))
|
||||||
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
doglegDelta_ = boost::get<ISAM2DoglegParams>(params_.optimizationParams).initialDelta;
|
||||||
}
|
}
|
||||||
|
@ -521,8 +521,7 @@ ISAM2Result ISAM2::update(
|
||||||
|
|
||||||
gttic(ISAM2_update);
|
gttic(ISAM2_update);
|
||||||
|
|
||||||
static int count = 0;
|
this->update_count_++;
|
||||||
count++;
|
|
||||||
|
|
||||||
lastAffectedVariableCount = 0;
|
lastAffectedVariableCount = 0;
|
||||||
lastAffectedFactorCount = 0;
|
lastAffectedFactorCount = 0;
|
||||||
|
@ -533,7 +532,8 @@ ISAM2Result ISAM2::update(
|
||||||
ISAM2Result result;
|
ISAM2Result result;
|
||||||
if(params_.enableDetailedResults)
|
if(params_.enableDetailedResults)
|
||||||
result.detail = ISAM2Result::DetailedResults();
|
result.detail = ISAM2Result::DetailedResults();
|
||||||
const bool relinearizeThisStep = force_relinearize || (params_.enableRelinearization && count % params_.relinearizeSkip == 0);
|
const bool relinearizeThisStep = force_relinearize
|
||||||
|
|| (params_.enableRelinearization && update_count_ % params_.relinearizeSkip == 0);
|
||||||
|
|
||||||
if(verbose) {
|
if(verbose) {
|
||||||
cout << "ISAM2::update\n";
|
cout << "ISAM2::update\n";
|
||||||
|
|
|
@ -468,6 +468,8 @@ protected:
|
||||||
* variables and thus cannot have their linearization points changed. */
|
* variables and thus cannot have their linearization points changed. */
|
||||||
FastSet<Key> fixedVariables_;
|
FastSet<Key> fixedVariables_;
|
||||||
|
|
||||||
|
int update_count_; ///< Counter incremented every update(), used to determine periodic relinearization
|
||||||
|
|
||||||
public:
|
public:
|
||||||
|
|
||||||
typedef ISAM2 This; ///< This class
|
typedef ISAM2 This; ///< This class
|
||||||
|
|
|
@ -1,15 +1,18 @@
|
||||||
# Build full gtsam_unstable library as a single library
|
# Build full gtsam_unstable library as a single library
|
||||||
# and also build tests
|
# and also build tests
|
||||||
set (gtsam_unstable_subdirs
|
set (gtsam_unstable_subdirs
|
||||||
base
|
base
|
||||||
geometry
|
geometry
|
||||||
discrete
|
discrete
|
||||||
dynamics
|
dynamics
|
||||||
nonlinear
|
nonlinear
|
||||||
partition
|
|
||||||
slam
|
slam
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(GTSAM_BUILD_METIS) # Only build partition if metis is built
|
||||||
|
set (gtsam_unstable_subdirs ${gtsam_unstable_subdirs} partition)
|
||||||
|
endif(GTSAM_BUILD_METIS)
|
||||||
|
|
||||||
set(GTSAM_UNSTABLE_BOOST_LIBRARIES ${GTSAM_BOOST_LIBRARIES})
|
set(GTSAM_UNSTABLE_BOOST_LIBRARIES ${GTSAM_BOOST_LIBRARIES})
|
||||||
|
|
||||||
add_custom_target(check.unstable COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
|
add_custom_target(check.unstable COMMAND ${CMAKE_CTEST_COMMAND} --output-on-failure)
|
||||||
|
@ -22,7 +25,7 @@ set (excluded_sources # "")
|
||||||
)
|
)
|
||||||
|
|
||||||
set (excluded_headers # "")
|
set (excluded_headers # "")
|
||||||
"${CMAKE_CURRENT_SOURCE_DIR}/slam/serialization.h"
|
"${CMAKE_CURRENT_SOURCE_DIR}/slam/serialization.h"
|
||||||
)
|
)
|
||||||
|
|
||||||
# assemble core libaries
|
# assemble core libaries
|
||||||
|
@ -36,32 +39,35 @@ foreach(subdir ${gtsam_unstable_subdirs})
|
||||||
gtsam_assign_source_folders("${${subdir}_srcs}") # Create MSVC structure
|
gtsam_assign_source_folders("${${subdir}_srcs}") # Create MSVC structure
|
||||||
|
|
||||||
# Build local library and tests
|
# Build local library and tests
|
||||||
message(STATUS "Building ${subdir}_unstable")
|
message(STATUS "Building ${subdir}_unstable")
|
||||||
add_subdirectory(${subdir})
|
add_subdirectory(${subdir})
|
||||||
endforeach(subdir)
|
endforeach(subdir)
|
||||||
|
|
||||||
# assemble gtsam_unstable components
|
# assemble gtsam_unstable components
|
||||||
set(gtsam_unstable_srcs
|
set(gtsam_unstable_srcs
|
||||||
${base_srcs}
|
${base_srcs}
|
||||||
${geometry_srcs}
|
${geometry_srcs}
|
||||||
${discrete_srcs}
|
${discrete_srcs}
|
||||||
${dynamics_srcs}
|
${dynamics_srcs}
|
||||||
${nonlinear_srcs}
|
${nonlinear_srcs}
|
||||||
${partition_srcs}
|
|
||||||
${slam_srcs}
|
${slam_srcs}
|
||||||
)
|
)
|
||||||
|
|
||||||
|
if(GTSAM_BUILD_METIS) # Only build partition if metis is built
|
||||||
|
set (gtsam_unstable_srcs ${gtsam_unstable_srcs} ${partition_srcs})
|
||||||
|
endif(GTSAM_BUILD_METIS)
|
||||||
|
|
||||||
# Versions - same as core gtsam library
|
# Versions - same as core gtsam library
|
||||||
set(gtsam_unstable_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH})
|
set(gtsam_unstable_version ${GTSAM_VERSION_MAJOR}.${GTSAM_VERSION_MINOR}.${GTSAM_VERSION_PATCH})
|
||||||
set(gtsam_unstable_soversion ${GTSAM_VERSION_MAJOR})
|
set(gtsam_unstable_soversion ${GTSAM_VERSION_MAJOR})
|
||||||
message(STATUS "GTSAM_UNSTABLE Version: ${gtsam_unstable_version}")
|
message(STATUS "GTSAM_UNSTABLE Version: ${gtsam_unstable_version}")
|
||||||
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
|
message(STATUS "Install prefix: ${CMAKE_INSTALL_PREFIX}")
|
||||||
|
|
||||||
# build shared and static versions of the library
|
# build shared and static versions of the library
|
||||||
if (GTSAM_BUILD_STATIC_LIBRARY)
|
if (GTSAM_BUILD_STATIC_LIBRARY)
|
||||||
message(STATUS "Building GTSAM_UNSTABLE - static")
|
message(STATUS "Building GTSAM_UNSTABLE - static")
|
||||||
add_library(gtsam_unstable STATIC ${gtsam_unstable_srcs})
|
add_library(gtsam_unstable STATIC ${gtsam_unstable_srcs})
|
||||||
set_target_properties(gtsam_unstable PROPERTIES
|
set_target_properties(gtsam_unstable PROPERTIES
|
||||||
OUTPUT_NAME gtsam_unstable
|
OUTPUT_NAME gtsam_unstable
|
||||||
CLEAN_DIRECT_OUTPUT 1
|
CLEAN_DIRECT_OUTPUT 1
|
||||||
VERSION ${gtsam_unstable_version}
|
VERSION ${gtsam_unstable_version}
|
||||||
|
@ -78,7 +84,7 @@ if (GTSAM_BUILD_STATIC_LIBRARY)
|
||||||
else()
|
else()
|
||||||
message(STATUS "Building GTSAM_UNSTABLE - shared")
|
message(STATUS "Building GTSAM_UNSTABLE - shared")
|
||||||
add_library(gtsam_unstable SHARED ${gtsam_unstable_srcs})
|
add_library(gtsam_unstable SHARED ${gtsam_unstable_srcs})
|
||||||
set_target_properties(gtsam_unstable PROPERTIES
|
set_target_properties(gtsam_unstable PROPERTIES
|
||||||
OUTPUT_NAME gtsam_unstable
|
OUTPUT_NAME gtsam_unstable
|
||||||
CLEAN_DIRECT_OUTPUT 1
|
CLEAN_DIRECT_OUTPUT 1
|
||||||
VERSION ${gtsam_unstable_version}
|
VERSION ${gtsam_unstable_version}
|
||||||
|
@ -99,7 +105,7 @@ endif()
|
||||||
if (GTSAM_INSTALL_MATLAB_TOOLBOX)
|
if (GTSAM_INSTALL_MATLAB_TOOLBOX)
|
||||||
# Set up codegen
|
# Set up codegen
|
||||||
include(GtsamMatlabWrap)
|
include(GtsamMatlabWrap)
|
||||||
|
|
||||||
# Generate, build and install toolbox
|
# Generate, build and install toolbox
|
||||||
set(mexFlags "${GTSAM_BUILD_MEX_BINARY_FLAGS}")
|
set(mexFlags "${GTSAM_BUILD_MEX_BINARY_FLAGS}")
|
||||||
if(GTSAM_BUILD_STATIC_LIBRARY)
|
if(GTSAM_BUILD_STATIC_LIBRARY)
|
||||||
|
|
|
@ -4,4 +4,4 @@ install(FILES ${partition_headers} DESTINATION include/gtsam_unstable/parition)
|
||||||
|
|
||||||
set(ignore_test "tests/testNestedDissection.cpp")
|
set(ignore_test "tests/testNestedDissection.cpp")
|
||||||
# Add all tests
|
# Add all tests
|
||||||
gtsamAddTestsGlob(partition_unstable "tests/*.cpp" "${ignore_test}" "gtsam_unstable;metis")
|
gtsamAddTestsGlob(partition_unstable "tests/*.cpp" "${ignore_test}" "gtsam_unstable;metis")
|
||||||
|
|
|
@ -9,6 +9,7 @@
|
||||||
#include <boost/foreach.hpp>
|
#include <boost/foreach.hpp>
|
||||||
#include <boost/tuple/tuple.hpp>
|
#include <boost/tuple/tuple.hpp>
|
||||||
#include <boost/make_shared.hpp>
|
#include <boost/make_shared.hpp>
|
||||||
|
#include <boost/lexical_cast.hpp>
|
||||||
|
|
||||||
#include <gtsam/base/DSFVector.h>
|
#include <gtsam/base/DSFVector.h>
|
||||||
|
|
||||||
|
@ -468,9 +469,9 @@ namespace gtsam { namespace partition {
|
||||||
}
|
}
|
||||||
|
|
||||||
if (minFoundConstraintsPerCamera < minNrConstraintsPerCamera)
|
if (minFoundConstraintsPerCamera < minNrConstraintsPerCamera)
|
||||||
throw runtime_error("checkSingularity:minConstraintsPerCamera < " + minFoundConstraintsPerCamera);
|
throw runtime_error("checkSingularity:minConstraintsPerCamera < " + boost::lexical_cast<string>(minFoundConstraintsPerCamera));
|
||||||
if (minFoundConstraintsPerLandmark < minNrConstraintsPerLandmark)
|
if (minFoundConstraintsPerLandmark < minNrConstraintsPerLandmark)
|
||||||
throw runtime_error("checkSingularity:minConstraintsPerLandmark < " + minFoundConstraintsPerLandmark);
|
throw runtime_error("checkSingularity:minConstraintsPerLandmark < " + boost::lexical_cast<string>(minFoundConstraintsPerLandmark));
|
||||||
}
|
}
|
||||||
|
|
||||||
}} // namespace
|
}} // namespace
|
||||||
|
|
Loading…
Reference in New Issue