44 template <
class CALIBRATION>
54 std::shared_ptr<CALIBRATION>
K_;
74 const std::shared_ptr<CALIBRATION> K,
76 : Base(sharedNoiseModel, params), K_(K) {
88 const std::shared_ptr<CALIBRATION> K,
89 const std::optional<Pose3> body_P_sensor,
105 DefaultKeyFormatter)
const override {
106 std::cout << s <<
"SmartProjectionPoseFactor, z = \n ";
112 const This *e =
dynamic_cast<const This*
>(&p);
120 if (this->
active(values)) {
139 typename Base::Cameras
cameras;
141 const Pose3 world_P_sensor_k =
144 cameras.emplace_back(world_P_sensor_k, K_);
151 #ifdef GTSAM_ENABLE_BOOST_SERIALIZATION 152 friend class boost::serialization::access; 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_);
164 template<
class CALIBRATION>
166 SmartProjectionPoseFactor<CALIBRATION> > {
Base::Cameras cameras(const Values &values) const override
Definition: SmartProjectionPoseFactor.h:138
Definition: SmartFactorParams.h:42
std::string serialize(const T &input)
serializes to a string
Definition: serialization.h:113
const ValueType at(Key j) const
Definition: Values-inl.h:204
Definition: SmartProjectionFactor.h:44
Definition: Testable.h:152
Definition: NonlinearFactor.h:68
~SmartProjectionPoseFactor() override
Definition: SmartProjectionPoseFactor.h:96
KeyVector keys_
The keys involved in this factor.
Definition: Factor.h:87
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Definition: SmartProjectionPoseFactor.h:111
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Definition: SmartProjectionPoseFactor.h:104
Smart factor on cameras (pose + calibration)
SmartProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const std::shared_ptr< CALIBRATION > K, const SmartProjectionParams ¶ms=SmartProjectionParams())
Definition: SmartProjectionPoseFactor.h:72
Definition: SmartProjectionPoseFactor.h:45
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
Definition: PinholePose.h:239
SmartProjectionPoseFactor()
Definition: SmartProjectionPoseFactor.h:64
double error(const Values &values) const override
Definition: SmartProjectionPoseFactor.h:119
Definition: chartTesting.h:28
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Definition: SmartProjectionFactor.h:114
virtual bool active(const Values &) const
Definition: NonlinearFactor.h:141
const std::shared_ptr< CALIBRATION > calibration() const
Definition: SmartProjectionPoseFactor.h:128
std::shared_ptr< CALIBRATION > K_
calibration object (one for all cameras)
Definition: SmartProjectionPoseFactor.h:54
SmartProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const std::shared_ptr< CALIBRATION > K, const std::optional< Pose3 > body_P_sensor, const SmartProjectionParams ¶ms=SmartProjectionParams())
Definition: SmartProjectionPoseFactor.h:86
std::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
Definition: SmartProjectionPoseFactor.h:59
std::optional< Pose3 > body_P_sensor_
Pose of the camera in the body frame.
Definition: SmartFactorBase.h:83
std::uint64_t Key
Integer nonlinear key type.
Definition: types.h:102
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
Definition: SmartProjectionFactor.h:102
noiseModel::Base::shared_ptr SharedNoiseModel
Definition: NoiseModel.h:741
double totalReprojectionError(const Cameras &cameras, std::optional< Point3 > externalPoint={}) const
Definition: SmartProjectionFactor.h:411