gtsam  4.1.0
gtsam
Cal3Unified.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 
23 #pragma once
24 
25 #include <gtsam/geometry/Cal3DS2_Base.h>
26 
27 namespace gtsam {
28 
42 class GTSAM_EXPORT Cal3Unified : public Cal3DS2_Base {
43 
44  typedef Cal3Unified This;
45  typedef Cal3DS2_Base Base;
46 
47 private:
48 
49  double xi_; // mirror parameter
50 
51 public:
52 
53  enum { dimension = 10 };
54 
57 
59  Cal3Unified() : Base(), xi_(0) {}
60 
61  Cal3Unified(double fx, double fy, double s, double u0, double v0,
62  double k1, double k2, double p1 = 0.0, double p2 = 0.0, double xi = 0.0) :
63  Base(fx, fy, s, u0, v0, k1, k2, p1, p2), xi_(xi) {}
64 
65  virtual ~Cal3Unified() {}
66 
70 
71  Cal3Unified(const Vector &v) ;
72 
76 
78  void print(const std::string& s = "") const override;
79 
81  bool equals(const Cal3Unified& K, double tol = 10e-9) const;
82 
86 
88  inline double xi() const { return xi_;}
89 
97  Point2 uncalibrate(const Point2& p,
98  OptionalJacobian<2,10> Dcal = boost::none,
99  OptionalJacobian<2,2> Dp = boost::none) const ;
100 
102  Point2 calibrate(const Point2& p, const double tol=1e-5) const;
103 
105  Point2 spaceToNPlane(const Point2& p) const;
106 
108  Point2 nPlaneToSpace(const Point2& p) const;
109 
113 
115  Cal3Unified retract(const Vector& d) const ;
116 
118  Vector10 localCoordinates(const Cal3Unified& T2) const ;
119 
121  virtual size_t dim() const { return dimension ; }
122 
124  static size_t Dim() { return dimension; }
125 
127  Vector10 vector() const ;
128 
130 
131 private:
132 
134  friend class boost::serialization::access;
135  template<class Archive>
136  void serialize(Archive & ar, const unsigned int /*version*/)
137  {
138  ar & boost::serialization::make_nvp("Cal3Unified",
139  boost::serialization::base_object<Cal3DS2_Base>(*this));
140  ar & BOOST_SERIALIZATION_NVP(xi_);
141  }
142 
143 };
144 
145 template<>
146 struct traits<Cal3Unified> : public internal::Manifold<Cal3Unified> {};
147 
148 template<>
149 struct traits<const Cal3Unified> : public internal::Manifold<Cal3Unified> {};
150 
151 }
152 
gtsam::Cal3Unified::xi
double xi() const
mirror parameter
Definition: Cal3Unified.h:88
gtsam::Cal3Unified::Cal3Unified
Cal3Unified()
Default Constructor with only unit focal length.
Definition: Cal3Unified.h:59
gtsam::OptionalJacobian
OptionalJacobian is an Eigen::Ref like class that can take be constructed using either a fixed size o...
Definition: OptionalJacobian.h:39
gtsam::Cal3Unified
Definition: Cal3Unified.h:42
gtsam::traits
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition: concepts.h:30
gtsam::serialize
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:100
gtsam::Cal3Unified::dim
virtual size_t dim() const
Return dimensions of calibration manifold object.
Definition: Cal3Unified.h:121
gtsam
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
gtsam::print
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition: Matrix.cpp:155
gtsam::Cal3Unified::Dim
static size_t Dim()
Return dimensions of calibration manifold object.
Definition: Cal3Unified.h:124
gtsam::Point2
Vector2 Point2
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point2 to Vector2...
Definition: Point2.h:27
gtsam::internal::Manifold
Both ManifoldTraits and Testable.
Definition: Manifold.h:120
gtsam::Cal3DS2_Base
Definition: Cal3DS2_Base.h:39