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 {
47  protected:
49  std::vector<boost::shared_ptr<Cal3_S2Stereo>> K_all_;
50 
51  public:
53 
56 
59 
61  typedef boost::shared_ptr<This> shared_ptr;
62 
69  const SharedNoiseModel& sharedNoiseModel,
71  const boost::optional<Pose3>& body_P_sensor = boost::none);
72 
74  ~SmartStereoProjectionPoseFactor() override = default;
75 
84  void add(const StereoPoint2& measured, const Key& poseKey,
85  const boost::shared_ptr<Cal3_S2Stereo>& K);
86 
95  void add(const std::vector<StereoPoint2>& measurements,
96  const KeyVector& poseKeys,
97  const std::vector<boost::shared_ptr<Cal3_S2Stereo>>& Ks);
98 
108  void add(const std::vector<StereoPoint2>& measurements,
109  const KeyVector& poseKeys,
110  const boost::shared_ptr<Cal3_S2Stereo>& K);
111 
117  void print(const std::string& s = "", const KeyFormatter& keyFormatter =
118  DefaultKeyFormatter) const override;
119 
121  bool equals(const NonlinearFactor& p, double tol = 1e-9) const override;
122 
126  double error(const Values& values) const override;
127 
129  inline std::vector<boost::shared_ptr<Cal3_S2Stereo>> calibration() const {
130  return K_all_;
131  }
132 
140  Base::Cameras cameras(const Values& values) const override;
141 
142  private:
145  template <class ARCHIVE>
146  void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
147  ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
148  ar& BOOST_SERIALIZATION_NVP(K_all_);
149  }
150 
151 }; // end of class declaration
152 
154 template <>
156  : public Testable<SmartStereoProjectionPoseFactor> {};
157 
158 } // namespace gtsam
const gtsam::Key poseKey
void serialize(ARCHIVE &ar, const unsigned int)
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
~SmartStereoProjectionPoseFactor() override=default
Smart stereo factor on StereoCameras (pose + calibration)
leaf::MyValues values
#define EIGEN_MAKE_ALIGNED_OPERATOR_NEW
Definition: Memory.h:690
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
std::vector< boost::shared_ptr< Cal3_S2Stereo > > calibration() const
void add(const StereoPoint2 &measured, const Key &poseKey, const boost::shared_ptr< Cal3_S2Stereo > &K)
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
static const KeyFormatter DefaultKeyFormatter
Definition: Key.h:43
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition: Key.h:86
double error(const Values &values) const override
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef SmartStereoProjectionFactor Base
shorthand for base class type
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
SmartStereoProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams &params=SmartStereoProjectionParams(), const boost::optional< Pose3 > &body_P_sensor=boost::none)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
RealScalar s
static SmartStereoProjectionParams params
Base::Cameras cameras(const Values &values) const override
traits
Definition: chartTesting.h:28
std::vector< boost::shared_ptr< Cal3_S2Stereo > > K_all_
shared pointer to calibration object (one for each camera)
float * p
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
const G double tol
Definition: Group.h:83
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:61
SmartStereoProjectionPoseFactor This
shorthand for this class
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:734
friend class boost::serialization::access
Serialization function.
SmartProjectionParams SmartStereoProjectionParams


gtsam
Author(s):
autogenerated on Sat May 8 2021 02:44:16