diff --git a/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.cpp b/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.cpp index c4f221549de4e12a04e1a495e7a8448fa9c64b3e..3533eb02cc11c3598813f330e202e9b673155136 100644 --- a/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.cpp +++ b/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.cpp @@ -38,7 +38,8 @@ GraspCandidateHelper::GraspCandidateHelper(const grasping::GraspCandidatePtr& ca Eigen::Matrix4f GraspCandidateHelper::getGraspPoseInRobotRoot() const { - const Eigen::Matrix4f graspPose = getFramedPose().toRootEigen(robot); + const Eigen::Matrix4f curRobotPose = robot->getGlobalPose(); + const Eigen::Matrix4f graspPose = curRobotPose.inverse() * getGraspPoseInGlobal(); return graspPose; } @@ -57,18 +58,11 @@ Eigen::Vector3f GraspCandidateHelper::getGraspPositionInRobotRoot() const return math::Helpers::GetPosition(getGraspPoseInRobotRoot()); } -armarx::FramedPose GraspCandidateHelper::getFramedPose() const -{ - return armarx::FramedPose(candidate->graspPose->position, - candidate->graspPose->orientation, - candidate->sourceFrame, - robot->getName()); -} - Eigen::Matrix4f GraspCandidateHelper::getGraspPoseInGlobal() const { - auto grasp_pose = getFramedPose(); - return grasp_pose.toGlobalEigen(robot); + const Eigen::Matrix4f oldGraspPose = defrost(candidate->graspPose); + const Eigen::Matrix4f oldRobotPose = defrost(candidate->robotPose); + return oldRobotPose * oldGraspPose; } Eigen::Matrix3f GraspCandidateHelper::getGraspOrientationInGlobal() const { diff --git a/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h b/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h index 6c9ba617bc511278c77bc147eabb2ac18abc3b19..050958f91cb13e5ad34f1a87110e759bc5402b1e 100644 --- a/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h +++ b/source/RobotAPI/libraries/GraspingUtility/GraspCandidateHelper.h @@ -30,7 +30,6 @@ #include <VirtualRobot/Robot.h> #include <RobotAPI/libraries/core/Pose.h> -#include <RobotAPI/libraries/core/FramedPose.h> namespace armarx { @@ -51,7 +50,6 @@ namespace armarx Eigen::Matrix3f getGraspOrientationInRobotRoot() const; Eigen::Vector3f getGraspPositionInRobotRoot() const; - armarx::FramedPose getFramedPose() const; Eigen::Matrix4f getGraspPoseInGlobal() const; Eigen::Matrix3f getGraspOrientationInGlobal() const; Eigen::Vector3f getGraspPositionInGlobal() const;