40 : Base(model, key1, key2), accel_(accel), gyro_(gyro), dt_(dt) {}
45 : Base(model, key1, key2), accel_(imu_vector.
head(3)), gyro_(imu_vector.
tail(3)), dt_(dt) {}
56 const This*
const f =
dynamic_cast<const This*
>(&
e);
64 std::string
a =
"IMUFactor: " +
s;
68 std::cout <<
"dt: " << dt_ << std::endl;
74 Vector6
z()
const {
return (Vector6() << accel_, gyro_).finished(); }
82 const Vector6 meas =
z();
83 if (H1) *H1 = numericalDerivative21<Vector6, PoseRTV, PoseRTV>(
85 if (H2) *H2 = numericalDerivative22<Vector6, PoseRTV, PoseRTV>(
94 return Vector6::Zero();
100 double dt,
const Vector6& meas) {
void print(const Matrix &A, const string &s, ostream &stream)
noiseModel::Diagonal::shared_ptr model
static Vector6 predict_proxy(const PoseRTV &x1, const PoseRTV &x2, double dt, const Vector6 &meas)
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
gtsam::NonlinearFactor::shared_ptr clone() const override
virtual Vector evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE FixedSegmentReturnType< internal::get_fixed_value< NType >::value >::Type tail(NType n)
Some functions to compute numerical derivatives.
Pose3 x2(Rot3::Ypr(0.0, 0.0, 0.0), l2)
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
const Vector3 & gyro() const
Matrix * OptionalMatrixType
void print(const std::string &s="", const gtsam::KeyFormatter &formatter=gtsam::DefaultKeyFormatter) const override
Point2(* f)(const Point3 &, OptionalJacobian< 2, 3 >)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
bool equal_with_abs_tol(const Eigen::DenseBase< MATRIX > &A, const Eigen::DenseBase< MATRIX > &B, double tol=1e-9)
Pose3 with translational velocity.
const Vector3 & accel() const
virtual Vector evaluateError(const Pose3 &x1, const Pose3 &x2, OptionalMatrixType H1, OptionalMatrixType H2) const
bool equals(const NonlinearFactor &e, double tol=1e-9) const override
Non-linear factor base classes.
Vector evaluateError(const PoseRTV &x1, const PoseRTV &x2, OptionalMatrixType H1, OptionalMatrixType H2) const override
EIGEN_DEVICE_FUNC EIGEN_STRONG_INLINE FixedSegmentReturnType< internal::get_fixed_value< NType >::value >::Type head(NType n)
std::shared_ptr< This > shared_ptr
NoiseModelFactorN< POSE, POSE > Base
IMUFactor(const Vector6 &imu_vector, double dt, const Key &key1, const Key &key2, const SharedNoiseModel &model)
Vector6 imuPrediction(const PoseRTV &x2, double dt) 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)