37 : Base(model, key1, key2), accel_(accel), gyro_(gyro), dt_(dt) {}
42 : Base(model, key1, key2), accel_(imu_vector.
head(3)), gyro_(imu_vector.
tail(3)), dt_(dt) {}
53 const This*
const f =
dynamic_cast<const This*
>(&
e);
61 std::string
a =
"IMUFactor: " +
s;
65 std::cout <<
"dt: " << dt_ << std::endl;
71 Vector6
z()
const {
return (Vector6() << accel_, gyro_).finished(); }
78 boost::optional<Matrix&> H1 = boost::none,
79 boost::optional<Matrix&> H2 = boost::none)
const override {
80 const Vector6 meas =
z();
81 if (H1) *H1 = numericalDerivative21<Vector6, PoseRTV, PoseRTV>(
83 if (H2) *H2 = numericalDerivative22<Vector6, PoseRTV, PoseRTV>(
90 boost::optional<Matrix&> H1 = boost::none,
91 boost::optional<Matrix&> H2 = boost::none)
const {
93 return Vector6::Zero();
99 double dt,
const Vector6& meas) {
void print(const Matrix &A, const string &s, ostream &stream)
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
Vector evaluateError(const PoseRTV &x1, const PoseRTV &x2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
noiseModel::Diagonal::shared_ptr model
EIGEN_DEVICE_FUNC SegmentReturnType tail(Index n)
This is the const version of tail(Index).
static Vector6 predict_proxy(const PoseRTV &x1, const PoseRTV &x2, double dt, const Vector6 &meas)
gtsam::NonlinearFactor::shared_ptr clone() const override
Vector6 imuPrediction(const PoseRTV &x2, double dt) const
Some functions to compute numerical derivatives.
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
const Vector3 & gyro() const
void print(const std::string &s="", const gtsam::KeyFormatter &formatter=gtsam::DefaultKeyFormatter) const override
virtual Vector evaluateError(const Pose3 &x1, const Pose3 &x2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const
boost::shared_ptr< This > shared_ptr
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
Pose3 with translational velocity.
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
bool equals(const NonlinearFactor &e, double tol=1e-9) const override
Non-linear factor base classes.
EIGEN_DEVICE_FUNC SegmentReturnType head(Index n)
This is the const version of head(Index).
NoiseModelFactor2< POSE, POSE > Base
IMUFactor(const Vector6 &imu_vector, double dt, const Key &key1, const Key &key2, const SharedNoiseModel &model)
const Vector3 & accel() const
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel
IMUFactor(const Vector3 &accel, const Vector3 &gyro, double dt, const Key &key1, const Key &key2, const SharedNoiseModel &model)
time between measurements