From 17a4e4c17479ea6ec05494b9cd9780a3927f6d44 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Sat, 10 Feb 2024 12:52:24 +0200 Subject: [PATCH 01/12] #if BOOST_VERSION < 108000 --- gtsam/base/std_optional_serialization.h | 3 +++ 1 file changed, 3 insertions(+) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 5c250eab43..0ab778761f 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -11,6 +11,8 @@ // Defined only if boost serialization is enabled #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION +// Only for old boost +#if BOOST_VERSION < 108000 #pragma once #include #include @@ -99,3 +101,4 @@ void serialize(Archive& ar, std::optional& t, const unsigned int version) { } // namespace serialization } // namespace boost #endif +#endif From 26f57ce3b2b84a068761adb4dc5c740861a419ac Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Thu, 22 Feb 2024 15:07:24 -0500 Subject: [PATCH 02/12] wrap barometric factor --- gtsam/base/std_optional_serialization.h | 3 +++ gtsam/navigation/BarometricFactor.h | 2 +- gtsam/navigation/navigation.i | 21 +++++++++++++++++++-- 3 files changed, 23 insertions(+), 3 deletions(-) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 5c250eab43..ac0c16c877 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -56,6 +56,8 @@ namespace std { template<> struct is_trivially_move_constructible& t, const unsigned int version) { } // namespace serialization } // namespace boost #endif +#endif diff --git a/gtsam/navigation/BarometricFactor.h b/gtsam/navigation/BarometricFactor.h index 38677ed589..70cae8d367 100644 --- a/gtsam/navigation/BarometricFactor.h +++ b/gtsam/navigation/BarometricFactor.h @@ -91,7 +91,7 @@ class GTSAM_EXPORT BarometricFactor : public NoiseModelFactorN { -0.00649; } - inline double baroOut(const double& meters) { + inline double baroOut(const double& meters) const { double temp = 15.04 - 0.00649 * meters; return 101.29 * std::pow(((temp + 273.1) / 288.08), 5.256); } diff --git a/gtsam/navigation/navigation.i b/gtsam/navigation/navigation.i index 8e6090e06a..92864c18a0 100644 --- a/gtsam/navigation/navigation.i +++ b/gtsam/navigation/navigation.i @@ -294,7 +294,7 @@ virtual class GPSFactor : gtsam::NonlinearFactor{ // Testable void print(string s = "", const gtsam::KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter) const; - bool equals(const gtsam::GPSFactor& expected, double tol); + bool equals(const gtsam::NonlinearFactor& expected, double tol); // Standard Interface gtsam::Point3 measurementIn() const; @@ -307,12 +307,29 @@ virtual class GPSFactor2 : gtsam::NonlinearFactor { // Testable void print(string s = "", const gtsam::KeyFormatter& keyFormatter = gtsam::DefaultKeyFormatter) const; - bool equals(const gtsam::GPSFactor2& expected, double tol); + bool equals(const gtsam::NonlinearFactor& expected, double tol); // Standard Interface gtsam::Point3 measurementIn() const; }; +#include +virtual class BarometricFactor : gtsam::NonlinearFactor { + BarometricFactor(); + BarometricFactor(size_t key, size_t baroKey, const double& baroIn, + const gtsam::noiseModel::Base* model); + + // Testable + void print(string s = "", const gtsam::KeyFormatter& keyFormatter = + gtsam::DefaultKeyFormatter) const; + bool equals(const gtsam::NonlinearFactor& expected, double tol); + + // Standard Interface + const double& measurementIn() const; + double heightOut(double n) const; + double baroOut(const double& meters) const; +}; + #include virtual class Scenario { gtsam::Pose3 pose(double t) const; From a47539506b3a6893de31bc95b1b9a9b9a5149096 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Mon, 26 Feb 2024 08:39:47 -0500 Subject: [PATCH 03/12] undo serialization header change --- gtsam/base/std_optional_serialization.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index ac0c16c877..5c250eab43 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -56,8 +56,6 @@ namespace std { template<> struct is_trivially_move_constructible& t, const unsigned int version) { } // namespace serialization } // namespace boost #endif -#endif From 9b2c4787ac7132cd04f44139da7b0286ac491434 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Mon, 26 Feb 2024 08:44:36 -0500 Subject: [PATCH 04/12] Revert "Merge pull request #1719 from talregev/TalR/python_tbb_ubuntu_22_04" This reverts commit f724f303889cbde32b097289d64cc771a9ee4369, reversing changes made to 448132af2746ff7164db88ac2cadd93cedbd0813. --- .github/workflows/build-python.yml | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index d8dfce0ee7..de9d755ba5 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -29,7 +29,7 @@ jobs: name: [ ubuntu-20.04-gcc-9, - ubuntu-22.04-gcc-9-tbb, + ubuntu-20.04-gcc-9-tbb, ubuntu-20.04-clang-9, macOS-11-xcode-13.4.1, windows-2019-msbuild, @@ -43,8 +43,8 @@ jobs: compiler: gcc version: "9" - - name: ubuntu-22.04-gcc-9-tbb - os: ubuntu-22.04 + - name: ubuntu-20.04-gcc-9-tbb + os: ubuntu-20.04 compiler: gcc version: "9" flag: tbb From 67cf8706d837126c96586b16e9cbbb147169a84b Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Mon, 26 Feb 2024 08:50:51 -0500 Subject: [PATCH 05/12] Revert "Merge pull request #1714 from talregev/TalR/remove_swap" This reverts commit 448132af2746ff7164db88ac2cadd93cedbd0813, reversing changes made to 2dfd15e16ce072931ee58e33866383919b38d8c0. --- .github/workflows/build-python.yml | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index de9d755ba5..520e94c09b 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -145,6 +145,12 @@ jobs: echo "GTSAM_WITH_TBB=ON" >> $GITHUB_ENV echo "GTSAM Uses TBB" + - name: Set Swap Space (Linux) + if: runner.os == 'Linux' + uses: pierotofy/set-swap-space@master + with: + swap-size-gb: 6 + - name: Install System Dependencies (Linux, macOS) if: runner.os != 'Windows' run: | From 0d7d159203ad5fa436b755ddd0133afd5668e0a1 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Mon, 26 Feb 2024 09:14:39 -0500 Subject: [PATCH 06/12] fix for boost serialization collision --- gtsam/base/std_optional_serialization.h | 2 ++ 1 file changed, 2 insertions(+) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 5c250eab43..079cb77456 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -56,6 +56,7 @@ namespace std { template<> struct is_trivially_move_constructible& t, const unsigned int version) { } // namespace serialization } // namespace boost #endif +#endif From 2379cfab9a366fac203a2ef15329194cefd127d8 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Mon, 26 Feb 2024 09:35:46 -0500 Subject: [PATCH 07/12] change C++ version to check against --- gtsam/base/std_optional_serialization.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 079cb77456..34556ada45 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -56,7 +56,7 @@ namespace std { template<> struct is_trivially_move_constructible Date: Mon, 26 Feb 2024 17:04:15 -0500 Subject: [PATCH 08/12] correctly fix name collisions due to newly merged Boost PR --- gtsam/base/std_optional_serialization.h | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 34556ada45..2fc829a859 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -55,8 +55,14 @@ namespace std { template<> struct is_trivially_move_constructible Date: Thu, 29 Feb 2024 15:12:57 -0800 Subject: [PATCH 09/12] Close unmatched endif --- gtsam/base/std_optional_serialization.h | 7 ++++--- 1 file changed, 4 insertions(+), 3 deletions(-) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 444c317033..7e30ae4d33 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -8,12 +8,12 @@ * Functionality to serialize std::optional to boost::archive * Inspired from this PR: https://github.com/boostorg/serialization/pull/163 * ---------------------------------------------------------------------------- */ +#pragma once // Defined only if boost serialization is enabled #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION // Only for old boost #if BOOST_VERSION < 108000 -#pragma once #include #include @@ -107,5 +107,6 @@ void serialize(Archive& ar, std::optional& t, const unsigned int version) { } // namespace serialization } // namespace boost -#endif -#endif +#endif // BOOST_VERSION < 108400 +#endif // BOOST_VERSION < 108000 +#endif // GTSAM_ENABLE_BOOST_SERIALIZATION From 8f17b5cfbb34a007a137b2aa4f8293f4cc3cf1b5 Mon Sep 17 00:00:00 2001 From: Ashwin Gupta Date: Fri, 1 Mar 2024 16:22:43 -0800 Subject: [PATCH 10/12] export Similarity3 specalized BetweenFactor to python --- gtsam/geometry/Similarity3.h | 12 ++++++++++++ gtsam/slam/slam.i | 3 ++- 2 files changed, 14 insertions(+), 1 deletion(-) diff --git a/gtsam/geometry/Similarity3.h b/gtsam/geometry/Similarity3.h index cd4af89bc0..05bd0431e1 100644 --- a/gtsam/geometry/Similarity3.h +++ b/gtsam/geometry/Similarity3.h @@ -202,6 +202,18 @@ class GTSAM_EXPORT Similarity3 : public LieGroup { /// @{ private: + + #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION + /** Serialization function */ + friend class boost::serialization::access; + template + void serialize(Archive & ar, const unsigned int /*version*/) { + ar & BOOST_SERIALIZATION_NVP(R_); + ar & BOOST_SERIALIZATION_NVP(t_); + ar & BOOST_SERIALIZATION_NVP(s_); + } + #endif + /// Calculate expmap and logmap coefficients. static Matrix3 GetV(Vector3 w, double lambda); diff --git a/gtsam/slam/slam.i b/gtsam/slam/slam.i index 7135137bba..64977a2a5f 100644 --- a/gtsam/slam/slam.i +++ b/gtsam/slam/slam.i @@ -7,12 +7,13 @@ namespace gtsam { #include #include #include +#include // ###### #include template virtual class BetweenFactor : gtsam::NoiseModelFactor { BetweenFactor(size_t key1, size_t key2, const T& relativePose, From 4947a101329772fbe530eb773d232ce3e5d5c744 Mon Sep 17 00:00:00 2001 From: Varun Agrawal Date: Sun, 3 Mar 2024 10:20:29 -0500 Subject: [PATCH 11/12] remove macro block for boost version 108000 --- gtsam/base/std_optional_serialization.h | 3 --- 1 file changed, 3 deletions(-) diff --git a/gtsam/base/std_optional_serialization.h b/gtsam/base/std_optional_serialization.h index 7e30ae4d33..7e0f2e844a 100644 --- a/gtsam/base/std_optional_serialization.h +++ b/gtsam/base/std_optional_serialization.h @@ -12,8 +12,6 @@ // Defined only if boost serialization is enabled #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION -// Only for old boost -#if BOOST_VERSION < 108000 #include #include @@ -108,5 +106,4 @@ void serialize(Archive& ar, std::optional& t, const unsigned int version) { } // namespace serialization } // namespace boost #endif // BOOST_VERSION < 108400 -#endif // BOOST_VERSION < 108000 #endif // GTSAM_ENABLE_BOOST_SERIALIZATION From 5a81dc000b23bd80185db9f6141114caf91d0481 Mon Sep 17 00:00:00 2001 From: Tal Regev Date: Fri, 26 Jan 2024 01:51:24 +0200 Subject: [PATCH 12/12] fix ambiguous call to overloaded function CameraSet.h(331) --- .github/workflows/build-python.yml | 12 +++++++++--- .github/workflows/build-windows.yml | 27 ++++++++++++++++----------- gtsam/geometry/CameraSet.h | 4 ++++ gtsam/nonlinear/Values-inl.h | 2 ++ 4 files changed, 31 insertions(+), 14 deletions(-) diff --git a/.github/workflows/build-python.yml b/.github/workflows/build-python.yml index 520e94c09b..ce3685f878 100644 --- a/.github/workflows/build-python.yml +++ b/.github/workflows/build-python.yml @@ -32,7 +32,7 @@ jobs: ubuntu-20.04-gcc-9-tbb, ubuntu-20.04-clang-9, macOS-11-xcode-13.4.1, - windows-2019-msbuild, + windows-2022-msbuild, ] build_type: [Release] @@ -59,8 +59,8 @@ jobs: compiler: xcode version: "13.4.1" - - name: windows-2019-msbuild - os: windows-2019 + - name: windows-2022-msbuild + os: windows-2022 platform: 64 steps: @@ -109,6 +109,12 @@ jobs: uses: ilammy/msvc-dev-cmd@v1 with: arch: x${{matrix.platform}} + toolset: 14.38 + + - name: cl version (Windows) + if: runner.os == 'Windows' + shell: cmd + run: cl - name: Setup python (Windows) uses: actions/setup-python@v4 diff --git a/.github/workflows/build-windows.yml b/.github/workflows/build-windows.yml index f0568394fa..a73842a982 100644 --- a/.github/workflows/build-windows.yml +++ b/.github/workflows/build-windows.yml @@ -27,7 +27,7 @@ jobs: # Github Actions requires a single row to be added to the build matrix. # See https://help.github.com/en/articles/workflow-syntax-for-github-actions. name: [ - windows-2019-cl, + windows-2022-cl, ] build_type: [ @@ -37,12 +37,25 @@ jobs: build_unstable: [ON] include: - - name: windows-2019-cl - os: windows-2019 + - name: windows-2022-cl + os: windows-2022 compiler: cl platform: 64 steps: + - name: Checkout + uses: actions/checkout@v3 + + - name: Setup msbuild + uses: ilammy/msvc-dev-cmd@v1 + with: + arch: x${{ matrix.platform }} + toolset: 14.38 + + - name: cl version + shell: cmd + run: cl + - name: Install Dependencies shell: powershell run: | @@ -91,14 +104,6 @@ jobs: # Set the BOOST_ROOT variable echo "BOOST_ROOT=$BOOST_PATH" >> $env:GITHUB_ENV - - name: Checkout - uses: actions/checkout@v3 - - - name: Setup msbuild - uses: ilammy/msvc-dev-cmd@v1 - with: - arch: x${{ matrix.platform }} - - name: Configuration shell: bash run: | diff --git a/gtsam/geometry/CameraSet.h b/gtsam/geometry/CameraSet.h index cf4beb8830..26d4952c8b 100644 --- a/gtsam/geometry/CameraSet.h +++ b/gtsam/geometry/CameraSet.h @@ -327,12 +327,16 @@ class CameraSet : public std::vector> { * g = F' * (b - E * P * E' * b) * Fixed size version */ +#ifdef _WIN32 +#if _MSC_VER < 1937 template // N = 2 or 3 static SymmetricBlockMatrix SchurComplement( const FBlocks& Fs, const Matrix& E, const Eigen::Matrix& P, const Vector& b) { return SchurComplement(Fs, E, P, b); } +#endif +#endif /// Computes Point Covariance P, with lambda parameter template // N = 2 or 3 (point dimension) diff --git a/gtsam/nonlinear/Values-inl.h b/gtsam/nonlinear/Values-inl.h index 1fe909a110..59ec2089d9 100644 --- a/gtsam/nonlinear/Values-inl.h +++ b/gtsam/nonlinear/Values-inl.h @@ -200,6 +200,7 @@ namespace gtsam { // Added this section for compile gtsam python on windows. // msvc don't deduct the template arguments correctly, due possible bug in msvc. #ifdef _WIN32 +#if _MSC_VER < 1937 // Handle dynamic matrices template struct handle_matrix, true> { @@ -250,6 +251,7 @@ namespace gtsam { (M == Eigen::Dynamic || N == Eigen::Dynamic)>()(j, pointer); } }; +#endif // #if _MSC_VER < 1937 #endif // #ifdef _WIN32 } // internal