32 #ifdef GTSAM_TANGENT_PREINTEGRATION 33 typedef TangentPreintegration PreintegrationType;
35 typedef ManifoldPreintegration PreintegrationType;
85 preintMeasCov_.setZero();
96 preintMeasCov_.setZero();
106 preintMeasCov_(preintMeasCov) {
114 void print(
const std::string& s =
"Preintegrated Measurements:")
const override;
120 void resetIntegration()
override;
128 void integrateMeasurement(
const Vector3& measuredAcc,
129 const Vector3& measuredOmega,
const double dt)
override;
132 void integrateMeasurements(
const Matrix& measuredAccs,
const Matrix& measuredOmegas,
138 #ifdef GTSAM_TANGENT_PREINTEGRATION 143 #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V4 147 const Matrix3& measuredAccCovariance,
148 const Matrix3& measuredOmegaCovariance,
149 const Matrix3& integrationErrorCovariance,
150 bool use2ndOrderIntegration =
true);
154 void integrateMeasurement(
const Vector3& measuredAcc,
155 const Vector3& measuredOmega,
double dt,
156 boost::optional<Pose3> body_P_sensor);
162 friend class boost::serialization::access;
163 template<
class ARCHIVE>
164 void serialize(ARCHIVE & ar,
const unsigned int ) {
165 namespace bs = ::boost::serialization;
167 ar & bs::make_nvp(
"preintMeasCov_", bs::make_array(preintMeasCov_.data(), preintMeasCov_.size()));
184 imuBias::ConstantBias> {
196 #if !defined(_MSC_VER) && __GNUC__ == 4 && __GNUC_MINOR__ > 5 197 typedef typename boost::shared_ptr<ImuFactor> shared_ptr;
220 virtual gtsam::NonlinearFactor::shared_ptr clone()
const;
224 GTSAM_EXPORT
friend std::ostream& operator<<(std::ostream& os,
const ImuFactor&);
226 DefaultKeyFormatter)
const;
227 virtual bool equals(
const NonlinearFactor& expected,
double tol = 1e-9)
const;
238 Vector evaluateError(
const Pose3& pose_i,
const Vector3& vel_i,
240 const Pose3& pose_j,
const Vector3& vel_j,
242 boost::none, boost::optional<Matrix&> H2 = boost::none,
243 boost::optional<Matrix&> H3 = boost::none, boost::optional<Matrix&> H4 =
244 boost::none, boost::optional<Matrix&> H5 = boost::none)
const;
246 #ifdef GTSAM_TANGENT_PREINTEGRATION 253 static shared_ptr Merge(
const shared_ptr& f01,
const shared_ptr& f12);
256 #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V4 262 const PreintegratedMeasurements& preintegratedMeasurements,
263 const Vector3& n_gravity,
const Vector3& omegaCoriolis,
264 const boost::optional<Pose3>& body_P_sensor = boost::none,
265 const bool use2ndOrderCoriolis =
false);
269 static void Predict(
const Pose3& pose_i,
const Vector3& vel_i,
Pose3& pose_j,
271 PreintegratedMeasurements& pim,
const Vector3& n_gravity,
272 const Vector3& omegaCoriolis,
const bool use2ndOrderCoriolis =
false);
278 friend class boost::serialization::access;
279 template<
class ARCHIVE>
280 void serialize(ARCHIVE & ar,
const unsigned int ) {
281 ar & boost::serialization::make_nvp(
"NoiseModelFactor5",
282 boost::serialization::base_object<Base>(*
this));
283 ar & BOOST_SERIALIZATION_NVP(_PIM_);
318 virtual gtsam::NonlinearFactor::shared_ptr clone()
const;
322 GTSAM_EXPORT
friend std::ostream& operator<<(std::ostream& os,
const ImuFactor2&);
324 DefaultKeyFormatter)
const;
325 virtual bool equals(
const NonlinearFactor& expected,
double tol = 1e-9)
const;
339 boost::optional<Matrix&> H1 = boost::none,
340 boost::optional<Matrix&> H2 = boost::none,
341 boost::optional<Matrix&> H3 = boost::none)
const;
346 friend class boost::serialization::access;
347 template<
class ARCHIVE>
348 void serialize(ARCHIVE & ar,
const unsigned int ) {
349 ar & boost::serialization::make_nvp(
"NoiseModelFactor3",
350 boost::serialization::base_object<Base>(*
this));
351 ar & BOOST_SERIALIZATION_NVP(_PIM_);
const PreintegratedImuMeasurements & preintegratedMeasurements() const
Access the preintegrated measurements.
Definition: ImuFactor.h:330
This is the base class for all factor types.
Definition: Factor.h:54
Definition: ImuFactor.h:292
Navigation state: Pose (rotation, translation) + velocity NOTE(frank): it does not make sense to make...
Definition: NavState.h:34
boost::shared_ptr< ImuFactor > shared_ptr
Shorthand for a smart pointer to a factor.
Definition: ImuFactor.h:199
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
Matrix preintMeasCov() const
Return pre-integrated measurement covariance.
Definition: ImuFactor.h:136
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
IMU pre-integration on NavSatet manifold.
Definition: ManifoldPreintegration.h:33
Template to create a binary predicate.
Definition: Testable.h:110
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
Definition: ImuFactor.h:183
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
const PreintegratedImuMeasurements & preintegratedMeasurements() const
Access the preintegrated measurements.
Definition: ImuFactor.h:232
PreintegratedImuMeasurements(const PreintegrationType &base, const Matrix9 &preintMeasCov)
Construct preintegrated directly from members: base class and preintMeasCov.
Definition: ImuFactor.h:104
PreintegratedImuMeasurements(const boost::shared_ptr< PreintegrationParams > &p, const imuBias::ConstantBias &biasHat=imuBias::ConstantBias())
Constructor, initializes the class with no measurements.
Definition: ImuFactor.h:93
PreintegratedImuMeasurements()
Default constructor for serialization and Cython wrapper.
Definition: ImuFactor.h:84
A convenient base class for creating your own NoiseModelFactor with 3 variables.
Definition: NonlinearFactor.h:420
Matrix9 preintMeasCov_
COVARIANCE OF: [PreintROTATION PreintPOSITION PreintVELOCITY].
Definition: ImuFactor.h:78
ImuFactor()
Default constructor - only use for serialization.
Definition: ImuFactor.h:203
Definition: ImuFactor.h:71
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Non-linear factor base classes.
A convenient base class for creating your own NoiseModelFactor with 5 variables.
Definition: NonlinearFactor.h:578
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
virtual ~PreintegratedImuMeasurements()
Virtual destructor.
Definition: ImuFactor.h:110
ImuFactor2()
Default constructor - only use for serialization.
Definition: ImuFactor.h:303