20 #include <boost/make_shared.hpp>
35 accelerometerCovariance(I_3x3),
36 integrationCovariance(I_3x3),
37 use2ndOrderCoriolis(false),
38 n_gravity(0, 0, -1) {}
44 accelerometerCovariance(I_3x3),
45 integrationCovariance(I_3x3),
46 use2ndOrderCoriolis(false),
47 n_gravity(n_gravity) {}
50 static boost::shared_ptr<PreintegrationParams> MakeSharedD(
double g = 9.81) {
55 static boost::shared_ptr<PreintegrationParams> MakeSharedU(
double g = 9.81) {
56 return boost::shared_ptr<PreintegrationParams>(
new PreintegrationParams(Vector3(0, 0, -g)));
59 void print(
const std::string& s=
"")
const override;
60 bool equals(
const PreintegratedRotationParams& other,
double tol)
const override;
62 void setAccelerometerCovariance(
const Matrix3& cov) { accelerometerCovariance = cov; }
63 void setIntegrationCovariance(
const Matrix3& cov) { integrationCovariance = cov; }
64 void setUse2ndOrderCoriolis(
bool flag) { use2ndOrderCoriolis = flag; }
66 const Matrix3& getAccelerometerCovariance()
const {
return accelerometerCovariance; }
67 const Matrix3& getIntegrationCovariance()
const {
return integrationCovariance; }
68 const Vector3& getGravity()
const {
return n_gravity; }
69 bool getUse2ndOrderCoriolis()
const {
return use2ndOrderCoriolis; }
74 friend class boost::serialization::access;
75 template<
class ARCHIVE>
76 void serialize(ARCHIVE & ar,
const unsigned int ) {
77 namespace bs = ::boost::serialization;
79 ar & BOOST_SERIALIZATION_NVP(accelerometerCovariance);
80 ar & BOOST_SERIALIZATION_NVP(integrationCovariance);
81 ar & BOOST_SERIALIZATION_NVP(use2ndOrderCoriolis);
82 ar & BOOST_SERIALIZATION_NVP(n_gravity);
85 #ifdef GTSAM_USE_QUATERNIONS