Fixed print when no noise model

release/4.3a0
Frank Dellaert 2019-05-31 20:10:44 -04:00
parent 1a29ab5533
commit 5a819645a4
1 changed files with 8 additions and 2 deletions

View File

@ -18,6 +18,8 @@
#include <gtsam/nonlinear/NonlinearFactor.h>
#include <gtsam/base/Testable.h>
#include <string>
namespace gtsam {
/**
@ -70,10 +72,14 @@ namespace gtsam {
/** implement functions needed for Testable */
/** print */
virtual void print(const std::string& s, const KeyFormatter& keyFormatter = DefaultKeyFormatter) const {
virtual void print(const std::string& s, const KeyFormatter& keyFormatter =
DefaultKeyFormatter) const {
std::cout << s << "PriorFactor on " << keyFormatter(this->key()) << "\n";
traits<T>::Print(prior_, " prior mean: ");
this->noiseModel_->print(" noise model: ");
if (this->noiseModel_)
this->noiseModel_->print(" noise model: ");
else
std::cout << "no noise model" << std::endl;
}
/** equals */