Loading...
Searching...
No Matches
PreintegrationParams.h
Go to the documentation of this file.
/* ----------------------------------------------------------------------------
* GTSAM Copyright 2010, Georgia Tech Research Corporation,
* Atlanta, Georgia 30332-0415
* All Rights Reserved
* Authors: Frank Dellaert, et al. (see THANKS for the full author list)
* See LICENSE for the license information
* -------------------------------------------------------------------------- */
#pragma once
#include <gtsam/navigation/PreintegratedRotation.h>
#include <boost/make_shared.hpp>
namespace gtsam {
struct GTSAM_EXPORT PreintegrationParams: PreintegratedRotationParams {
Matrix3 accelerometerCovariance;
Matrix3 integrationCovariance;
bool use2ndOrderCoriolis;
Vector3 n_gravity;
PreintegrationParams()
: PreintegratedRotationParams(),
accelerometerCovariance(I_3x3),
integrationCovariance(I_3x3),
use2ndOrderCoriolis(false),
n_gravity(0, 0, -1) {}
PreintegrationParams(const Vector3& n_gravity)
: PreintegratedRotationParams(),
accelerometerCovariance(I_3x3),
integrationCovariance(I_3x3),
use2ndOrderCoriolis(false),
n_gravity(n_gravity) {}
// Default Params for a Z-down navigation frame, such as NED: gravity points along positive Z-axis
static boost::shared_ptr<PreintegrationParams> MakeSharedD(double g = 9.81) {
return boost::shared_ptr<PreintegrationParams>(new PreintegrationParams(Vector3(0, 0, g)));
}
// Default Params for a Z-up navigation frame, such as ENU: gravity points along negative Z-axis
static boost::shared_ptr<PreintegrationParams> MakeSharedU(double g = 9.81) {
return boost::shared_ptr<PreintegrationParams>(new PreintegrationParams(Vector3(0, 0, -g)));
}
void print(const std::string& s="") const override;
bool equals(const PreintegratedRotationParams& other, double tol) const override;
void setAccelerometerCovariance(const Matrix3& cov) { accelerometerCovariance = cov; }
void setIntegrationCovariance(const Matrix3& cov) { integrationCovariance = cov; }
void setUse2ndOrderCoriolis(bool flag) { use2ndOrderCoriolis = flag; }
const Matrix3& getAccelerometerCovariance() const { return accelerometerCovariance; }
const Matrix3& getIntegrationCovariance() const { return integrationCovariance; }
const Vector3& getGravity() const { return n_gravity; }
bool getUse2ndOrderCoriolis() const { return use2ndOrderCoriolis; }
protected:
friend class boost::serialization::access;
template<class ARCHIVE>
void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
namespace bs = ::boost::serialization;
ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(PreintegratedRotationParams);
ar & BOOST_SERIALIZATION_NVP(accelerometerCovariance);
ar & BOOST_SERIALIZATION_NVP(integrationCovariance);
ar & BOOST_SERIALIZATION_NVP(use2ndOrderCoriolis);
ar & BOOST_SERIALIZATION_NVP(n_gravity);
}
#ifdef GTSAM_USE_QUATERNIONS
// Align if we are using Quaternions
public:
GTSAM_MAKE_ALIGNED_OPERATOR_NEW
#endif
};
} // namespace gtsam
GTSAM_MAKE_ALIGNED_OPERATOR_NEW
#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW
This marks a GTSAM object to require alignment.
Definition types.h:308
PreintegratedRotation.h
gtsam
Global functions in a separate testing namespace.
Definition chartTesting.h:28
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:156
gtsam::PreintegrationParams
Parameters for pre-integration: Usage: Create just a single Params and pass a shared pointer to the c...
Definition PreintegrationParams.h:26
gtsam::PreintegrationParams::accelerometerCovariance
Matrix3 accelerometerCovariance
Continuous-time "Covariance" of accelerometer The units for stddev are σ = m/s²/√Hz.
Definition PreintegrationParams.h:29
gtsam::PreintegrationParams::use2ndOrderCoriolis
bool use2ndOrderCoriolis
Whether to use second order Coriolis integration.
Definition PreintegrationParams.h:31
gtsam::PreintegrationParams::PreintegrationParams
PreintegrationParams()
Default constructor for serialization only.
Definition PreintegrationParams.h:35
gtsam::PreintegrationParams::n_gravity
Vector3 n_gravity
Gravity vector in nav frame.
Definition PreintegrationParams.h:32
gtsam::PreintegrationParams::PreintegrationParams
PreintegrationParams(const Vector3 &n_gravity)
The Params constructor insists on getting the navigation frame gravity vector For convenience,...
Definition PreintegrationParams.h:44
gtsam::PreintegrationParams::integrationCovariance
Matrix3 integrationCovariance
continuous-time "Covariance" describing integration uncertainty
Definition PreintegrationParams.h:30