gtsam  3.2.1
gtsam
 All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Groups Pages
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/base/DerivedValue.h>
22 #include <gtsam/geometry/Cal3DS2_Base.h>
23 
24 namespace gtsam {
25 
40 class GTSAM_EXPORT Cal3DS2 : public Cal3DS2_Base, public DerivedValue<Cal3DS2> {
41 
42  typedef Cal3DS2_Base Base;
43 
44 public:
45 
48 
50  Cal3DS2() : Base() {}
51 
52  Cal3DS2(double fx, double fy, double s, double u0, double v0,
53  double k1, double k2, double p1 = 0.0, double p2 = 0.0) :
54  Base(fx, fy, s, u0, v0, k1, k2, p1, p2) {}
55 
56  virtual ~Cal3DS2() {}
57 
61 
62  Cal3DS2(const Vector &v) : Base(v) {}
63 
67 
69  void print(const std::string& s = "") const ;
70 
72  bool equals(const Cal3DS2& K, double tol = 10e-9) const;
73 
77 
79  Cal3DS2 retract(const Vector& d) const ;
80 
82  Vector localCoordinates(const Cal3DS2& T2) const ;
83 
85  virtual size_t dim() const { return 9 ; } //TODO: make a final dimension variable (also, usually size_t in other classes e.g. Pose2)
86 
88  static size_t Dim() { return 9; } //TODO: make a final dimension variable
89 
90 private:
91 
95 
97  friend class boost::serialization::access;
98  template<class Archive>
99  void serialize(Archive & ar, const unsigned int version)
100  {
101  ar & boost::serialization::make_nvp("Cal3DS2",
102  boost::serialization::base_object<Value>(*this));
103  ar & boost::serialization::make_nvp("Cal3DS2",
104  boost::serialization::base_object<Cal3DS2_Base>(*this));
105  }
106 
108 
109 };
110 
111 }
112 
Definition: Cal3DS2_Base.h:40
Definition: Cal3DS2.h:40
virtual size_t dim() const
Return dimensions of calibration manifold object.
Definition: Cal3DS2.h:85
void print(const Matrix &A, const string &s, ostream &stream)
print a matrix
Definition: Matrix.cpp:183
static size_t Dim()
Return dimensions of calibration manifold object.
Definition: Cal3DS2.h:88
Definition: DerivedValue.h:44
Cal3DS2()
Default Constructor with only unit focal length.
Definition: Cal3DS2.h:50