SmartStereoProjectionPoseFactor.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 
22 #pragma once
23 
25 
26 namespace gtsam {
46 class GTSAM_UNSTABLE_EXPORT SmartStereoProjectionPoseFactor
48  protected:
50  std::vector<std::shared_ptr<Cal3_S2Stereo>> K_all_;
51 
52  public:
54 
57 
60 
62  typedef std::shared_ptr<This> shared_ptr;
63 
70  const SharedNoiseModel& sharedNoiseModel,
72  const std::optional<Pose3>& body_P_sensor = {});
73 
82  void add(const StereoPoint2& measured, const Key& poseKey,
83  const std::shared_ptr<Cal3_S2Stereo>& K);
84 
93  void add(const std::vector<StereoPoint2>& measurements,
94  const KeyVector& poseKeys,
95  const std::vector<std::shared_ptr<Cal3_S2Stereo>>& Ks);
96 
106  void add(const std::vector<StereoPoint2>& measurements,
107  const KeyVector& poseKeys,
108  const std::shared_ptr<Cal3_S2Stereo>& K);
109 
115  void print(const std::string& s = "", const KeyFormatter& keyFormatter =
116  DefaultKeyFormatter) const override;
117 
119  bool equals(const NonlinearFactor& p, double tol = 1e-9) const override;
120 
124  double error(const Values& values) const override;
125 
127  inline std::vector<std::shared_ptr<Cal3_S2Stereo>> calibration() const {
128  return K_all_;
129  }
130 
138  Base::Cameras cameras(const Values& values) const override;
139 
140  private:
141 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION
142  friend class boost::serialization::access;
144  template <class ARCHIVE>
145  void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
146  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
147  ar& BOOST_SERIALIZATION_NVP(K_all_);
148  }
149 #endif
150 
151 }; // end of class declaration
152 
154 template <>
156  : public Testable<SmartStereoProjectionPoseFactor> {};
157 
158 } // namespace gtsam
void print(const Matrix &A, const string &s, ostream &stream)
Definition: Matrix.cpp:155
Point2 measured(-17, 30)
const gtsam::Key poseKey
std::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
std::vector< std::shared_ptr< Cal3_S2Stereo > > K_all_
shared pointer to calibration object (one for each camera)
std::string serialize(const T &input)
serializes to a string
CameraSet< Camera > Cameras
Smart stereo factor on StereoCameras (pose)
leaf::MyValues values
static Pose3 body_P_sensor(Rot3::RzRyRx(-M_PI_2, 0.0, -M_PI_2), Point3(0.25, -0.10, 1.0))
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: Memory.h:841
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
static const KeyFormatter DefaultKeyFormatter
Definition: Key.h:43
static const SmartProjectionParams params
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef SmartStereoProjectionFactor Base
shorthand for base class type
Array< double, 1, 3 > e(1./3., 0.5, 2.)
RealScalar s
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
Definition: Key.h:35
traits
Definition: chartTesting.h:28
float * p
std::vector< std::shared_ptr< Cal3_S2Stereo > > calibration() const
graph add(PriorFactor< Pose2 >(1, priorMean, priorNoise))
static double error
Definition: testRot3.cpp:37
const G double tol
Definition: Group.h:86
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
SmartStereoProjectionPoseFactor This
shorthand for this class
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:741
SmartProjectionParams SmartStereoProjectionParams


gtsam
Author(s):
autogenerated on Tue Jul 4 2023 02:35:52