Merge pull request #468 from borglab/feature/imu-default-string
Default string value for printing Imu factorsrelease/4.3a0
commit
5b48e4123f
|
@ -167,10 +167,11 @@ gtsam::NonlinearFactor::shared_ptr CombinedImuFactor::clone() const {
|
|||
//------------------------------------------------------------------------------
|
||||
void CombinedImuFactor::print(const string& s,
|
||||
const KeyFormatter& keyFormatter) const {
|
||||
cout << s << "CombinedImuFactor(" << keyFormatter(this->key1()) << ","
|
||||
<< keyFormatter(this->key2()) << "," << keyFormatter(this->key3()) << ","
|
||||
<< keyFormatter(this->key4()) << "," << keyFormatter(this->key5()) << ","
|
||||
<< keyFormatter(this->key6()) << ")\n";
|
||||
cout << (s == "" ? s : s + "\n") << "CombinedImuFactor("
|
||||
<< keyFormatter(this->key1()) << "," << keyFormatter(this->key2()) << ","
|
||||
<< keyFormatter(this->key3()) << "," << keyFormatter(this->key4()) << ","
|
||||
<< keyFormatter(this->key5()) << "," << keyFormatter(this->key6())
|
||||
<< ")\n";
|
||||
_PIM_.print(" preintegrated measurements:");
|
||||
this->noiseModel_->print(" noise model: ");
|
||||
}
|
||||
|
|
|
@ -303,8 +303,8 @@ public:
|
|||
GTSAM_EXPORT friend std::ostream& operator<<(std::ostream& os,
|
||||
const CombinedImuFactor&);
|
||||
/// print
|
||||
void print(const std::string& s, const KeyFormatter& keyFormatter =
|
||||
DefaultKeyFormatter) const override;
|
||||
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||
DefaultKeyFormatter) const override;
|
||||
|
||||
/// equals
|
||||
bool equals(const NonlinearFactor& expected, double tol = 1e-9) const override;
|
||||
|
|
|
@ -130,10 +130,10 @@ std::ostream& operator<<(std::ostream& os, const ImuFactor& f) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
void ImuFactor::print(const string& s, const KeyFormatter& keyFormatter) const {
|
||||
cout << s << "ImuFactor(" << keyFormatter(this->key1()) << ","
|
||||
<< keyFormatter(this->key2()) << "," << keyFormatter(this->key3()) << ","
|
||||
<< keyFormatter(this->key4()) << "," << keyFormatter(this->key5())
|
||||
<< ")\n";
|
||||
cout << (s == "" ? s : s + "\n") << "ImuFactor(" << keyFormatter(this->key1())
|
||||
<< "," << keyFormatter(this->key2()) << "," << keyFormatter(this->key3())
|
||||
<< "," << keyFormatter(this->key4()) << "," << keyFormatter(this->key5())
|
||||
<< ")\n";
|
||||
cout << *this << endl;
|
||||
}
|
||||
|
||||
|
@ -226,9 +226,9 @@ std::ostream& operator<<(std::ostream& os, const ImuFactor2& f) {
|
|||
//------------------------------------------------------------------------------
|
||||
void ImuFactor2::print(const string& s,
|
||||
const KeyFormatter& keyFormatter) const {
|
||||
cout << s << "ImuFactor2(" << keyFormatter(this->key1()) << ","
|
||||
<< keyFormatter(this->key2()) << "," << keyFormatter(this->key3())
|
||||
<< ")\n";
|
||||
cout << (s == "" ? s : s + "\n") << "ImuFactor2("
|
||||
<< keyFormatter(this->key1()) << "," << keyFormatter(this->key2()) << ","
|
||||
<< keyFormatter(this->key3()) << ")\n";
|
||||
cout << *this << endl;
|
||||
}
|
||||
|
||||
|
|
|
@ -205,8 +205,8 @@ public:
|
|||
/// @name Testable
|
||||
/// @{
|
||||
GTSAM_EXPORT friend std::ostream& operator<<(std::ostream& os, const ImuFactor&);
|
||||
void print(const std::string& s, const KeyFormatter& keyFormatter =
|
||||
DefaultKeyFormatter) const override;
|
||||
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||
DefaultKeyFormatter) const override;
|
||||
bool equals(const NonlinearFactor& expected, double tol = 1e-9) const override;
|
||||
/// @}
|
||||
|
||||
|
@ -283,8 +283,8 @@ public:
|
|||
/// @name Testable
|
||||
/// @{
|
||||
GTSAM_EXPORT friend std::ostream& operator<<(std::ostream& os, const ImuFactor2&);
|
||||
void print(const std::string& s, const KeyFormatter& keyFormatter =
|
||||
DefaultKeyFormatter) const override;
|
||||
void print(const std::string& s = "", const KeyFormatter& keyFormatter =
|
||||
DefaultKeyFormatter) const override;
|
||||
bool equals(const NonlinearFactor& expected, double tol = 1e-9) const override;
|
||||
/// @}
|
||||
|
||||
|
|
|
@ -26,12 +26,11 @@ using namespace std;
|
|||
namespace gtsam {
|
||||
|
||||
void PreintegratedRotationParams::print(const string& s) const {
|
||||
cout << s << endl;
|
||||
cout << (s == "" ? s : s + "\n") << endl;
|
||||
cout << "gyroscopeCovariance:\n[\n" << gyroscopeCovariance << "\n]" << endl;
|
||||
if (omegaCoriolis)
|
||||
cout << "omegaCoriolis = (" << omegaCoriolis->transpose() << ")" << endl;
|
||||
if (body_P_sensor)
|
||||
body_P_sensor->print("body_P_sensor");
|
||||
if (body_P_sensor) body_P_sensor->print("body_P_sensor");
|
||||
}
|
||||
|
||||
bool PreintegratedRotationParams::equals(
|
||||
|
|
|
@ -46,7 +46,7 @@ ostream& operator<<(ostream& os, const PreintegrationBase& pim) {
|
|||
|
||||
//------------------------------------------------------------------------------
|
||||
void PreintegrationBase::print(const string& s) const {
|
||||
cout << s << *this << endl;
|
||||
cout << (s == "" ? s : s + "\n") << *this << endl;
|
||||
}
|
||||
|
||||
//------------------------------------------------------------------------------
|
||||
|
|
|
@ -116,7 +116,7 @@ class GTSAM_EXPORT PreintegrationBase {
|
|||
/// @name Testable
|
||||
/// @{
|
||||
GTSAM_EXPORT friend std::ostream& operator<<(std::ostream& os, const PreintegrationBase& pim);
|
||||
virtual void print(const std::string& s) const;
|
||||
virtual void print(const std::string& s="") const;
|
||||
/// @}
|
||||
|
||||
/// @name Main functionality
|
||||
|
|
Loading…
Reference in New Issue