23#include <gtsam/geometry/Unit3.h>
56 : Base(
noiseModel, a, b), measured_w_aZb_(w_aZb.point3()) {}
72 const Point3 dir = Tb - Ta;
73 Matrix33 H_predicted_dir;
75 normalize(dir, H1 || H2 ? &H_predicted_dir :
nullptr);
76 if (H1) *H1 = -H_predicted_dir;
77 if (H2) *H2 = H_predicted_dir;
78 return predicted - measured_w_aZb_;
82#if GTSAM_ENABLE_BOOST_SERIALIZATION
83 friend class boost::serialization::access;
84 template <
class ARCHIVE>
85 void serialize(ARCHIVE& ar,
const unsigned int ) {
86 ar& boost::serialization::make_nvp(
87 "Base", boost::serialization::base_object<Base>(*
this));
118 : Base(
noiseModel, a, b, scale_key), measured_w_aZb_(w_aZb.point3()) {}
139 const double abs_scale = std::abs(scale[0]);
140 const Point3 predicted = (Tb - Ta) * abs_scale;
142 *H1 = -Matrix3::Identity() * abs_scale;
145 *H2 = Matrix3::Identity() * abs_scale;
148 *H3 = scale[0] >= 0 ? (Tb - Ta) : (Ta - Tb);
150 return predicted - measured_w_aZb_;
154#if GTSAM_ENABLE_BOOST_SERIALIZATION
155 friend class boost::serialization::access;
156 template <
class ARCHIVE>
157 void serialize(ARCHIVE& ar,
const unsigned int ) {
158 ar& boost::serialization::make_nvp(
159 "Base", boost::serialization::base_object<Base>(*
this));
typedef and functions to augment Eigen's VectorXd
Base class for noise model factors with N variables.
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
Matrix * OptionalMatrixType
This typedef will be used everywhere boost::optional<Matrix&> reference was used previously.
Definition NonlinearFactor.h:57
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:846
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
All noise models live in the noiseModel namespace.
Definition LossFunctions.cpp:33
Represents a 3D point on a unit sphere.
Definition Unit3.h:44
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector3 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Vector3 evaluateError(const Point3 &Ta, const Point3 &Tb, OptionalMatrixType H1, OptionalMatrixType H2) const override
Calculate error: (norm(Tb - Ta) - measurement) where Tb and Ta are Point3 translations and measuremen...
Definition TranslationFactor.h:69
TranslationFactor()
default constructor
Definition TranslationFactor.h:52
BilinearAngleTranslationFactor()
default constructor
Definition TranslationFactor.h:113
Vector3 evaluateError(const Point3 &Ta, const Point3 &Tb, const Vector1 &scale, OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H3) const override
Calculate error: (scale * (Tb - Ta) - measurement) where Tb and Ta are Point3 translations and measur...
Definition TranslationFactor.h:134