29 const boost::optional<Pose3>& body_P_sensor)
30 :
Base(sharedNoiseModel, params, body_P_sensor) {}
34 const boost::shared_ptr<Cal3_S2Stereo>&
K) {
40 const std::vector<StereoPoint2>& measurements,
const KeyVector& poseKeys,
41 const std::vector<boost::shared_ptr<Cal3_S2Stereo>>& Ks) {
42 assert(measurements.size() == poseKeys.size());
43 assert(poseKeys.size() == Ks.size());
49 const std::vector<StereoPoint2>& measurements,
const KeyVector& poseKeys,
50 const boost::shared_ptr<Cal3_S2Stereo>&
K) {
51 assert(poseKeys.size() == measurements.size());
52 for (
size_t i = 0;
i < measurements.size();
i++) {
59 const std::string&
s,
const KeyFormatter& keyFormatter)
const {
60 std::cout << s <<
"SmartStereoProjectionPoseFactor, z = \n ";
61 for (
const boost::shared_ptr<Cal3_S2Stereo>&
K :
K_all_) {
62 K->print(
"calibration = ");
76 if (this->
active(values)) {
83 SmartStereoProjectionPoseFactor::Base::Cameras
87 for (
size_t i = 0;
i <
keys_.size();
i++) {
89 if (Base::body_P_sensor_) {
90 pose = pose.
compose(*(Base::body_P_sensor_));
bool equals(const This &other, double tol=1e-9) const
check equality
void print(const std::string &s="", const KeyFormatter &keyFormatter=DefaultKeyFormatter) const override
static Cal3_S2 K(500, 500, 0.1, 640/2, 480/2)
KeyVector keys_
The keys involved in this factor.
double totalReprojectionError(const Cameras &cameras, boost::optional< Point3 > externalPoint=boost::none) const
void add(const StereoPoint2 &measured, const Key &poseKey, const boost::shared_ptr< Cal3_S2Stereo > &K)
bool equals(const NonlinearFactor &p, double tol=1e-9) const override
equals
Smart stereo factor on poses, assuming camera calibration is fixed.
virtual bool active(const Values &) const
graph add(boost::make_shared< UnaryFactor >(1, 0.0, 0.0, unaryNoise))
FastVector< Key > KeyVector
Define collection type once and for all - also used in wrappers.
Class compose(const Class &g) const
double error(const Values &values) const override
const ValueType at(Key j) const
static const Pose3 pose(Rot3(Vector3(1,-1,-1).asDiagonal()), Point3(0, 0, 0.5))
std::function< std::string(Key)> KeyFormatter
Typedef for a function to format a key, i.e. to convert it to a string.
SmartStereoProjectionPoseFactor(const SharedNoiseModel &sharedNoiseModel, const SmartStereoProjectionParams ¶ms=SmartStereoProjectionParams(), const boost::optional< Pose3 > &body_P_sensor=boost::none)
Array< double, 1, 3 > e(1./3., 0.5, 2.)
virtual void print(const std::string &s="Factor", const KeyFormatter &formatter=DefaultKeyFormatter) const
print
static SmartStereoProjectionParams params
Base::Cameras cameras(const Values &values) const override
std::vector< boost::shared_ptr< Cal3_S2Stereo > > K_all_
shared pointer to calibration object (one for each camera)
const ZVector & measured() const
std::uint64_t Key
Integer nonlinear key type.
noiseModel::Base::shared_ptr SharedNoiseModel