39 : Base(model, key1, key2), accel_(accel), gyro_(gyro), dt_(dt) {
40 assert(model->dim() == 9);
46 : Base(model, key1, key2), accel_(imu.
head(3)), gyro_(imu.
tail(3)), dt_(dt) {
47 assert(imu.size() == 6);
48 assert(model->dim() == 9);
60 const This*
const f =
dynamic_cast<const This*
>(&
e);
68 std::string
a =
"FullIMUFactor: " +
s;
72 std::cout <<
"dt: " << dt_ << std::endl;
78 Vector6
z()
const {
return (
Vector(6) << accel_, gyro_).finished(); }
85 boost::optional<Matrix&> H1 = boost::none,
86 boost::optional<Matrix&> H2 = boost::none)
const override {
88 z.head(3).operator=(
accel_);
89 z.segment(3, 3).operator=(
gyro_);
90 z.tail(3).operator=(x2.
t());
91 if (H1) *H1 = numericalDerivative21<Vector9, PoseRTV, PoseRTV>(
93 if (H2) *H2 = numericalDerivative22<Vector9, PoseRTV, PoseRTV>(
100 boost::optional<Matrix&> H1 = boost::none,
101 boost::optional<Matrix&> H2 = boost::none)
const {
103 return Vector6::Zero();
void print(const Matrix &A, const string &s, ostream &stream)
gtsam::NonlinearFactor::shared_ptr clone() const override
bool equals(const NonlinearFactor &f, double tol=1e-9) const override
bool equals(const NonlinearFactor &e, double tol=1e-9) const override
noiseModel::Diagonal::shared_ptr model
EIGEN_DEVICE_FUNC SegmentReturnType tail(Index n)
This is the const version of tail(Index).
~FullIMUFactor() 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)
FullIMUFactor< POSE > This
const Vector3 & accel() const
static const KeyFormatter DefaultKeyFormatter
const KeyFormatter & formatter
const Vector3 & gyro() const
virtual Vector evaluateError(const Pose3 &x1, const Pose3 &x2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const
Point3 translationIntegration(const Rot3 &r2, const Velocity3 &v2, double dt) const
boost::shared_ptr< This > shared_ptr
void print(const std::string &s="", const gtsam::KeyFormatter &formatter=gtsam::DefaultKeyFormatter) const override
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.
NoiseModelFactor2< POSE, POSE > Base
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Non-linear factor base classes.
EIGEN_DEVICE_FUNC SegmentReturnType head(Index n)
This is the const version of head(Index).
static Vector9 predict_proxy(const PoseRTV &x1, const PoseRTV &x2, double dt)
FullIMUFactor(const Vector6 &imu, double dt, const Key &key1, const Key &key2, const SharedNoiseModel &model)
Vector evaluateError(const PoseRTV &x1, const PoseRTV &x2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
FullIMUFactor(const Vector3 &accel, const Vector3 &gyro, double dt, const Key &key1, const Key &key2, const SharedNoiseModel &model)
time between measurements
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel