initialize PreintegrationParams default constructor and make serialization test more explicit
parent
c2d7df3f14
commit
9bef6bfded
|
@ -29,6 +29,13 @@ struct GTSAM_EXPORT PreintegrationParams: PreintegratedRotationParams {
|
||||||
bool use2ndOrderCoriolis; ///< Whether to use second order Coriolis integration
|
bool use2ndOrderCoriolis; ///< Whether to use second order Coriolis integration
|
||||||
Vector3 n_gravity; ///< Gravity vector in nav frame
|
Vector3 n_gravity; ///< Gravity vector in nav frame
|
||||||
|
|
||||||
|
/// Default constructor for serialization only
|
||||||
|
PreintegrationParams()
|
||||||
|
: accelerometerCovariance(I_3x3),
|
||||||
|
integrationCovariance(I_3x3),
|
||||||
|
use2ndOrderCoriolis(false),
|
||||||
|
n_gravity(0, 0, -1) {}
|
||||||
|
|
||||||
/// The Params constructor insists on getting the navigation frame gravity vector
|
/// The Params constructor insists on getting the navigation frame gravity vector
|
||||||
/// For convenience, two commonly used conventions are provided by named constructors below
|
/// For convenience, two commonly used conventions are provided by named constructors below
|
||||||
PreintegrationParams(const Vector3& n_gravity)
|
PreintegrationParams(const Vector3& n_gravity)
|
||||||
|
@ -60,8 +67,6 @@ struct GTSAM_EXPORT PreintegrationParams: PreintegratedRotationParams {
|
||||||
bool getUse2ndOrderCoriolis() const { return use2ndOrderCoriolis; }
|
bool getUse2ndOrderCoriolis() const { return use2ndOrderCoriolis; }
|
||||||
|
|
||||||
protected:
|
protected:
|
||||||
/// Default constructor for serialization only: uninitialized!
|
|
||||||
PreintegrationParams() {}
|
|
||||||
|
|
||||||
/** Serialization function */
|
/** Serialization function */
|
||||||
friend class boost::serialization::access;
|
friend class boost::serialization::access;
|
||||||
|
|
|
@ -64,9 +64,9 @@ TEST(ImuFactor, serialization) {
|
||||||
|
|
||||||
ImuFactor factor(1, 2, 3, 4, 5, pim);
|
ImuFactor factor(1, 2, 3, 4, 5, pim);
|
||||||
|
|
||||||
EXPECT(equalsObj(factor));
|
EXPECT(equalsObj<ImuFactor>(factor));
|
||||||
EXPECT(equalsXML(factor));
|
EXPECT(equalsXML<ImuFactor>(factor));
|
||||||
EXPECT(equalsBinary(factor));
|
EXPECT(equalsBinary<ImuFactor>(factor));
|
||||||
}
|
}
|
||||||
|
|
||||||
/* ************************************************************************* */
|
/* ************************************************************************* */
|
||||||
|
|
Loading…
Reference in New Issue