34#ifdef GTSAM_TANGENT_PREINTEGRATION
35typedef TangentPreintegration PreintegrationType;
37typedef ManifoldPreintegration PreintegrationType;
69 : biasAccCovariance(I_3x3),
70 biasOmegaCovariance(I_3x3),
71 biasAccOmegaInt(I_6x6) {}
76 biasOmegaCovariance(I_3x3), biasAccOmegaInt(I_6x6) {
81 static boost::shared_ptr<PreintegrationCombinedParams> MakeSharedD(
double g = 9.81) {
86 static boost::shared_ptr<PreintegrationCombinedParams> MakeSharedU(
double g = 9.81) {
87 return boost::shared_ptr<PreintegrationCombinedParams>(
new PreintegrationCombinedParams(Vector3(0, 0, -g)));
90 void print(
const std::string& s=
"")
const override;
91 bool equals(
const PreintegratedRotationParams& other,
double tol)
const override;
93 void setBiasAccCovariance(
const Matrix3& cov) { biasAccCovariance=cov; }
94 void setBiasOmegaCovariance(
const Matrix3& cov) { biasOmegaCovariance=cov; }
95 void setBiasAccOmegaInt(
const Matrix6& cov) { biasAccOmegaInt=cov; }
97 const Matrix3& getBiasAccCovariance()
const {
return biasAccCovariance; }
98 const Matrix3& getBiasOmegaCovariance()
const {
return biasOmegaCovariance; }
99 const Matrix6& getBiasAccOmegaInt()
const {
return biasAccOmegaInt; }
104 friend class boost::serialization::access;
105 template <
class ARCHIVE>
106 void serialize(ARCHIVE& ar,
const unsigned int ) {
107 namespace bs = ::boost::serialization;
109 ar & BOOST_SERIALIZATION_NVP(biasAccCovariance);
110 ar & BOOST_SERIALIZATION_NVP(biasOmegaCovariance);
111 ar & BOOST_SERIALIZATION_NVP(biasAccOmegaInt);
140 Eigen::Matrix<double, 15, 15> preintMeasCov_;
150 preintMeasCov_.setZero();
159 const boost::shared_ptr<Params>& p,
162 preintMeasCov_.setZero();
172 preintMeasCov_(preintMeasCov) {
184 void resetIntegration()
override;
187 Params&
p()
const {
return *boost::static_pointer_cast<Params>(this->p_); }
193 Matrix preintMeasCov()
const {
return preintMeasCov_; }
199 void print(
const std::string& s =
"Preintegrated Measurements:")
const override;
201 bool equals(
const PreintegratedCombinedMeasurements& expected,
202 double tol = 1e-9)
const;
216 void integrateMeasurement(
const Vector3& measuredAcc,
217 const Vector3& measuredOmega,
const double dt)
override;
223 friend class boost::serialization::access;
224 template <
class ARCHIVE>
225 void serialize(ARCHIVE& ar,
const unsigned int ) {
226 namespace bs = ::boost::serialization;
228 ar& BOOST_SERIALIZATION_NVP(preintMeasCov_);
255 Vector3, imuBias::ConstantBias, imuBias::ConstantBias> {
269#if !defined(_MSC_VER) && __GNUC__ == 4 && __GNUC_MINOR__ > 5
270 typedef typename boost::shared_ptr<CombinedImuFactor> shared_ptr;
295 gtsam::NonlinearFactor::shared_ptr clone()
const override;
301 GTSAM_EXPORT
friend std::ostream& operator<<(std::ostream& os,
302 const CombinedImuFactor&);
305 DefaultKeyFormatter)
const override;
308 bool equals(
const NonlinearFactor& expected,
double tol = 1e-9)
const override;
320 Vector evaluateError(
const Pose3& pose_i,
const Vector3& vel_i,
321 const Pose3& pose_j,
const Vector3& vel_j,
323 boost::optional<Matrix&> H1 = boost::none, boost::optional<Matrix&> H2 =
324 boost::none, boost::optional<Matrix&> H3 = boost::none,
325 boost::optional<Matrix&> H4 = boost::none, boost::optional<Matrix&> H5 =
326 boost::none, boost::optional<Matrix&> H6 = boost::none)
const override;
330 friend class boost::serialization::access;
331 template <
class ARCHIVE>
332 void serialize(ARCHIVE& ar,
const unsigned int ) {
334 ar& BOOST_SERIALIZATION_NVP(_PIM_);
344 :
public Testable<PreintegrationCombinedParams> {};
348 :
public Testable<PreintegratedCombinedMeasurements> {};
#define GTSAM_MAKE_ALIGNED_OPERATOR_NEW
This marks a GTSAM object to require alignment.
Definition: types.h:277
typedef and functions to augment Eigen's MatrixXd
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:112
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:151
This is the base class for all factor types.
Definition: Factor.h:56
Parameters for pre-integration using PreintegratedCombinedMeasurements: Usage: Create just a single P...
Definition: CombinedImuFactor.h:61
Matrix6 biasAccOmegaInt
covariance of bias used for pre-integration
Definition: CombinedImuFactor.h:64
PreintegrationCombinedParams(const Vector3 &n_gravity)
See two named constructors below for good values of n_gravity in body frame.
Definition: CombinedImuFactor.h:74
PreintegrationCombinedParams()
Default constructor makes uninitialized params struct.
Definition: CombinedImuFactor.h:68
Matrix3 biasOmegaCovariance
continuous-time "Covariance" describing gyroscope bias random walk
Definition: CombinedImuFactor.h:63
Matrix3 biasAccCovariance
continuous-time "Covariance" describing accelerometer bias random walk
Definition: CombinedImuFactor.h:62
Definition: CombinedImuFactor.h:128
PreintegratedCombinedMeasurements(const PreintegrationType &base, const Eigen::Matrix< double, 15, 15 > &preintMeasCov)
Construct preintegrated directly from members: base class and preintMeasCov.
Definition: CombinedImuFactor.h:170
~PreintegratedCombinedMeasurements() override
Virtual destructor.
Definition: CombinedImuFactor.h:176
PreintegratedCombinedMeasurements()
Default constructor only for serialization and wrappers.
Definition: CombinedImuFactor.h:149
Params & p() const
const reference to params, shadows definition in base class
Definition: CombinedImuFactor.h:187
PreintegratedCombinedMeasurements(const boost::shared_ptr< Params > &p, const imuBias::ConstantBias &biasHat=imuBias::ConstantBias())
Default constructor, initializes the class with no measurements.
Definition: CombinedImuFactor.h:158
Definition: CombinedImuFactor.h:255
boost::shared_ptr< CombinedImuFactor > shared_ptr
Shorthand for a smart pointer to a factor.
Definition: CombinedImuFactor.h:272
CombinedImuFactor()
Default constructor - only use for serialization.
Definition: CombinedImuFactor.h:276
const PreintegratedCombinedMeasurements & preintegratedMeasurements() const
Access the preintegrated measurements.
Definition: CombinedImuFactor.h:313
IMU pre-integration on NavSatet manifold.
Definition: ManifoldPreintegration.h:33
Parameters for pre-integration: Usage: Create just a single Params and pass a shared pointer to the c...
Definition: PreintegrationParams.h:26
A convenient base class for creating your own NoiseModelFactor with 6 variables.
Definition: NonlinearFactor.h:687
Convenience functions for serializing data structures via boost.serialization.