gtsam  4.0.0
gtsam
Cal3DS2.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/geometry/Cal3DS2_Base.h>
22 
23 namespace gtsam {
24 
39 class GTSAM_EXPORT Cal3DS2 : public Cal3DS2_Base {
40 
41  typedef Cal3DS2_Base Base;
42 
43 public:
44 
45  enum { dimension = 9 };
46 
49 
51  Cal3DS2() : Base() {}
52 
53  Cal3DS2(double fx, double fy, double s, double u0, double v0,
54  double k1, double k2, double p1 = 0.0, double p2 = 0.0) :
55  Base(fx, fy, s, u0, v0, k1, k2, p1, p2) {}
56 
57  virtual ~Cal3DS2() {}
58 
62 
63  Cal3DS2(const Vector &v) : Base(v) {}
64 
68 
70  virtual void print(const std::string& s = "") const ;
71 
73  bool equals(const Cal3DS2& K, double tol = 10e-9) const;
74 
78 
80  Cal3DS2 retract(const Vector& d) const ;
81 
83  Vector localCoordinates(const Cal3DS2& T2) const ;
84 
86  virtual size_t dim() const { return 9 ; } //TODO: make a final dimension variable (also, usually size_t in other classes e.g. Pose2)
87 
89  static size_t Dim() { return 9; } //TODO: make a final dimension variable
90 
94 
96  virtual boost::shared_ptr<Base> clone() const {
97  return boost::shared_ptr<Base>(new Cal3DS2(*this));
98  }
99 
101 
102 
103 private:
104 
107 
109  friend class boost::serialization::access;
110  template<class Archive>
111  void serialize(Archive & ar, const unsigned int /*version*/)
112  {
113  ar & boost::serialization::make_nvp("Cal3DS2",
114  boost::serialization::base_object<Cal3DS2_Base>(*this));
115  }
116 
118 
119 };
120 
121 template<>
122 struct traits<Cal3DS2> : public internal::Manifold<Cal3DS2> {};
123 
124 template<>
125 struct traits<const Cal3DS2> : public internal::Manifold<Cal3DS2> {};
126 
127 }
128 
Definition: Cal3DS2_Base.h:39
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:140
static size_t Dim()
Return dimensions of calibration manifold object.
Definition: Cal3DS2.h:89
Definition: Cal3DS2.h:39
Cal3DS2()
Default Constructor with only unit focal length.
Definition: Cal3DS2.h:51
virtual size_t dim() const
Return dimensions of calibration manifold object.
Definition: Cal3DS2.h:86
Template to create a binary predicate.
Definition: Testable.h:110
virtual boost::shared_ptr< Base > clone() const
Definition: Cal3DS2.h:96
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
Global functions in a separate testing namespace.
Definition: chartTesting.h:28