gtsam  4.0.0
gtsam
NonlinearFactor.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 // \callgraph
20 
21 #pragma once
22 
23 #include <gtsam/nonlinear/Values.h>
26 #include <gtsam/inference/Factor.h>
28 
29 #include <boost/serialization/base_object.hpp>
30 #include <boost/assign/list_of.hpp>
31 
32 #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V4
33 #define ADD_CLONE_NONLINEAR_FACTOR(Derived) \
34  virtual gtsam::NonlinearFactor::shared_ptr clone() const { \
35  return boost::static_pointer_cast<gtsam::NonlinearFactor>( \
36  gtsam::NonlinearFactor::shared_ptr(new Derived(*this))); }
37 #endif
38 
39 namespace gtsam {
40 
41 using boost::assign::cref_list_of;
42 
43 /* ************************************************************************* */
44 
50 class GTSAM_EXPORT NonlinearFactor: public Factor {
51 
52 protected:
53 
54  // Some handy typedefs
55  typedef Factor Base;
56  typedef NonlinearFactor This;
57 
58 public:
59 
60  typedef boost::shared_ptr<This> shared_ptr;
61 
64 
67 
71  template<typename CONTAINER>
72  NonlinearFactor(const CONTAINER& keys) :
73  Base(keys) {}
74 
78 
80  virtual void print(const std::string& s = "",
81  const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
82 
84  virtual bool equals(const NonlinearFactor& f, double tol = 1e-9) const;
88 
90  virtual ~NonlinearFactor() {}
91 
92 
98  virtual double error(const Values& c) const = 0;
99 
101  virtual size_t dim() const = 0;
102 
113  virtual bool active(const Values& /*c*/) const { return true; }
114 
116  virtual boost::shared_ptr<GaussianFactor>
117  linearize(const Values& c) const = 0;
118 
125  virtual shared_ptr clone() const {
126  // TODO: choose better exception to throw here
127  throw std::runtime_error("NonlinearFactor::clone(): Attempting to clone factor with no clone() implemented!");
128  return shared_ptr();
129  }
130 
136  shared_ptr rekey(const std::map<Key,Key>& rekey_mapping) const;
137 
142  shared_ptr rekey(const KeyVector& new_keys) const;
143 
144 }; // \class NonlinearFactor
145 
147 template<> struct traits<NonlinearFactor> : public Testable<NonlinearFactor> {
148 };
149 
150 /* ************************************************************************* */
161 class GTSAM_EXPORT NoiseModelFactor: public NonlinearFactor {
162 
163 protected:
164 
165  // handy typedefs
166  typedef NonlinearFactor Base;
167  typedef NoiseModelFactor This;
168 
169  SharedNoiseModel noiseModel_;
171 public:
172 
173  typedef boost::shared_ptr<This> shared_ptr;
174 
177 
179  virtual ~NoiseModelFactor() {}
180 
184  template<typename CONTAINER>
185  NoiseModelFactor(const SharedNoiseModel& noiseModel, const CONTAINER& keys) :
186  Base(keys), noiseModel_(noiseModel) {}
187 
188 protected:
189 
193  NoiseModelFactor(const SharedNoiseModel& noiseModel) : noiseModel_(noiseModel) {}
194 
195 public:
196 
198  virtual void print(const std::string& s = "",
199  const KeyFormatter& keyFormatter = DefaultKeyFormatter) const;
200 
202  virtual bool equals(const NonlinearFactor& f, double tol = 1e-9) const;
203 
205  virtual size_t dim() const {
206  return noiseModel_->dim();
207  }
208 
210  const SharedNoiseModel& noiseModel() const {
211  return noiseModel_;
212  }
213 
220  virtual Vector unwhitenedError(const Values& x,
221  boost::optional<std::vector<Matrix>&> H = boost::none) const = 0;
222 
227  Vector whitenedError(const Values& c) const;
228 
235  virtual double error(const Values& c) const;
236 
242  boost::shared_ptr<GaussianFactor> linearize(const Values& x) const;
243 
244 #ifdef GTSAM_ALLOW_DEPRECATED_SINCE_V4
245  SharedNoiseModel get_noiseModel() const { return noiseModel_; }
249 #endif
250 
251 private:
252 
254  friend class boost::serialization::access;
255  template<class ARCHIVE>
256  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
257  ar & boost::serialization::make_nvp("NonlinearFactor",
258  boost::serialization::base_object<Base>(*this));
259  ar & BOOST_SERIALIZATION_NVP(noiseModel_);
260  }
261 
262 }; // \class NoiseModelFactor
263 
264 
265 /* ************************************************************************* */
266 
275 template<class VALUE>
277 
278 public:
279 
280  // typedefs for value types pulled from keys
281  typedef VALUE X;
282 
283 protected:
284 
285  typedef NoiseModelFactor Base;
287 
288 public:
289 
292 
293  virtual ~NoiseModelFactor1() {}
294 
295  inline Key key() const { return keys_[0]; }
296 
303  Base(noiseModel, cref_list_of<1>(key1)) {}
304 
308  virtual Vector unwhitenedError(const Values& x, boost::optional<std::vector<Matrix>&> H = boost::none) const {
309  if(this->active(x)) {
310  const X& x1 = x.at<X>(keys_[0]);
311  if(H) {
312  return evaluateError(x1, (*H)[0]);
313  } else {
314  return evaluateError(x1);
315  }
316  } else {
317  return Vector::Zero(this->dim());
318  }
319  }
320 
326  virtual Vector evaluateError(const X& x, boost::optional<Matrix&> H =
327  boost::none) const = 0;
328 
329 private:
330 
332  friend class boost::serialization::access;
333  template<class ARCHIVE>
334  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
335  ar & boost::serialization::make_nvp("NoiseModelFactor",
336  boost::serialization::base_object<Base>(*this));
337  }
338 };// \class NoiseModelFactor1
339 
340 
341 /* ************************************************************************* */
344 template<class VALUE1, class VALUE2>
346 
347 public:
348 
349  // typedefs for value types pulled from keys
350  typedef VALUE1 X1;
351  typedef VALUE2 X2;
352 
353 protected:
354 
355  typedef NoiseModelFactor Base;
357 
358 public:
359 
364 
372  Base(noiseModel, cref_list_of<2>(j1)(j2)) {}
373 
374  virtual ~NoiseModelFactor2() {}
375 
377  inline Key key1() const { return keys_[0]; }
378  inline Key key2() const { return keys_[1]; }
379 
382  virtual Vector unwhitenedError(const Values& x, boost::optional<std::vector<Matrix>&> H = boost::none) const {
383  if(this->active(x)) {
384  const X1& x1 = x.at<X1>(keys_[0]);
385  const X2& x2 = x.at<X2>(keys_[1]);
386  if(H) {
387  return evaluateError(x1, x2, (*H)[0], (*H)[1]);
388  } else {
389  return evaluateError(x1, x2);
390  }
391  } else {
392  return Vector::Zero(this->dim());
393  }
394  }
395 
401  virtual Vector
402  evaluateError(const X1&, const X2&, boost::optional<Matrix&> H1 =
403  boost::none, boost::optional<Matrix&> H2 = boost::none) const = 0;
404 
405 private:
406 
408  friend class boost::serialization::access;
409  template<class ARCHIVE>
410  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
411  ar & boost::serialization::make_nvp("NoiseModelFactor",
412  boost::serialization::base_object<Base>(*this));
413  }
414 }; // \class NoiseModelFactor2
415 
416 /* ************************************************************************* */
419 template<class VALUE1, class VALUE2, class VALUE3>
421 
422 public:
423 
424  // typedefs for value types pulled from keys
425  typedef VALUE1 X1;
426  typedef VALUE2 X2;
427  typedef VALUE3 X3;
428 
429 protected:
430 
431  typedef NoiseModelFactor Base;
433 
434 public:
435 
440 
449  Base(noiseModel, cref_list_of<3>(j1)(j2)(j3)) {}
450 
451  virtual ~NoiseModelFactor3() {}
452 
454  inline Key key1() const { return keys_[0]; }
455  inline Key key2() const { return keys_[1]; }
456  inline Key key3() const { return keys_[2]; }
457 
460  virtual Vector unwhitenedError(const Values& x, boost::optional<std::vector<Matrix>&> H = boost::none) const {
461  if(this->active(x)) {
462  if(H)
463  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]), (*H)[0], (*H)[1], (*H)[2]);
464  else
465  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]));
466  } else {
467  return Vector::Zero(this->dim());
468  }
469  }
470 
476  virtual Vector
477  evaluateError(const X1&, const X2&, const X3&,
478  boost::optional<Matrix&> H1 = boost::none,
479  boost::optional<Matrix&> H2 = boost::none,
480  boost::optional<Matrix&> H3 = boost::none) const = 0;
481 
482 private:
483 
485  friend class boost::serialization::access;
486  template<class ARCHIVE>
487  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
488  ar & boost::serialization::make_nvp("NoiseModelFactor",
489  boost::serialization::base_object<Base>(*this));
490  }
491 }; // \class NoiseModelFactor3
492 
493 /* ************************************************************************* */
496 template<class VALUE1, class VALUE2, class VALUE3, class VALUE4>
498 
499 public:
500 
501  // typedefs for value types pulled from keys
502  typedef VALUE1 X1;
503  typedef VALUE2 X2;
504  typedef VALUE3 X3;
505  typedef VALUE4 X4;
506 
507 protected:
508 
509  typedef NoiseModelFactor Base;
511 
512 public:
513 
518 
528  Base(noiseModel, cref_list_of<4>(j1)(j2)(j3)(j4)) {}
529 
530  virtual ~NoiseModelFactor4() {}
531 
533  inline Key key1() const { return keys_[0]; }
534  inline Key key2() const { return keys_[1]; }
535  inline Key key3() const { return keys_[2]; }
536  inline Key key4() const { return keys_[3]; }
537 
540  virtual Vector unwhitenedError(const Values& x, boost::optional<std::vector<Matrix>&> H = boost::none) const {
541  if(this->active(x)) {
542  if(H)
543  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]), x.at<X4>(keys_[3]), (*H)[0], (*H)[1], (*H)[2], (*H)[3]);
544  else
545  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]), x.at<X4>(keys_[3]));
546  } else {
547  return Vector::Zero(this->dim());
548  }
549  }
550 
556  virtual Vector
557  evaluateError(const X1&, const X2&, const X3&, const X4&,
558  boost::optional<Matrix&> H1 = boost::none,
559  boost::optional<Matrix&> H2 = boost::none,
560  boost::optional<Matrix&> H3 = boost::none,
561  boost::optional<Matrix&> H4 = boost::none) const = 0;
562 
563 private:
564 
566  friend class boost::serialization::access;
567  template<class ARCHIVE>
568  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
569  ar & boost::serialization::make_nvp("NoiseModelFactor",
570  boost::serialization::base_object<Base>(*this));
571  }
572 }; // \class NoiseModelFactor4
573 
574 /* ************************************************************************* */
577 template<class VALUE1, class VALUE2, class VALUE3, class VALUE4, class VALUE5>
579 
580 public:
581 
582  // typedefs for value types pulled from keys
583  typedef VALUE1 X1;
584  typedef VALUE2 X2;
585  typedef VALUE3 X3;
586  typedef VALUE4 X4;
587  typedef VALUE5 X5;
588 
589 protected:
590 
591  typedef NoiseModelFactor Base;
593 
594 public:
595 
600 
611  Base(noiseModel, cref_list_of<5>(j1)(j2)(j3)(j4)(j5)) {}
612 
613  virtual ~NoiseModelFactor5() {}
614 
616  inline Key key1() const { return keys_[0]; }
617  inline Key key2() const { return keys_[1]; }
618  inline Key key3() const { return keys_[2]; }
619  inline Key key4() const { return keys_[3]; }
620  inline Key key5() const { return keys_[4]; }
621 
624  virtual Vector unwhitenedError(const Values& x, boost::optional<std::vector<Matrix>&> H = boost::none) const {
625  if(this->active(x)) {
626  if(H)
627  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]), x.at<X4>(keys_[3]), x.at<X5>(keys_[4]), (*H)[0], (*H)[1], (*H)[2], (*H)[3], (*H)[4]);
628  else
629  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]), x.at<X4>(keys_[3]), x.at<X5>(keys_[4]));
630  } else {
631  return Vector::Zero(this->dim());
632  }
633  }
634 
640  virtual Vector
641  evaluateError(const X1&, const X2&, const X3&, const X4&, const X5&,
642  boost::optional<Matrix&> H1 = boost::none,
643  boost::optional<Matrix&> H2 = boost::none,
644  boost::optional<Matrix&> H3 = boost::none,
645  boost::optional<Matrix&> H4 = boost::none,
646  boost::optional<Matrix&> H5 = boost::none) const = 0;
647 
648 private:
649 
651  friend class boost::serialization::access;
652  template<class ARCHIVE>
653  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
654  ar & boost::serialization::make_nvp("NoiseModelFactor",
655  boost::serialization::base_object<Base>(*this));
656  }
657 }; // \class NoiseModelFactor5
658 
659 /* ************************************************************************* */
662 template<class VALUE1, class VALUE2, class VALUE3, class VALUE4, class VALUE5, class VALUE6>
664 
665 public:
666 
667  // typedefs for value types pulled from keys
668  typedef VALUE1 X1;
669  typedef VALUE2 X2;
670  typedef VALUE3 X3;
671  typedef VALUE4 X4;
672  typedef VALUE5 X5;
673  typedef VALUE6 X6;
674 
675 protected:
676 
677  typedef NoiseModelFactor Base;
679 
680 public:
681 
686 
697  NoiseModelFactor6(const SharedNoiseModel& noiseModel, Key j1, Key j2, Key j3, Key j4, Key j5, Key j6) :
698  Base(noiseModel, cref_list_of<6>(j1)(j2)(j3)(j4)(j5)(j6)) {}
699 
700  virtual ~NoiseModelFactor6() {}
701 
703  inline Key key1() const { return keys_[0]; }
704  inline Key key2() const { return keys_[1]; }
705  inline Key key3() const { return keys_[2]; }
706  inline Key key4() const { return keys_[3]; }
707  inline Key key5() const { return keys_[4]; }
708  inline Key key6() const { return keys_[5]; }
709 
712  virtual Vector unwhitenedError(const Values& x, boost::optional<std::vector<Matrix>&> H = boost::none) const {
713  if(this->active(x)) {
714  if(H)
715  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]), x.at<X4>(keys_[3]), x.at<X5>(keys_[4]), x.at<X6>(keys_[5]), (*H)[0], (*H)[1], (*H)[2], (*H)[3], (*H)[4], (*H)[5]);
716  else
717  return evaluateError(x.at<X1>(keys_[0]), x.at<X2>(keys_[1]), x.at<X3>(keys_[2]), x.at<X4>(keys_[3]), x.at<X5>(keys_[4]), x.at<X6>(keys_[5]));
718  } else {
719  return Vector::Zero(this->dim());
720  }
721  }
722 
728  virtual Vector
729  evaluateError(const X1&, const X2&, const X3&, const X4&, const X5&, const X6&,
730  boost::optional<Matrix&> H1 = boost::none,
731  boost::optional<Matrix&> H2 = boost::none,
732  boost::optional<Matrix&> H3 = boost::none,
733  boost::optional<Matrix&> H4 = boost::none,
734  boost::optional<Matrix&> H5 = boost::none,
735  boost::optional<Matrix&> H6 = boost::none) const = 0;
736 
737 private:
738 
740  friend class boost::serialization::access;
741  template<class ARCHIVE>
742  void serialize(ARCHIVE & ar, const unsigned int /*version*/) {
743  ar & boost::serialization::make_nvp("NoiseModelFactor",
744  boost::serialization::base_object<Base>(*this));
745  }
746 }; // \class NoiseModelFactor6
747 
748 /* ************************************************************************* */
749 
750 } // \namespace gtsam
virtual shared_ptr clone() const
Creates a shared_ptr clone of the factor - needs to be specialized to allow for subclasses.
Definition: NonlinearFactor.h:125
NoiseModelFactor3(const SharedNoiseModel &noiseModel, Key j1, Key j2, Key j3)
Constructor.
Definition: NonlinearFactor.h:448
This is the base class for all factor types.
Definition: Factor.h:54
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:70
A convenient base class for creating your own NoiseModelFactor with 2 variables.
Definition: NonlinearFactor.h:345
virtual Vector evaluateError(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none, boost::optional< Matrix & > H4=boost::none, boost::optional< Matrix & > H5=boost::none) const =0
Override this method to finish implementing a 5-way factor.
NoiseModelFactor3()
Default Constructor for I/O.
Definition: NonlinearFactor.h:439
virtual Vector unwhitenedError(const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const
Calls the 2-key specific version of evaluateError, which is pure virtual so must be implemented in th...
Definition: NonlinearFactor.h:382
ValueType at(Key j) const
Retrieve a variable by key j.
Definition: Values-inl.h:342
virtual Vector evaluateError(const X1 &, const X2 &, const X3 &, const X4 &, 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 =0
Override this method to finish implementing a 4-way factor.
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:141
Represents an infinite plane in 3D, which is composed of a planar normal and its perpendicular distan...
Definition: OrientedPlane3.h:35
NoiseModelFactor1(const SharedNoiseModel &noiseModel, Key key1)
Constructor.
Definition: NonlinearFactor.h:302
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:57
boost::shared_ptr< This > shared_ptr
Noise model.
Definition: NonlinearFactor.h:173
Template to create a binary predicate.
Definition: Testable.h:110
NoiseModelFactor4(const SharedNoiseModel &noiseModel, Key j1, Key j2, Key j3, Key j4)
Constructor.
Definition: NonlinearFactor.h:527
A helper that implements the traits interface for GTSAM types.
Definition: Testable.h:150
virtual ~NoiseModelFactor()
Destructor.
Definition: NonlinearFactor.h:179
NoiseModelFactor2()
Default Constructor for I/O.
Definition: NonlinearFactor.h:363
NonlinearFactor()
Default constructor for I/O only.
Definition: NonlinearFactor.h:66
virtual Vector evaluateError(const X1 &, const X2 &, const X3 &, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none) const =0
Override this method to finish implementing a trinary factor.
virtual Vector unwhitenedError(const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const
Calls the 3-key specific version of evaluateError, which is pure virtual so must be implemented in th...
Definition: NonlinearFactor.h:460
A convenient base class for creating your own NoiseModelFactor with 4 variables.
Definition: NonlinearFactor.h:497
boost::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:33
A convenient base class for creating your own NoiseModelFactor with 1 variable.
Definition: NonlinearFactor.h:276
virtual Vector evaluateError(const X &x, boost::optional< Matrix & > H=boost::none) const =0
Override this method to finish implementing a unary factor.
Definition: ImuBias.h:30
Nonlinear factor base class.
Definition: NonlinearFactor.h:50
const SharedNoiseModel & noiseModel() const
access to the noise model
Definition: NonlinearFactor.h:210
Key key1() const
methods to retrieve both keys
Definition: NonlinearFactor.h:377
A convenient base class for creating your own NoiseModelFactor with 6 variables.
Definition: NonlinearFactor.h:663
virtual Vector unwhitenedError(const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const
Calls the 6-key specific version of evaluateError, which is pure virtual so must be implemented in th...
Definition: NonlinearFactor.h:712
A convenient base class for creating your own NoiseModelFactor with 3 variables.
Definition: NonlinearFactor.h:420
virtual Vector evaluateError(const X1 &, const X2 &, const X3 &, const X4 &, const X5 &, const X6 &, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none, boost::optional< Matrix & > H3=boost::none, boost::optional< Matrix & > H4=boost::none, boost::optional< Matrix & > H5=boost::none, boost::optional< Matrix & > H6=boost::none) const =0
Override this method to finish implementing a 6-way factor.
virtual Vector evaluateError(const X1 &, const X2 &, boost::optional< Matrix & > H1=boost::none, boost::optional< Matrix & > H2=boost::none) const =0
Override this method to finish implementing a binary factor.
A nonlinear sum-of-squares factor with a zero-mean noise model implementing the density Templated on...
Definition: NonlinearFactor.h:161
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:56
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
virtual Vector unwhitenedError(const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const
Calls the 5-key specific version of evaluateError, which is pure virtual so must be implemented in th...
Definition: NonlinearFactor.h:624
A non-templated config holding any types of Manifold-group elements.
NoiseModelFactor6(const SharedNoiseModel &noiseModel, Key j1, Key j2, Key j3, Key j4, Key j5, Key j6)
Constructor.
Definition: NonlinearFactor.h:697
NonlinearFactor(const CONTAINER &keys)
Constructor from a collection of the keys involved in this factor.
Definition: NonlinearFactor.h:72
A convenient base class for creating your own NoiseModelFactor with 5 variables.
Definition: NonlinearFactor.h:578
NoiseModelFactor6()
Default Constructor for I/O.
Definition: NonlinearFactor.h:685
NoiseModelFactor5(const SharedNoiseModel &noiseModel, Key j1, Key j2, Key j3, Key j4, Key j5)
Constructor.
Definition: NonlinearFactor.h:610
NoiseModelFactor(const SharedNoiseModel &noiseModel)
Constructor - only for subclasses, as this does not set keys.
Definition: NonlinearFactor.h:193
virtual bool active(const Values &) const
Checks whether a factor should be used based on a set of values.
Definition: NonlinearFactor.h:113
Key key1() const
methods to retrieve keys
Definition: NonlinearFactor.h:616
The base class for all factors.
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
Key key1() const
methods to retrieve keys
Definition: NonlinearFactor.h:454
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:1072
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:72
Key key1() const
methods to retrieve keys
Definition: NonlinearFactor.h:703
virtual Vector unwhitenedError(const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const
Calls the 1-key specific version of evaluateError, which is pure virtual so must be implemented in th...
Definition: NonlinearFactor.h:308
NoiseModelFactor(const SharedNoiseModel &noiseModel, const CONTAINER &keys)
Constructor.
Definition: NonlinearFactor.h:185
virtual Vector unwhitenedError(const Values &x, boost::optional< std::vector< Matrix > & > H=boost::none) const
Calls the 4-key specific version of evaluateError, which is pure virtual so must be implemented in th...
Definition: NonlinearFactor.h:540
NoiseModelFactor5()
Default Constructor for I/O.
Definition: NonlinearFactor.h:599
NoiseModelFactor1()
Default constructor for I/O only.
Definition: NonlinearFactor.h:291
NoiseModelFactor2(const SharedNoiseModel &noiseModel, Key j1, Key j2)
Constructor.
Definition: NonlinearFactor.h:371
Definition: Pose3.h:37
Special class for optional Jacobian arguments.
virtual size_t dim() const
get the dimension of the factor (number of rows on linearization)
Definition: NonlinearFactor.h:205
Key key1() const
methods to retrieve keys
Definition: NonlinearFactor.h:533
NoiseModelFactor()
Default constructor for I/O only.
Definition: NonlinearFactor.h:176
virtual ~NonlinearFactor()
Destructor.
Definition: NonlinearFactor.h:90
NoiseModelFactor4()
Default Constructor for I/O.
Definition: NonlinearFactor.h:517