diff --git a/source/RobotAPI/libraries/core/FramedPose.cpp b/source/RobotAPI/libraries/core/FramedPose.cpp index 0cd53f085c58c3359d439fbfeacd2b50ba77560a..ff6bcc0ed75847d058ee63d1abc49ca8e614c511 100644 --- a/source/RobotAPI/libraries/core/FramedPose.cpp +++ b/source/RobotAPI/libraries/core/FramedPose.cpp @@ -220,7 +220,7 @@ namespace armarx string FramedDirection::output(const Ice::Current& c) const { std::stringstream s; - s << toEigen() << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); + s << toEigen().format(ArmarXEigenFormat) << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); return s.str(); } @@ -318,7 +318,8 @@ namespace armarx string FramedPose::output(const Ice::Current& c) const { std::stringstream s; - s << toEigen() << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); + const Eigen::IOFormat ArmarXEigenFormat(Eigen::StreamPrecision, 4, " ", "\n", "", ""); + s << toEigen().format(ArmarXEigenFormat) << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); return s.str(); } @@ -658,7 +659,7 @@ namespace armarx string FramedPosition::output(const Ice::Current& c) const { std::stringstream s; - s << toEigen() << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); + s << toEigen().format(ArmarXEigenFormat) << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); return s.str(); } @@ -728,7 +729,7 @@ namespace armarx string FramedOrientation::output(const Ice::Current& c) const { std::stringstream s; - s << toEigen() << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); + s << toEigen()/*.format(ArmarXEigenFormat)*/ << std::endl << "frame: " << getFrame() << (agent.empty() ? "" : (" agent: " + agent)); return s.str(); } diff --git a/source/RobotAPI/libraries/core/Pose.cpp b/source/RobotAPI/libraries/core/Pose.cpp index f6e8963d3ac67555c690e60df458bcf66595b4cf..cf2ef51c61f126f2e7dd25a79d68937fb91b505d 100644 --- a/source/RobotAPI/libraries/core/Pose.cpp +++ b/source/RobotAPI/libraries/core/Pose.cpp @@ -147,7 +147,7 @@ namespace armarx string Vector3::output(const Ice::Current& c) const { std::stringstream s; - s << toEigen(); + s << toEigen().format(ArmarXEigenFormat); return s.str(); } @@ -247,7 +247,7 @@ namespace armarx string Quaternion::output(const Ice::Current& c) const { std::stringstream s; - s << toEigen(); + s << toEigen()/*.format(ArmarXEigenFormat)*/; return s.str(); } @@ -328,7 +328,7 @@ namespace armarx string Pose::output(const Ice::Current& c) const { std::stringstream s; - s << toEigen(); + s << toEigen()/*.format(ArmarXEigenFormat)*/; return s.str(); } diff --git a/source/RobotAPI/libraries/core/Pose.h b/source/RobotAPI/libraries/core/Pose.h index a3c79e75050b949ff974922122f96e5c1c852ef5..6911f787073c25528b707b632444c638a55e766e 100644 --- a/source/RobotAPI/libraries/core/Pose.h +++ b/source/RobotAPI/libraries/core/Pose.h @@ -47,6 +47,9 @@ namespace armarx const VariantTypeId Pose = Variant::addTypeName("::armarx::PoseBase"); } + const Eigen::IOFormat ArmarXEigenFormat(Eigen::StreamPrecision, Eigen::DontAlignCols, " ", "\n", "", ""); + + /** * @brief The Vector2 class * @ingroup VariantsGrp