remove verbose flag and print exception to std::cerr

release/4.3a0
Varun Agrawal 2021-01-05 13:59:58 -05:00
parent b7584ce362
commit b244a7d636
1 changed files with 4 additions and 11 deletions

View File

@ -70,7 +70,6 @@ class GeneralSFMFactor: public NoiseModelFactor2<CAMERA, LANDMARK> {
protected: protected:
Point2 measured_; ///< the 2D measurement Point2 measured_; ///< the 2D measurement
bool verbose_; ///< Flag for print verbosity
public: public:
@ -88,10 +87,8 @@ public:
* @param landmarkKey is the index of the landmark * @param landmarkKey is the index of the landmark
*/ */
GeneralSFMFactor(const Point2& measured, const SharedNoiseModel& model, GeneralSFMFactor(const Point2& measured, const SharedNoiseModel& model,
Key cameraKey, Key landmarkKey, bool verbose = false) Key cameraKey, Key landmarkKey)
: Base(model, cameraKey, landmarkKey), : Base(model, cameraKey, landmarkKey), measured_(measured) {}
measured_(measured),
verbose_(verbose) {}
GeneralSFMFactor() : measured_(0.0, 0.0) {} ///< default constructor GeneralSFMFactor() : measured_(0.0, 0.0) {} ///< default constructor
///< constructor that takes a Point2 ///< constructor that takes a Point2
@ -133,9 +130,7 @@ public:
catch( CheiralityException& e) { catch( CheiralityException& e) {
if (H1) *H1 = JacobianC::Zero(); if (H1) *H1 = JacobianC::Zero();
if (H2) *H2 = JacobianL::Zero(); if (H2) *H2 = JacobianL::Zero();
if (verbose_) { std::cerr << e.what() << std::endl;
std::cout << e.what() << std::endl;
}
return Z_2x1; return Z_2x1;
} }
} }
@ -157,9 +152,7 @@ public:
H1.setZero(); H1.setZero();
H2.setZero(); H2.setZero();
b.setZero(); b.setZero();
if (verbose_) { std::cerr << e.what() << std::endl;
std::cout << e.what() << std::endl;
}
} }
// Whiten the system if needed // Whiten the system if needed