added cout style print statements for similarity

release/4.3a0
nsrinivasan7 2015-04-12 15:38:40 -04:00
parent 226f6ad0ce
commit a4fac2ab62
2 changed files with 8 additions and 0 deletions

View File

@ -100,6 +100,12 @@ void Similarity3::print(const std::string& s) const {
std::cout << "s: " << scale() << std::endl;
}
std::ostream &operator<<(std::ostream &os, const Similarity3& p) {
os << "[" << p.rotation().xyz().transpose() << " " << p.translation().vector().transpose() << " " <<
p.scale() << "]\';";
return os;
}
Similarity3 Similarity3::ChartAtOrigin::Retract(const Vector7& v, ChartJacobian H) {
// Will retracting or localCoordinating R work if R is not a unit rotation?
// Also, how do we actually get s out? Seems like we need to store it somewhere.

View File

@ -70,6 +70,8 @@ public:
/// Print with optional string
void print(const std::string& s) const;
GTSAM_EXPORT friend std::ostream &operator<<(std::ostream &os, const Similarity3& p);
/// @}
/// @name Group
/// @{