44template<
class CALIBRATION>
46 PinholePose<CALIBRATION> > {
55 boost::shared_ptr<CALIBRATION>
K_;
75 const boost::shared_ptr<CALIBRATION> K,
77 :
Base(sharedNoiseModel, params),
K_(K) {
89 const boost::shared_ptr<CALIBRATION> K,
90 const boost::optional<Pose3> body_P_sensor,
106 DefaultKeyFormatter)
const override {
107 std::cout << s <<
"SmartProjectionPoseFactor, z = \n ";
113 const This *e =
dynamic_cast<const This*
>(&p);
121 if (this->
active(values)) {
140 typename Base::Cameras
cameras;
142 const Pose3 world_P_sensor_k =
145 cameras.emplace_back(world_P_sensor_k,
K_);
154 template<
class ARCHIVE>
155 void serialize(ARCHIVE & ar,
const unsigned int ) {
156 ar & BOOST_SERIALIZATION_BASE_OBJECT_NVP(
Base);
157 ar & BOOST_SERIALIZATION_NVP(
K_);
164template<
class CALIBRATION>
166 SmartProjectionPoseFactor<CALIBRATION> > {
Smart factor on cameras (pose + calibration)
Global functions in a separate testing namespace.
Definition: chartTesting.h:28
noiseModel::Base::shared_ptr SharedNoiseModel
Note, deliberately not in noiseModel namespace.
Definition: NoiseModel.h:736
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:69
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
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
Definition: PinholePose.h:237
This is the base class for all factor types.
Definition: Factor.h:56
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:73
Nonlinear factor base class.
Definition: NonlinearFactor.h:43
virtual bool active(const Values &) const
Checks whether a factor should be used based on a set of values.
Definition: NonlinearFactor.h:106
A non-templated config holding any types of Manifold-group elements.
Definition: Values.h:63
const ValueType at(Key j) const
Retrieve a variable by key j.
Definition: Values-inl.h:346
boost::optional< Pose3 > body_P_sensor_
Pose of the camera in the body frame.
Definition: SmartFactorBase.h:82
Definition: SmartFactorParams.h:42
SmartProjectionFactor: triangulates point and keeps an estimate of it around.
Definition: SmartProjectionFactor.h:45
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print
Definition: SmartProjectionFactor.h:103
double totalReprojectionError(const Cameras &cameras, boost::optional< Point3 > externalPoint=boost::none) const
Calculate the error of the factor.
Definition: SmartProjectionFactor.h:411
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Definition: SmartProjectionFactor.h:115
Definition: SmartProjectionPoseFactor.h:46
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Definition: SmartProjectionPoseFactor.h:112
SmartProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const boost::shared_ptr< CALIBRATION > K, const SmartProjectionParams ¶ms=SmartProjectionParams())
Constructor.
Definition: SmartProjectionPoseFactor.h:73
Base::Cameras cameras(const Values &values) const override
Collect all cameras involved in this factor.
Definition: SmartProjectionPoseFactor.h:139
double error(const Values &values) const override
error calculates the error of the factor.
Definition: SmartProjectionPoseFactor.h:120
boost::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Definition: SmartProjectionPoseFactor.h:60
boost::shared_ptr< CALIBRATION > K_
calibration object (one for all cameras)
Definition: SmartProjectionPoseFactor.h:55
~SmartProjectionPoseFactor() override
Virtual destructor.
Definition: SmartProjectionPoseFactor.h:97
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
print
Definition: SmartProjectionPoseFactor.h:105
const boost::shared_ptr< CALIBRATION > calibration() const
return calibration shared pointers
Definition: SmartProjectionPoseFactor.h:129
SmartProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const boost::shared_ptr< CALIBRATION > K, const boost::optional< Pose3 > body_P_sensor, const SmartProjectionParams ¶ms=SmartProjectionParams())
Constructor.
Definition: SmartProjectionPoseFactor.h:87
friend class boost::serialization::access
Serialization function.
Definition: SmartProjectionPoseFactor.h:153
SmartProjectionPoseFactor()
Default constructor, only for serialization.
Definition: SmartProjectionPoseFactor.h:65