gtsam 4.1.1
gtsam
BasisFactors.h
Go to the documentation of this file.
1/* ----------------------------------------------------------------------------
2
3 * GTSAM Copyright 2010, Georgia Tech Research Corporation,
4 * Atlanta, Georgia 30332-0415
5 * All Rights Reserved
6 * Authors: Frank Dellaert, et al. (see THANKS for the full author list)
7
8 * See LICENSE for the license information
9
10 * -------------------------------------------------------------------------- */
11
19#pragma once
20
21#include <gtsam/basis/Basis.h>
23
24namespace gtsam {
25
33template <class BASIS>
34class GTSAM_EXPORT EvaluationFactor : public FunctorizedFactor<double, Vector> {
35 private:
37
38 public:
40
50 EvaluationFactor(Key key, const double &z, const SharedNoiseModel &model,
51 const size_t N, double x)
52 : Base(key, z, model, typename BASIS::EvaluationFunctor(N, x)) {}
53
65 EvaluationFactor(Key key, const double &z, const SharedNoiseModel &model,
66 const size_t N, double x, double a, double b)
67 : Base(key, z, model, typename BASIS::EvaluationFunctor(N, x, a, b)) {}
68
69 virtual ~EvaluationFactor() {}
70};
71
87template <class BASIS, int M>
88class GTSAM_EXPORT VectorEvaluationFactor
89 : public FunctorizedFactor<Vector, ParameterMatrix<M>> {
90 private:
92
93 public:
95
106 VectorEvaluationFactor(Key key, const Vector &z,
107 const SharedNoiseModel &model, const size_t N,
108 double x)
109 : Base(key, z, model,
110 typename BASIS::template VectorEvaluationFunctor<M>(N, x)) {}
111
124 VectorEvaluationFactor(Key key, const Vector &z,
125 const SharedNoiseModel &model, const size_t N,
126 double x, double a, double b)
127 : Base(key, z, model,
128 typename BASIS::template VectorEvaluationFunctor<M>(N, x, a, b)) {}
129
130 virtual ~VectorEvaluationFactor() {}
131};
132
150template <class BASIS, size_t P>
151class GTSAM_EXPORT VectorComponentFactor
152 : public FunctorizedFactor<double, ParameterMatrix<P>> {
153 private:
155
156 public:
158
172 VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model,
173 const size_t N, size_t i, double x)
174 : Base(key, z, model,
175 typename BASIS::template VectorComponentFunctor<P>(N, i, x)) {}
176
192 VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model,
193 const size_t N, size_t i, double x, double a, double b)
194 : Base(
195 key, z, model,
196 typename BASIS::template VectorComponentFunctor<P>(N, i, x, a, b)) {
197 }
198
199 virtual ~VectorComponentFactor() {}
200};
201
219template <class BASIS, typename T>
220class GTSAM_EXPORT ManifoldEvaluationFactor
221 : public FunctorizedFactor<T, ParameterMatrix<traits<T>::dimension>> {
222 private:
224
225 public:
227
238 ManifoldEvaluationFactor(Key key, const T &z, const SharedNoiseModel &model,
239 const size_t N, double x)
240 : Base(key, z, model,
241 typename BASIS::template ManifoldEvaluationFunctor<T>(N, x)) {}
242
255 ManifoldEvaluationFactor(Key key, const T &z, const SharedNoiseModel &model,
256 const size_t N, double x, double a, double b)
257 : Base(
258 key, z, model,
259 typename BASIS::template ManifoldEvaluationFunctor<T>(N, x, a, b)) {
260 }
261
262 virtual ~ManifoldEvaluationFactor() {}
263};
264
271template <class BASIS>
272class GTSAM_EXPORT DerivativeFactor
273 : public FunctorizedFactor<double, typename BASIS::Parameters> {
274 private:
276
277 public:
279
290 DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model,
291 const size_t N, double x)
292 : Base(key, z, model, typename BASIS::DerivativeFunctor(N, x)) {}
293
306 DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model,
307 const size_t N, double x, double a, double b)
308 : Base(key, z, model, typename BASIS::DerivativeFunctor(N, x, a, b)) {}
309
310 virtual ~DerivativeFactor() {}
311};
312
320template <class BASIS, int M>
321class GTSAM_EXPORT VectorDerivativeFactor
322 : public FunctorizedFactor<Vector, ParameterMatrix<M>> {
323 private:
325 using Func = typename BASIS::template VectorDerivativeFunctor<M>;
326
327 public:
329
340 VectorDerivativeFactor(Key key, const Vector &z,
341 const SharedNoiseModel &model, const size_t N,
342 double x)
343 : Base(key, z, model, Func(N, x)) {}
344
357 VectorDerivativeFactor(Key key, const Vector &z,
358 const SharedNoiseModel &model, const size_t N,
359 double x, double a, double b)
360 : Base(key, z, model, Func(N, x, a, b)) {}
361
362 virtual ~VectorDerivativeFactor() {}
363};
364
373template <class BASIS, int P>
375 : public FunctorizedFactor<double, ParameterMatrix<P>> {
376 private:
378 using Func = typename BASIS::template ComponentDerivativeFunctor<P>;
379
380 public:
382
396 ComponentDerivativeFactor(Key key, const double &z,
397 const SharedNoiseModel &model, const size_t N,
398 size_t i, double x)
399 : Base(key, z, model, Func(N, i, x)) {}
400
416 ComponentDerivativeFactor(Key key, const double &z,
417 const SharedNoiseModel &model, const size_t N,
418 size_t i, double x, double a, double b)
419 : Base(key, z, model, Func(N, i, x, a, b)) {}
420
421 virtual ~ComponentDerivativeFactor() {}
422};
423
424} // namespace gtsam
Compute an interpolating basis.
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:736
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
Factor for enforcing the scalar value of the polynomial BASIS representation at x is the same as the ...
Definition: BasisFactors.h:34
EvaluationFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new EvaluationFactor object.
Definition: BasisFactors.h:65
EvaluationFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new EvaluationFactor object.
Definition: BasisFactors.h:50
Unary factor for enforcing BASIS polynomial evaluation on a ParameterMatrix of size (M,...
Definition: BasisFactors.h:89
VectorEvaluationFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new VectorEvaluationFactor object.
Definition: BasisFactors.h:124
VectorEvaluationFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new VectorEvaluationFactor object.
Definition: BasisFactors.h:106
Unary factor for enforcing BASIS polynomial evaluation on a ParameterMatrix of size (P,...
Definition: BasisFactors.h:152
VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x, double a, double b)
Construct a new VectorComponentFactor object.
Definition: BasisFactors.h:192
VectorComponentFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x)
Construct a new VectorComponentFactor object.
Definition: BasisFactors.h:172
For a measurement value of type T i.e.
Definition: BasisFactors.h:221
ManifoldEvaluationFactor(Key key, const T &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new ManifoldEvaluationFactor object.
Definition: BasisFactors.h:255
ManifoldEvaluationFactor(Key key, const T &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new ManifoldEvaluationFactor object.
Definition: BasisFactors.h:238
A unary factor which enforces the evaluation of the derivative of a BASIS polynomial at a specified p...
Definition: BasisFactors.h:273
DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new DerivativeFactor object.
Definition: BasisFactors.h:306
DerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new DerivativeFactor object.
Definition: BasisFactors.h:290
A unary factor which enforces the evaluation of the derivative of a BASIS polynomial at a specified p...
Definition: BasisFactors.h:322
VectorDerivativeFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x)
Construct a new VectorDerivativeFactor object.
Definition: BasisFactors.h:340
VectorDerivativeFactor(Key key, const Vector &z, const SharedNoiseModel &model, const size_t N, double x, double a, double b)
Construct a new VectorDerivativeFactor object.
Definition: BasisFactors.h:357
A unary factor which enforces the evaluation of the derivative of a BASIS polynomial is equal to the ...
Definition: BasisFactors.h:375
ComponentDerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x, double a, double b)
Construct a new ComponentDerivativeFactor object.
Definition: BasisFactors.h:416
ComponentDerivativeFactor(Key key, const double &z, const SharedNoiseModel &model, const size_t N, size_t i, double x)
Construct a new ComponentDerivativeFactor object.
Definition: BasisFactors.h:396
Factor which evaluates provided unary functor and uses the result to compute error with respect to th...
Definition: FunctorizedFactor.h:59