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 =
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 {
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 {
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);
This is the base class for all factor types.
Definition: Factor.h:54
A convenient base class for creating your own NoiseModelFactor with 2 variables.
Definition: NonlinearFactor.h:345
Vector evaluateError(const Pose2 &pose, const Point2 &point, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const
Evaluate measurement error h(x)-z.
Definition: TSAMFactors.h:48
DeltaFactor(Key i, Key j, const Point2 &measured, const SharedNoiseModel &model)
Constructor.
Definition: TSAMFactors.h:42
OdometryFactorBase(Key b1, Key i, Key b2, Key j, const Pose2 &measured, const SharedNoiseModel &model)
Constructor.
Definition: TSAMFactors.h:126
DeltaFactorBase: relative 2D measurement between Pose2 and Point2, with Basenodes.
Definition: TSAMFactors.h:58
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
A convenient base class for creating your own NoiseModelFactor with 4 variables.
Definition: NonlinearFactor.h:497
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
Evaluate measurement error h(x)-z.
Definition: TSAMFactors.h:77
DeltaFactor: relative 2D measurement between Pose2 and Point2.
Definition: TSAMFactors.h:29
Non-linear factor base classes.
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:212
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:201
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
Evaluate measurement error h(x)-z.
Definition: TSAMFactors.h:132
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:1072
TangentVector localCoordinates(const Class &g) const
localCoordinates as required by manifold concept: finds tangent vector between *this and g
Definition: Lie.h:138