Skip to content

Commit

Permalink
Format ICP metadata using IOFormat in full precision
Browse files Browse the repository at this point in the history
  • Loading branch information
chambbj committed May 26, 2020
1 parent 8379134 commit 993e8b8
Showing 1 changed file with 11 additions and 4 deletions.
15 changes: 11 additions & 4 deletions filters/IterativeClosestPoint.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -284,11 +284,18 @@ PointViewPtr IterativeClosestPoint::icp(PointViewPtr fixed,

// Populate metadata nodes to capture the final transformation, convergence
// status, and MSE.
Eigen::IOFormat MetadataFmt(Eigen::FullPrecision, Eigen::DontAlignCols,
" ", " ", "", "", "", "");
MetadataNode root = getMetadata();
root.add("transform", Eigen::MatrixXd(final_transformation.cast<double>()));
root.add("composed",
Eigen::MatrixXd(composed_transformation.cast<double>()));
root.add("centroid", Eigen::MatrixXd(centroid.cast<double>()));
std::stringstream ss;
ss << final_transformation.format(MetadataFmt);
root.add("transform", ss.str());
ss.str("");
ss << composed_transformation.format(MetadataFmt);
root.add("composed", ss.str());
ss.str("");
ss << centroid.format(MetadataFmt);
root.add("centroid", ss.str());
root.add("converged", converged);
root.add("fitness", mse);

Expand Down

0 comments on commit 993e8b8

Please sign in to comment.