Better print

release/4.3a0
Frank 2016-01-27 11:50:32 -08:00
parent d39759d8c8
commit e8565d27f7
1 changed files with 12 additions and 8 deletions

View File

@ -124,17 +124,21 @@ public:
//// return measurement - bias_gyro_temp - R_G_to_I * w_earth_rate_G; //// return measurement - bias_gyro_temp - R_G_to_I * w_earth_rate_G;
// } // }
/// @} /// @}
/// @name Testable /// @name Testable
/// @{ /// @{
/// print with optional string /// ostream operator
void print(const std::string& s = "") const { GTSAM_EXPORT friend std::ostream& operator<<(std::ostream& os,
// explicit printing for now. const ConstantBias& bias) {
std::cout << s + ".Acc [" << biasAcc_.transpose() << "]" << std::endl; os << "acc = " << Point3(bias.accelerometer());
std::cout << s + ".Gyro [" << biasGyro_.transpose() << "]" << std::endl; os << " gyro = " << Point3(bias.gyroscope());
return os;
} }
/// print with optional string
void print(const std::string& s = "") const { std::cout << s << *this; }
/** equality up to tolerance */ /** equality up to tolerance */
inline bool equals(const ConstantBias& expected, double tol = 1e-5) const { inline bool equals(const ConstantBias& expected, double tol = 1e-5) const {
return equal_with_abs_tol(biasAcc_, expected.biasAcc_, tol) return equal_with_abs_tol(biasAcc_, expected.biasAcc_, tol)