From 0c6b946945b1f7efba43b06ebbeebd728ad341b2 Mon Sep 17 00:00:00 2001 From: Dave Coleman Date: Wed, 21 Aug 2019 09:20:19 -0600 Subject: [PATCH 1/2] New helper function getIdentityPose() (#122) --- include/rviz_visual_tools/rviz_visual_tools.h | 1 + src/rviz_visual_tools.cpp | 16 ++++++++++++++++ 2 files changed, 17 insertions(+) diff --git a/include/rviz_visual_tools/rviz_visual_tools.h b/include/rviz_visual_tools/rviz_visual_tools.h index 640816e..e9ce208 100644 --- a/include/rviz_visual_tools/rviz_visual_tools.h +++ b/include/rviz_visual_tools/rviz_visual_tools.h @@ -995,6 +995,7 @@ a * Warning: when using this in a loop be sure to call trigger() at end * \param Pose to fill in */ static void generateEmptyPose(geometry_msgs::Pose& pose); + static geometry_msgs::Pose getIdentityPose(); /** * \brief Test if two Eigen poses are close enough diff --git a/src/rviz_visual_tools.cpp b/src/rviz_visual_tools.cpp index c9596a9..81a415c 100644 --- a/src/rviz_visual_tools.cpp +++ b/src/rviz_visual_tools.cpp @@ -2685,6 +2685,22 @@ void RvizVisualTools::generateEmptyPose(geometry_msgs::Pose& pose) pose.orientation.w = 1; } +geometry_msgs::Pose RvizVisualTools::getIdentityPose() +{ + geometry_msgs::Pose pose; + // Position + pose.position.x = 0; + pose.position.y = 0; + pose.position.z = 0; + + // Orientation on place + pose.orientation.x = 0; + pose.orientation.y = 0; + pose.orientation.z = 0; + pose.orientation.w = 1; + return pose; +} + bool RvizVisualTools::posesEqual(const Eigen::Isometry3d& pose1, const Eigen::Isometry3d& pose2, double threshold) { static const std::size_t NUM_VARS = 16; // size of eigen matrix From 15972a8bf338d1d031610394d7745628f323dc68 Mon Sep 17 00:00:00 2001 From: Dale Koenig Date: Fri, 5 Jun 2020 14:40:06 +0900 Subject: [PATCH 2/2] Deprecate generateEmptyPose --- include/rviz_visual_tools/rviz_visual_tools.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/include/rviz_visual_tools/rviz_visual_tools.h b/include/rviz_visual_tools/rviz_visual_tools.h index e9ce208..7e051d9 100644 --- a/include/rviz_visual_tools/rviz_visual_tools.h +++ b/include/rviz_visual_tools/rviz_visual_tools.h @@ -994,7 +994,7 @@ a * Warning: when using this in a loop be sure to call trigger() at end * \brief Create a pose of position (0,0,0) and quaternion (0,0,0,1) * \param Pose to fill in */ - static void generateEmptyPose(geometry_msgs::Pose& pose); + [[deprecated("Replaced with getIdentityPose() in future releases")]] static void generateEmptyPose(geometry_msgs::Pose& pose); static geometry_msgs::Pose getIdentityPose(); /**