gtsam
Loading...
Searching...
No Matches
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
21
22#pragma once
23
25
26namespace gtsam {
38
46class GTSAM_UNSTABLE_EXPORT SmartStereoProjectionPoseFactor
48 protected:
50 std::vector<std::shared_ptr<Cal3_S2Stereo>> K_all_;
51
52 public:
55
58
60 typedef std::shared_ptr<This> shared_ptr;
61
68 const SharedNoiseModel& sharedNoiseModel,
69 const SmartStereoProjectionParams& params = SmartStereoProjectionParams(),
70 const std::optional<Pose3>& body_P_sensor = {});
71
80 void add(const StereoPoint2& measured, const Key& poseKey,
81 const std::shared_ptr<Cal3_S2Stereo>& K);
82
91 void add(const std::vector<StereoPoint2>& measurements,
92 const KeyVector& poseKeys,
93 const std::vector<std::shared_ptr<Cal3_S2Stereo>>& Ks);
94
104 void add(const std::vector<StereoPoint2>& measurements,
105 const KeyVector& poseKeys,
106 const std::shared_ptr<Cal3_S2Stereo>& K);
107
113 void print(const std::string& s = "", const KeyFormatter& keyFormatter =
114 DefaultKeyFormatter) const override;
115
117 bool equals(const NonlinearFactor& p, double tol = 1e-9) const override;
118
122 double error(const Values& values) const override;
123
125 inline std::vector<std::shared_ptr<Cal3_S2Stereo>> calibration() const {
126 return K_all_;
127 }
128
136 Base::Cameras cameras(const Values& values) const override;
137
138 private:
139#if GTSAM_ENABLE_BOOST_SERIALIZATION
141 friend class boost::serialization::access;
142 template <class ARCHIVE>
143 void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
144 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
145 ar& BOOST_SERIALIZATION_NVP(K_all_);
146 }
147#endif
148
149}; // end of class declaration
150
152template <>
154 : public Testable<SmartStereoProjectionPoseFactor> {};
155
156} // namespace gtsam
Smart stereo factor on StereoCameras (pose).
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition Key.h:91
void print(const Matrix &A, const string &s, ostream &stream)
print without optional string, must specify cout yourself
Definition Matrix.cpp:143
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
noiseModel::Base::shared_ptr SharedNoiseModel
Aliases.
Definition NoiseModel.h:846
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:43
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition Group.h:37
Template to create a binary predicate.
Definition Testable.h:112
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
A 2D stereo point, v will be same for rectified images.
Definition StereoPoint2.h:34
Nonlinear factor base class.
Definition NonlinearFactor.h:70
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65
SmartStereoProjectionFactor(const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams &params=SmartStereoProjectionParams(), const std::optional< Pose3 > body_P_sensor={})
Constructor.
Definition SmartStereoProjectionFactor.h:91
If you are using the factor, please cite: L.
Definition SmartStereoProjectionPoseFactor.h:47
SmartStereoProjectionPoseFactor This
shorthand for this class
Definition SmartStereoProjectionPoseFactor.h:57
std::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Definition SmartStereoProjectionPoseFactor.h:60
SmartStereoProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams &params=SmartStereoProjectionParams(), const std::optional< Pose3 > &body_P_sensor={})
Constructor.
Definition SmartStereoProjectionPoseFactor.cpp:28
std::vector< std::shared_ptr< Cal3_S2Stereo > > K_all_
shared pointer to calibration object (one for each camera)
Definition SmartStereoProjectionPoseFactor.h:50
std::vector< std::shared_ptr< Cal3_S2Stereo > > calibration() const
return the calibration object
Definition SmartStereoProjectionPoseFactor.h:125
SmartStereoProjectionFactor Base
shorthand for base class type
Definition SmartStereoProjectionPoseFactor.h:54