gtsam 4.2
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<boost::shared_ptr<Cal3_S2Stereo>> K_all_;
51
52 public:
53 EIGEN_MAKE_ALIGNED_OPERATOR_NEW
54
57
60
62 typedef boost::shared_ptr<This> shared_ptr;
63
70 const SharedNoiseModel& sharedNoiseModel,
71 const SmartStereoProjectionParams& params = SmartStereoProjectionParams(),
72 const boost::optional<Pose3>& body_P_sensor = boost::none);
73
76
85 void add(const StereoPoint2& measured, const Key& poseKey,
86 const boost::shared_ptr<Cal3_S2Stereo>& K);
87
96 void add(const std::vector<StereoPoint2>& measurements,
97 const KeyVector& poseKeys,
98 const std::vector<boost::shared_ptr<Cal3_S2Stereo>>& Ks);
99
109 void add(const std::vector<StereoPoint2>& measurements,
110 const KeyVector& poseKeys,
111 const boost::shared_ptr<Cal3_S2Stereo>& K);
112
118 void print(const std::string& s = "", const KeyFormatter& keyFormatter =
119 DefaultKeyFormatter) const override;
120
122 bool equals(const NonlinearFactor& p, double tol = 1e-9) const override;
123
127 double error(const Values& values) const override;
128
130 inline std::vector<boost::shared_ptr<Cal3_S2Stereo>> calibration() const {
131 return K_all_;
132 }
133
141 Base::Cameras cameras(const Values& values) const override;
142
143 private:
145 friend class boost::serialization::access;
146 template <class ARCHIVE>
147 void serialize(ARCHIVE& ar, const unsigned int /*version*/) {
148 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
149 ar& BOOST_SERIALIZATION_NVP(K_all_);
150 }
151
152}; // end of class declaration
153
155template <>
157 : public Testable<SmartStereoProjectionPoseFactor> {};
158
159} // namespace gtsam
Smart stereo factor on StereoCameras (pose).
Global functions in a separate testing namespace.
Definition chartTesting.h:28
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Definition Key.h:86
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:724
std::uint64_t Key
Integer nonlinear key type.
Definition types.h:100
A manifold defines a space in which there is a notion of a linear tangent space that can be centered ...
Definition concepts.h:30
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:151
A 2D stereo point, v will be same for rectified images.
Definition StereoPoint2.h:32
Nonlinear factor base class.
Definition NonlinearFactor.h:42
A non-templated config holding any types of Manifold-group elements.
Definition Values.h:65
const ZVector & measured() const
Definition SmartFactorBase.h:159
SmartStereoProjectionFactor(const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams &params=SmartStereoProjectionParams(), const boost::optional< Pose3 > body_P_sensor=boost::none)
Constructor.
Definition SmartStereoProjectionFactor.h:88
If you are using the factor, please cite: L.
Definition SmartStereoProjectionPoseFactor.h:47
SmartStereoProjectionPoseFactor This
shorthand for this class
Definition SmartStereoProjectionPoseFactor.h:59
double error(const Values &values) const override
error calculates the error of the factor.
Definition SmartStereoProjectionPoseFactor.cpp:75
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print
Definition SmartStereoProjectionPoseFactor.cpp:58
void add(const StereoPoint2 &measured, const Key &poseKey, const boost::shared_ptr< Cal3_S2Stereo > &K)
add a new measurement and pose key
Definition SmartStereoProjectionPoseFactor.cpp:32
std::vector< boost::shared_ptr< Cal3_S2Stereo > > calibration() const
return the calibration object
Definition SmartStereoProjectionPoseFactor.h:130
~SmartStereoProjectionPoseFactor() override=default
Virtual destructor.
EIGEN_MAKE_ALIGNED_OPERATOR_NEW typedef SmartStereoProjectionFactor Base
shorthand for base class type
Definition SmartStereoProjectionPoseFactor.h:56
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Definition SmartStereoProjectionPoseFactor.h:62
SmartStereoProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams &params=SmartStereoProjectionParams(), const boost::optional< Pose3 > &body_P_sensor=boost::none)
Constructor.
Definition SmartStereoProjectionPoseFactor.cpp:26
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Definition SmartStereoProjectionPoseFactor.cpp:67
std::vector< boost::shared_ptr< Cal3_S2Stereo > > K_all_
shared pointer to calibration object (one for each camera)
Definition SmartStereoProjectionPoseFactor.h:50