Skip to content

Commit ae763f3

Browse files
authored
Merge pull request #2 from borglab/develop
Update from develop
2 parents 1b66c3e + eeb092e commit ae763f3

File tree

6 files changed

+51
-7
lines changed

6 files changed

+51
-7
lines changed

.github/workflows/build-python.yml

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -145,6 +145,12 @@ jobs:
145145
echo "GTSAM_WITH_TBB=ON" >> $GITHUB_ENV
146146
echo "GTSAM Uses TBB"
147147
148+
- name: Set Swap Space (Linux)
149+
if: runner.os == 'Linux'
150+
uses: pierotofy/set-swap-space@master
151+
with:
152+
swap-size-gb: 6
153+
148154
- name: Install System Dependencies (Linux, macOS)
149155
if: runner.os != 'Windows'
150156
run: |

gtsam/base/std_optional_serialization.h

Lines changed: 11 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,10 +8,10 @@
88
* Functionality to serialize std::optional<T> to boost::archive
99
* Inspired from this PR: https://github.com/boostorg/serialization/pull/163
1010
* ---------------------------------------------------------------------------- */
11+
#pragma once
1112

1213
// Defined only if boost serialization is enabled
1314
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
14-
#pragma once
1515
#include <optional>
1616
#include <boost/config.hpp>
1717

@@ -55,7 +55,14 @@ namespace std { template<> struct is_trivially_move_constructible<boost::seriali
5555
#endif
5656
#endif
5757

58-
58+
/*
59+
* PR https://github.com/boostorg/serialization/pull/163 was merged
60+
* on September 3rd 2023,
61+
* and so the below code is now a part of Boost 1.84.
62+
* We include it for posterity, hence the check for BOOST_VERSION being less
63+
* than 1.84.
64+
*/
65+
#if BOOST_VERSION < 108400
5966
// function specializations must be defined in the appropriate
6067
// namespace - boost::serialization
6168
namespace boost {
@@ -98,4 +105,5 @@ void serialize(Archive& ar, std::optional<T>& t, const unsigned int version) {
98105

99106
} // namespace serialization
100107
} // namespace boost
101-
#endif
108+
#endif // BOOST_VERSION < 108400
109+
#endif // GTSAM_ENABLE_BOOST_SERIALIZATION

gtsam/geometry/Similarity3.h

Lines changed: 12 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -202,6 +202,18 @@ class GTSAM_EXPORT Similarity3 : public LieGroup<Similarity3, 7> {
202202
/// @{
203203

204204
private:
205+
206+
#ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
207+
/** Serialization function */
208+
friend class boost::serialization::access;
209+
template<class Archive>
210+
void serialize(Archive & ar, const unsigned int /*version*/) {
211+
ar & BOOST_SERIALIZATION_NVP(R_);
212+
ar & BOOST_SERIALIZATION_NVP(t_);
213+
ar & BOOST_SERIALIZATION_NVP(s_);
214+
}
215+
#endif
216+
205217
/// Calculate expmap and logmap coefficients.
206218
static Matrix3 GetV(Vector3 w, double lambda);
207219

gtsam/navigation/BarometricFactor.h

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -91,7 +91,7 @@ class GTSAM_EXPORT BarometricFactor : public NoiseModelFactorN<Pose3, double> {
9191
-0.00649;
9292
}
9393

94-
inline double baroOut(const double& meters) {
94+
inline double baroOut(const double& meters) const {
9595
double temp = 15.04 - 0.00649 * meters;
9696
return 101.29 * std::pow(((temp + 273.1) / 288.08), 5.256);
9797
}

gtsam/navigation/navigation.i

Lines changed: 19 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -294,7 +294,7 @@ virtual class GPSFactor : gtsam::NonlinearFactor{
294294
// Testable
295295
void print(string s = "", const gtsam::KeyFormatter& keyFormatter =
296296
gtsam::DefaultKeyFormatter) const;
297-
bool equals(const gtsam::GPSFactor& expected, double tol);
297+
bool equals(const gtsam::NonlinearFactor& expected, double tol);
298298

299299
// Standard Interface
300300
gtsam::Point3 measurementIn() const;
@@ -307,12 +307,29 @@ virtual class GPSFactor2 : gtsam::NonlinearFactor {
307307
// Testable
308308
void print(string s = "", const gtsam::KeyFormatter& keyFormatter =
309309
gtsam::DefaultKeyFormatter) const;
310-
bool equals(const gtsam::GPSFactor2& expected, double tol);
310+
bool equals(const gtsam::NonlinearFactor& expected, double tol);
311311

312312
// Standard Interface
313313
gtsam::Point3 measurementIn() const;
314314
};
315315

316+
#include <gtsam/navigation/BarometricFactor.h>
317+
virtual class BarometricFactor : gtsam::NonlinearFactor {
318+
BarometricFactor();
319+
BarometricFactor(size_t key, size_t baroKey, const double& baroIn,
320+
const gtsam::noiseModel::Base* model);
321+
322+
// Testable
323+
void print(string s = "", const gtsam::KeyFormatter& keyFormatter =
324+
gtsam::DefaultKeyFormatter) const;
325+
bool equals(const gtsam::NonlinearFactor& expected, double tol);
326+
327+
// Standard Interface
328+
const double& measurementIn() const;
329+
double heightOut(double n) const;
330+
double baroOut(const double& meters) const;
331+
};
332+
316333
#include <gtsam/navigation/Scenario.h>
317334
virtual class Scenario {
318335
gtsam::Pose3 pose(double t) const;

gtsam/slam/slam.i

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,12 +7,13 @@ namespace gtsam {
77
#include <gtsam/geometry/Cal3DS2.h>
88
#include <gtsam/geometry/SO4.h>
99
#include <gtsam/navigation/ImuBias.h>
10+
#include <gtsam/geometry/Similarity3.h>
1011

1112
// ######
1213

1314
#include <gtsam/slam/BetweenFactor.h>
1415
template <T = {double, Vector, gtsam::Point2, gtsam::Point3, gtsam::Rot2, gtsam::SO3,
15-
gtsam::SO4, gtsam::Rot3, gtsam::Pose2, gtsam::Pose3,
16+
gtsam::SO4, gtsam::Rot3, gtsam::Pose2, gtsam::Pose3, gtsam::Similarity3,
1617
gtsam::imuBias::ConstantBias}>
1718
virtual class BetweenFactor : gtsam::NoiseModelFactor {
1819
BetweenFactor(size_t key1, size_t key2, const T& relativePose,

0 commit comments

Comments
 (0)