Skip to content

Commit

Permalink
New helper function getIdentityPose() (PickNikRobotics#122)
Browse files Browse the repository at this point in the history
  • Loading branch information
davetcoleman authored and Dale-Koenig committed Jun 5, 2020
1 parent 0c78ae2 commit 0c6b946
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 0 deletions.
1 change: 1 addition & 0 deletions include/rviz_visual_tools/rviz_visual_tools.h
Original file line number Diff line number Diff line change
Expand Up @@ -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
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

0 comments on commit 0c6b946

Please sign in to comment.