Fixed printing
parent
fabde56642
commit
2ddc60063f
|
@ -57,6 +57,24 @@ namespace gtsam {
|
|||
|
||||
virtual ~BearingRangeFactor() {}
|
||||
|
||||
/** Print */
|
||||
virtual void print(const std::string& s = "") const {
|
||||
std::cout << s << ": BearingRangeFactor("
|
||||
<< (std::string) this->key1_ << ","
|
||||
<< (std::string) this->key2_ << ")\n";
|
||||
bearing_.print(" measured bearing");
|
||||
std::cout << " measured range: " << range_ << std::endl;
|
||||
this->noiseModel_->print(" noise model");
|
||||
}
|
||||
|
||||
/** equals */
|
||||
virtual bool equals(const NonlinearFactor<VALUES>& expected, double tol=1e-9) const {
|
||||
const This *e = dynamic_cast<const This*> (&expected);
|
||||
return e != NULL && Base::equals(*e, tol) &&
|
||||
fabs(this->range_ - e->range_) < tol &&
|
||||
this->bearing_.equals(e->bearing_, tol);
|
||||
}
|
||||
|
||||
/** h(x)-z -> between(z,h(x)) for Rot manifold */
|
||||
Vector evaluateError(const Pose& pose, const Point& point,
|
||||
boost::optional<Matrix&> H1, boost::optional<Matrix&> H2) const {
|
||||
|
@ -82,14 +100,6 @@ namespace gtsam {
|
|||
return std::make_pair(bearing_, range_);
|
||||
}
|
||||
|
||||
/** equals */
|
||||
virtual bool equals(const NonlinearFactor<VALUES>& expected, double tol=1e-9) const {
|
||||
const This *e = dynamic_cast<const This*> (&expected);
|
||||
return e != NULL && Base::equals(*e, tol) &&
|
||||
fabs(this->range_ - e->range_) < tol &&
|
||||
this->bearing_.equals(e->bearing_, tol);
|
||||
}
|
||||
|
||||
private:
|
||||
|
||||
/** Serialization function */
|
||||
|
|
|
@ -62,8 +62,11 @@ namespace gtsam {
|
|||
|
||||
/** print */
|
||||
virtual void print(const std::string& s) const {
|
||||
Base::print(s);
|
||||
measured_.print("measured");
|
||||
std::cout << s << ": BetweenFactor("
|
||||
<< (std::string) this->key1_ << ","
|
||||
<< (std::string) this->key2_ << ")\n";
|
||||
measured_.print(" measured");
|
||||
this->noiseModel_->print(" noise model");
|
||||
}
|
||||
|
||||
/** equals */
|
||||
|
|
|
@ -63,8 +63,9 @@ namespace gtsam {
|
|||
|
||||
/** print */
|
||||
virtual void print(const std::string& s) const {
|
||||
Base::print(s);
|
||||
prior_.print("prior");
|
||||
std::cout << s << ": PriorFactor(" << (std::string) this->key_ << ")\n";
|
||||
prior_.print(" prior");
|
||||
this->noiseModel_->print(" noise model");
|
||||
}
|
||||
|
||||
/** equals */
|
||||
|
|
Loading…
Reference in New Issue