34 typedef boost::shared_ptr<This> shared_ptr;
44 Base(model, i, j), measured_(measured) {
49 boost::optional<Matrix&> H1 = boost::none, boost::optional<Matrix&> H2 =
50 boost::none)
const override {
63 typedef boost::shared_ptr<This> shared_ptr;
73 Base(model, b1, i, b2, j), measured_(measured) {
79 boost::optional<Matrix&> H1 = boost::none,
80 boost::optional<Matrix&> H2 = boost::none,
81 boost::optional<Matrix&> H3 = boost::none,
82 boost::optional<Matrix&> H4 = boost::none)
const override {
83 if (H1 || H2 || H3 || H4) {
85 Matrix D_pose_g_base1, D_pose_g_pose;
86 Pose2 pose_g = base1.compose(pose, D_pose_g_base1, D_pose_g_pose);
87 Matrix D_point_g_base2, D_point_g_point;
90 Matrix D_e_pose_g, D_e_point_g;
93 *H1 = D_e_pose_g * D_pose_g_base1;
95 *H2 = D_e_pose_g * D_pose_g_pose;
97 *H3 = D_e_point_g * D_point_g_base2;
99 *H4 = D_e_point_g * D_point_g_point;
100 return d - measured_;
102 Pose2 pose_g = base1.compose(pose);
105 return d - measured_;
118 typedef boost::shared_ptr<This> shared_ptr;
128 Base(model, b1, i, b2, j), measured_(measured) {
134 boost::optional<Matrix&> H1 = boost::none,
135 boost::optional<Matrix&> H2 = boost::none,
136 boost::optional<Matrix&> H3 = boost::none,
137 boost::optional<Matrix&> H4 = boost::none)
const override {
138 if (H1 || H2 || H3 || H4) {
140 Matrix D_pose1_g_base1, D_pose1_g_pose1;
141 Pose2 pose1_g = base1.compose(pose1, D_pose1_g_base1, D_pose1_g_pose1);
142 Matrix D_pose2_g_base2, D_pose2_g_pose2;
143 Pose2 pose2_g = base2.compose(pose2, D_pose2_g_base2, D_pose2_g_pose2);
144 Matrix D_e_pose1_g, D_e_pose2_g;
145 Pose2 d = pose1_g.between(pose2_g, D_e_pose1_g, D_e_pose2_g);
147 *H1 = D_e_pose1_g * D_pose1_g_base1;
149 *H2 = D_e_pose1_g * D_pose1_g_pose1;
151 *H3 = D_e_pose2_g * D_pose2_g_base2;
153 *H4 = D_e_pose2_g * D_pose2_g_pose2;
156 Pose2 pose1_g = base1.compose(pose1);
157 Pose2 pose2_g = base2.compose(pose2);
158 Pose2 d = pose1_g.between(pose2_g);
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Vector2 Point2
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point2 to Vector2...
Definition: Point2.h:27
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:736
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
TangentVector localCoordinates(const Class &g) const
localCoordinates as required by manifold concept: finds tangent vector between *this and g
Definition: Lie.h:136
GTSAM_EXPORT Point2 transformTo(const Point2 &point, OptionalJacobian< 2, 3 > Dpose=boost::none, OptionalJacobian< 2, 2 > Dpoint=boost::none) const
Return point coordinates in pose coordinate frame.
Definition: Pose2.cpp:207
GTSAM_EXPORT Point2 transformFrom(const Point2 &point, OptionalJacobian< 2, 3 > Dpose=boost::none, OptionalJacobian< 2, 2 > Dpoint=boost::none) const
Return point coordinates in global frame.
Definition: Pose2.cpp:218
This is the base class for all factor types.
Definition: Factor.h:56
A convenient base class for creating your own NoiseModelFactor with 2 variables.
Definition: NonlinearFactor.h:369
A convenient base class for creating your own NoiseModelFactor with 4 variables.
Definition: NonlinearFactor.h:521
DeltaFactor: relative 2D measurement between Pose2 and Point2.
Definition: TSAMFactors.h:29
DeltaFactor(Key i, Key j, const Point2 &measured, const SharedNoiseModel &model)
Constructor.
Definition: TSAMFactors.h:42
Vector evaluateError(const Pose2 &pose, const Point2 &point, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const override
Evaluate measurement error h(x)-z.
Definition: TSAMFactors.h:48
DeltaFactorBase: relative 2D measurement between Pose2 and Point2, with Basenodes.
Definition: TSAMFactors.h:58
DeltaFactorBase(Key b1, Key i, Key b2, Key j, const Point2 &measured, const SharedNoiseModel &model)
Constructor.
Definition: TSAMFactors.h:71
Vector evaluateError(const Pose2 &base1, const Pose2 &pose, const Pose2 &base2, const Point2 &point, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none, boost::optional< Matrix & > H4=boost::none) const override
Evaluate measurement error h(x)-z.
Definition: TSAMFactors.h:77
OdometryFactorBase: Pose2 odometry, with Basenodes.
Definition: TSAMFactors.h:113
Vector evaluateError(const Pose2 &base1, const Pose2 &pose1, const Pose2 &base2, const Pose2 &pose2, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none, boost::optional< Matrix & > H4=boost::none) const override
Evaluate measurement error h(x)-z.
Definition: TSAMFactors.h:132
OdometryFactorBase(Key b1, Key i, Key b2, Key j, const Pose2 &measured, const SharedNoiseModel &model)
Constructor.
Definition: TSAMFactors.h:126