45 boost::optional<Matrix&> H1 = boost::none,
46 boost::optional<Matrix&> H2 = boost::none,
47 boost::optional<Matrix&> H3 = boost::none)
const override {
52 Matrix6 D_gkxi_gk, D_gkxi_exphxi;
53 Pose3 gkxi = gk.
compose(exphxi, D_gkxi_gk, H3 ? &D_gkxi_exphxi : 0);
55 Matrix6 D_hx_gk1, D_hx_gkxi;
56 Pose3 hx = gkxi.
between(gk1, (H2 || H3) ? &D_hx_gkxi : 0, H1 ? &D_hx_gk1 : 0);
61 if (H1) *H1 = D_log_hx * D_hx_gk1;
63 Matrix6 D_log_gkxi = D_log_hx * D_hx_gkxi;
64 if (H2) *H2 = D_log_gkxi * D_gkxi_gk;
65 if (H3) *H3 = D_log_gkxi * D_gkxi_exphxi * D_exphxi_xi *
h_;
96 h_(h), Inertia_(Inertia), Fu_(Fu), m_(m) {
111 boost::optional<Matrix&> H1 = boost::none,
112 boost::optional<Matrix&> H2 = boost::none,
113 boost::optional<Matrix&> H3 = boost::none)
const override {
115 Vector muk = Inertia_*xik;
116 Vector muk_1 = Inertia_*xik_1;
122 Matrix D_adjThxik_muk, D_adjThxik1_muk1;
128 Vector f_ext = (
Vector(6) << 0.0, 0.0, 0.0, gravityBody.x(), gravityBody.y(), gravityBody.z()).finished();
130 Vector hx = pk - pk_1 - h_*Fu_ - h_*f_ext;
144 insertSub(*H3, -h_*D_gravityBody_gk, 3, 0);
151 Vector computeError(
const Vector6& xik,
const Vector6& xik_1,
const Pose3& gk)
const {
152 Vector pk = Pose3::dExpInv_exp(h_*xik).transpose()*Inertia_*xik;
153 Vector pk_1 = Pose3::dExpInv_exp(-h_*xik_1).transpose()*Inertia_*xik_1;
156 Vector f_ext = (
Vector(6) << 0.0, 0.0, 0.0, gravityBody.x(), gravityBody.y(), gravityBody.z());
158 Vector hx = pk - pk_1 - h_*Fu_ - h_*f_ext;
164 boost::optional<Matrix&> H1 = boost::none,
165 boost::optional<Matrix&> H2 = boost::none,
166 boost::optional<Matrix&> H3 = boost::none)
const {
169 boost::function<
Vector(
const Vector6&,
const Vector6&,
const Pose3&)>(
170 boost::bind(&DiscreteEulerPoincareHelicopter::computeError, *
this, _1, _2, _3)
177 boost::function<
Vector(
const Vector6&,
const Vector6&,
const Pose3&)>(
178 boost::bind(&DiscreteEulerPoincareHelicopter::computeError, *
this, _1, _2, _3)
185 boost::function<
Vector(
const Vector6&,
const Vector6&,
const Pose3&)>(
186 boost::bind(&DiscreteEulerPoincareHelicopter::computeError, *
this, _1, _2, _3)
192 return computeError(xik, xik_1, gk);
Reconstruction(Key gKey1, Key gKey, Key xiKey, double h, double mu=1000.0)
NoiseModelFactor3< Pose3, Pose3, Vector6 > Base
double error(const Values &c) const override
static Matrix6 adjointMap(const Vector6 &xi)
FIXME Not tested - marked as incorrect.
gtsam::NonlinearFactor::shared_ptr clone() const override
Point3 unrotate(const Point3 &p, OptionalJacobian< 3, 3 > H1=boost::none, OptionalJacobian< 3, 3 > H2=boost::none) const
rotate point from world to rotated frame
internal::FixedSizeMatrix< Y, X3 >::type numericalDerivative33(boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
Some functions to compute numerical derivatives.
internal::FixedSizeMatrix< Y, X1 >::type numericalDerivative31(boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
~DiscreteEulerPoincareHelicopter() override
const SharedNoiseModel & noiseModel() const
access to the noise model
return a deep copy of this factor gtsam::NonlinearFactor::shared_ptr clone() const override
static Vector6 adjointTranspose(const Vector6 &xi, const Vector6 &y, OptionalJacobian< 6, 6 > Hxi=boost::none)
internal::FixedSizeMatrix< Y, X2 >::type numericalDerivative32(boost::function< Y(const X1 &, const X2 &, const X3 &)> h, const X1 &x1, const X2 &x2, const X3 &x3, double delta=1e-5)
Class compose(const Class &g) const
Vector evaluateError(const Vector6 &xik, const Vector6 &xik_1, const Pose3 &gk, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none) const override
boost::shared_ptr< This > shared_ptr
Array< double, 1, 3 > e(1./3., 0.5, 2.)
static Vector6 Logmap(const Pose3 &pose, OptionalJacobian< 6, 6 > Hpose=boost::none)
Log map at identity - return the canonical coordinates of this rotation.
Vector Fu_
Inertia tensors Inertia = [ J 0; 0 M ].
Non-linear factor base classes.
void insertSub(Eigen::MatrixBase< Derived1 > &fullMatrix, const Eigen::MatrixBase< Derived2 > &subMatrix, size_t i, size_t j)
Class between(const Class &g) const
~Reconstruction() override
virtual Vector evaluateError(const X1 &, const X2 &, const X3 &, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none) const =0
DiscreteEulerPoincareHelicopter(Key xiKey1, Key xiKey_1, Key gKey, double h, const Matrix &Inertia, const Vector &Fu, double m, double mu=1000.0)
NoiseModelFactor3< Vector6, Vector6, Pose3 > Base
mass. For gravity external force f_ext, which has a fixed formula in this case.
static Pose3 Expmap(const Vector6 &xi, OptionalJacobian< 6, 6 > Hxi=boost::none)
Exponential map at identity - create a rotation from canonical coordinates .
std::uint64_t Key
Integer nonlinear key type.
const Rot3 & rotation(OptionalJacobian< 3, 6 > Hself=boost::none) const
get rotation