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,
106 std::cout <<
s <<
"SmartProjectionPoseFactor, z = \n ";
112 const This *
e =
dynamic_cast<const This*
>(&
p);
120 if (this->
active(values)) {
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
Pose3 body_P_sensor() const
SmartProjectionPoseFactor< CALIBRATION > This
std::string serialize(const T &input)
serializes to a string
const ValueType at(Key j) const
~SmartProjectionPoseFactor() override
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
KeyVector keys_
The keys involved in this factor.
static const KeyFormatter DefaultKeyFormatter
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
static const SmartProjectionParams params
Smart factor on cameras (pose + calibration)
SmartProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const std::shared_ptr< CALIBRATION > K, const SmartProjectionParams ¶ms=SmartProjectionParams())
Array< double, 1, 3 > e(1./3., 0.5, 2.)
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
SmartProjectionPoseFactor()
double error(const Values &values) const override
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
PinholePose< CALIBRATION > Camera
virtual bool active(const Values &) const
const std::shared_ptr< CALIBRATION > calibration() const
std::shared_ptr< CALIBRATION > K_
calibration object (one for all cameras)
SmartProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const std::shared_ptr< CALIBRATION > K, const std::optional< Pose3 > body_P_sensor, const SmartProjectionParams ¶ms=SmartProjectionParams())
SmartProjectionFactor< Camera > Base
std::shared_ptr< This > shared_ptr
shorthand for a smart pointer to a factor
std::optional< Pose3 > body_P_sensor_
Pose of the camera in the body frame.
std::uint64_t Key
Integer nonlinear key type.
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
noiseModel::Base::shared_ptr SharedNoiseModel
CameraSet< CAMERA > Cameras
double totalReprojectionError(const Cameras &cameras, std::optional< Point3 > externalPoint={}) const