Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Backport get_identity_pose #156

Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 2 additions & 1 deletion include/rviz_visual_tools/rviz_visual_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -994,7 +994,8 @@ 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();

/**
* \brief Test if two Eigen poses are close enough
Expand Down
16 changes: 16 additions & 0 deletions src/rviz_visual_tools.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down