59 measured_(measured), nM_(scale * direction), bias_(bias) {
63 NonlinearFactor::shared_ptr
clone()
const override {
64 return std::static_pointer_cast<NonlinearFactor>(
65 NonlinearFactor::shared_ptr(
new MagFactor(*
this)));
73 Matrix H = HR->col(2);
84 Point3 hx = unrotate(nRb, nM_, H) + bias_;
85 return (hx - measured_);
111 measured_(measured), nM_(scale * direction), bias_(bias) {
115 NonlinearFactor::shared_ptr
clone()
const override {
116 return std::static_pointer_cast<NonlinearFactor>(
117 NonlinearFactor::shared_ptr(
new MagFactor1(*
this)));
126 return (hx - measured_);
150 Base(model, key1, key2),
151 measured_(measured), bRn_(nRb.inverse()) {
155 NonlinearFactor::shared_ptr
clone()
const override {
156 return std::static_pointer_cast<NonlinearFactor>(
157 NonlinearFactor::shared_ptr(
new MagFactor2(*
this)));
172 return (hx - measured_);
197 Base(model, key1, key2, key3),
198 measured_(measured), bRn_(nRb.inverse()) {
202 NonlinearFactor::shared_ptr
clone()
const override {
203 return std::static_pointer_cast<NonlinearFactor>(
204 NonlinearFactor::shared_ptr(
new MagFactor3(*
this)));
224 *H2 = scale * H * (*H2);
228 return (hx - measured_);
Macros for Matrix constants to avoid excessive template instantiation.
3D rotation represented as a rotation matrix or quaternion
Base class for noise model factors with N variables.
Non-linear factor base classes.
#define OptionalNone
These typedefs and aliases will help with making the evaluateError interface independent of boost TOD...
Definition NonlinearFactor.h:51
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
NoiseModelFactorT< Vector, ValueTypes... > NoiseModelFactorN
Noise model factor with N value types and dynamic-sized error vector.
Definition NoiseModelFactorN.h:561
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
Rotation matrix NOTE: the angle theta is in radians unless explicitly stated.
Definition Rot2.h:40
Rot3 is a 3D rotation represented as a rotation matrix if the preprocessor symbol GTSAM_USE_QUATERNIO...
Definition Rot3.h:65
static Rot3 Yaw(double t)
Positive yaw is to right (as in aircraft heading). See ypr.
Definition Rot3.h:190
Point3 unrotate(const Point3 &p, OptionalJacobian< 3, 3 > H1={}, OptionalJacobian< 3, 3 > H2={}) const
rotate point from world to rotated frame
Definition Rot3.cpp:143
Represents a 3D point on a unit sphere.
Definition Unit3.h:44
Point3 point3(OptionalJacobian< 3, 2 > H={}) const
Return unit-norm Point3.
Definition Unit3.cpp:144
Vector evaluateError(const Rot2 &nRb, OptionalMatrixType H) const override
vector of errors
Definition MagFactor.h:82
NonlinearFactor::shared_ptr clone() const override
Definition MagFactor.h:63
MagFactor(Key key, const Point3 &measured, double scale, const Unit3 &direction, const Point3 &bias, const SharedNoiseModel &model)
Constructor of factor that estimates nav to body rotation bRn.
Definition MagFactor.h:55
MagFactor1(Key key, const Point3 &measured, double scale, const Unit3 &direction, const Point3 &bias, const SharedNoiseModel &model)
Constructor.
Definition MagFactor.h:107
Vector evaluateError(const Rot3 &nRb, OptionalMatrixType H) const override
vector of errors
Definition MagFactor.h:123
NonlinearFactor::shared_ptr clone() const override
Definition MagFactor.h:115
NonlinearFactor::shared_ptr clone() const override
Definition MagFactor.h:155
MagFactor2(Key key1, Key key2, const Point3 &measured, const Rot3 &nRb, const SharedNoiseModel &model)
Constructor.
Definition MagFactor.h:148
Vector3 evaluateError(const Point3 &nM, const Point3 &bias, OptionalMatrixType H1, OptionalMatrixType H2) const override
vector of errors
Definition MagFactor.h:165
Vector3 evaluateError(const double &scale, const Unit3 &direction, const Point3 &bias, OptionalMatrixType H1, OptionalMatrixType H2, OptionalMatrixType H3) const override
vector of errors
Definition MagFactor.h:212
MagFactor3(Key key1, Key key2, Key key3, const Point3 &measured, const Rot3 &nRb, const SharedNoiseModel &model)
Constructor.
Definition MagFactor.h:195
NonlinearFactor::shared_ptr clone() const override
Definition MagFactor.h:202
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector3 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Key key() const
Definition NoiseModelFactorN.h:307