25#include <gtsam_unstable/dllexport.h>
51 std::shared_ptr<Cal3_S2>
K_;
97 Key poseKey_a,
Key poseKey_b,
Key pointKey,
98 const std::shared_ptr<Cal3_S2>& K,
99 std::optional<Pose3> body_P_sensor = {})
100 : Base(model, poseKey_a, poseKey_b, pointKey),
104 body_P_sensor_(body_P_sensor),
105 throwCheirality_(false),
106 verboseCheirality_(false) {}
127 Key poseKey_a,
Key poseKey_b,
Key pointKey,
130 std::optional<Pose3> body_P_sensor = {})
131 : Base(model, poseKey_a, poseKey_b, pointKey),
135 body_P_sensor_(body_P_sensor),
136 throwCheirality_(throwCheirality),
137 verboseCheirality_(verboseCheirality) {}
143 gtsam::NonlinearFactor::shared_ptr
clone()
const override {
144 return std::static_pointer_cast<gtsam::NonlinearFactor>(
145 gtsam::NonlinearFactor::shared_ptr(
new This(*
this)));
154 const std::string& s =
"",
156 std::cout << s <<
"ProjectionFactorRollingShutter, z = ";
158 std::cout <<
" rolling shutter interpolation param = " <<
alpha_;
166 const This* e =
dynamic_cast<const This*
>(&p);
169 this->K_->equals(*e->
K_, tol) &&
178 Vector2 evaluateError(
198#if GTSAM_ENABLE_BOOST_SERIALIZATION
200 friend class boost::serialization::access;
201 template <
class ARCHIVE>
202 void serialize(ARCHIVE& ar,
const unsigned int ) {
203 ar& BOOST_SERIALIZATION_BASE_OBJECT_NVP(Base);
204 ar& BOOST_SERIALIZATION_NVP(measured_);
205 ar& BOOST_SERIALIZATION_NVP(alpha_);
206 ar& BOOST_SERIALIZATION_NVP(K_);
207 ar& BOOST_SERIALIZATION_NVP(body_P_sensor_);
208 ar& BOOST_SERIALIZATION_NVP(throwCheirality_);
209 ar& BOOST_SERIALIZATION_NVP(verboseCheirality_);
217 :
public Testable<ProjectionFactorRollingShutter> {};
The most common 5DOF 3D->2D calibration.
Calibrated camera for which only pose is unknown.
Base class for all pinhole cameras.
Base class for noise model factors with N variables.
Non-linear factor base classes.
Global functions in a separate testing namespace.
Definition chartTesting.h:28
KeyFormatter DefaultKeyFormatter
Assign default key formatter.
Definition Key.cpp:30
Matrix * OptionalMatrixType
This typedef will be used everywhere boost::optional<Matrix&> reference was used previously.
Definition NonlinearFactor.h:57
Vector3 Point3
As of GTSAM 4, in order to make GTSAM more lean, it is now possible to just typedef Point3 to Vector3...
Definition Point3.h:38
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:32
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
A helper that implements the traits interface for GTSAM types.
Definition Testable.h:152
A 3D pose (R,t) : (Rot3,Point3).
Definition Pose3.h:42
virtual void print(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print
Definition Factor.cpp:29
bool equals(const This &other, double tol=1e-9) const
check equality
Definition Factor.cpp:42
NoiseModelFactorT()
Definition NoiseModelFactorN.h:257
virtual Vector2 evaluateError(const ValueTypes &... x, OptionalMatrixTypeT< ValueTypes >... H) const=0
Nonlinear factor base class.
Definition NonlinearFactor.h:70
Non-linear factor for 2D projection measurement obtained using a rolling shutter camera.
Definition ProjectionFactorRollingShutter.h:45
ProjectionFactorRollingShutter(const Point2 &measured, double alpha, const SharedNoiseModel &model, Key poseKey_a, Key poseKey_b, Key pointKey, const std::shared_ptr< Cal3_S2 > &K, std::optional< Pose3 > body_P_sensor={})
Constructor.
Definition ProjectionFactorRollingShutter.h:95
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print
Definition ProjectionFactorRollingShutter.h:153
bool throwCheirality() const
return flag for throwing cheirality exceptions
Definition ProjectionFactorRollingShutter.h:195
const Point2 & measured() const
return the measurement
Definition ProjectionFactorRollingShutter.h:183
gtsam::NonlinearFactor::shared_ptr clone() const override
Definition ProjectionFactorRollingShutter.h:143
ProjectionFactorRollingShutter(const Point2 &measured, double alpha, const SharedNoiseModel &model, Key poseKey_a, Key poseKey_b, Key pointKey, const std::shared_ptr< Cal3_S2 > &K, bool throwCheirality, bool verboseCheirality, std::optional< Pose3 > body_P_sensor={})
Constructor with exception-handling flags.
Definition ProjectionFactorRollingShutter.h:125
ProjectionFactorRollingShutter This
shorthand for this class
Definition ProjectionFactorRollingShutter.h:70
bool verboseCheirality() const
return verbosity
Definition ProjectionFactorRollingShutter.h:192
ProjectionFactorRollingShutter()
Default constructor.
Definition ProjectionFactorRollingShutter.h:76
double alpha() const
returns the rolling shutter interp param
Definition ProjectionFactorRollingShutter.h:189
Point2 measured_
2D measurement
Definition ProjectionFactorRollingShutter.h:48
std::shared_ptr< Cal3_S2 > K_
shared pointer to calibration object
Definition ProjectionFactorRollingShutter.h:51
double alpha_
interpolation parameter in [0,1] corresponding to the point2 measurement
Definition ProjectionFactorRollingShutter.h:49
std::optional< Pose3 > body_P_sensor_
The pose of the sensor in the body frame.
Definition ProjectionFactorRollingShutter.h:53
NoiseModelFactorT< Vector2, Pose3, Pose3, Point3 > Base
shorthand for base class type
Definition ProjectionFactorRollingShutter.h:63
std::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Definition ProjectionFactorRollingShutter.h:73
bool throwCheirality_
If true, rethrows Cheirality exceptions (default: false).
Definition ProjectionFactorRollingShutter.h:56
virtual ~ProjectionFactorRollingShutter()
Virtual destructor.
Definition ProjectionFactorRollingShutter.h:140
const std::shared_ptr< Cal3_S2 > calibration() const
return the calibration object
Definition ProjectionFactorRollingShutter.h:186
bool verboseCheirality_
If true, prints text for Cheirality exceptions (default: false).
Definition ProjectionFactorRollingShutter.h:58
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Definition ProjectionFactorRollingShutter.h:165