GraspCandidateHelper.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2012-2016, High Performance Humanoid Technologies (H2T),
5  * Karlsruhe Institute of Technology (KIT), all rights reserved.
6  *
7  * ArmarX is free software; you can redistribute it and/or modify
8  * it under the terms of the GNU General Public License version 2 as
9  * published by the Free Software Foundation.
10  *
11  * ArmarX is distributed in the hope that it will be useful, but
12  * WITHOUT ANY WARRANTY; without even the implied warranty of
13  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  * GNU General Public License for more details.
15  *
16  * You should have received a copy of the GNU General Public License
17  * along with this program. If not, see <http://www.gnu.org/licenses/>.
18  *
19  * @author Simon Ottenhaus (simon dot ottenhaus at kit dot edu)
20  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
21  * GNU General Public License
22  */
23 
24 #pragma once
25 
26 #include <memory>
27 
28 #include <VirtualRobot/VirtualRobot.h>
29 
30 #include <RobotAPI/interface/units/GraspCandidateProviderInterface.h>
32 
33 namespace armarx
34 {
35  typedef std::shared_ptr<class GraspCandidateHelper> GraspCandidateHelperPtr;
36 
38  {
39  public:
40  GraspCandidateHelper(const grasping::GraspCandidatePtr& candidate,
42  GraspCandidateHelper() = default;
47 
49  Eigen::Matrix4f getPrePoseInRobotRoot(float approachDistance) const;
51  Eigen::Vector3f getGraspPositionInRobotRoot() const;
52 
55  Eigen::Vector3f getGraspPositionInGlobal() const;
56 
57  Eigen::Vector3f getApproachVector() const;
58  bool isTopGrasp();
59  bool isSideGrasp();
60 
61  const grasping::GraspCandidatePtr
63  {
64  return candidate;
65  }
66 
67  void setGraspCandidate(const grasping::GraspCandidatePtr& p);
68 
69  Eigen::Vector3f
70  defrost(const Vector3BasePtr& base) const
71  {
72  return Vector3Ptr::dynamicCast(base)->toEigen();
73  }
74 
76  defrost(const PoseBasePtr& base) const
77  {
78  return PosePtr::dynamicCast(base)->toEigen();
79  }
80 
82  getRobot() const
83  {
84  return robot;
85  }
86 
87  private:
88  grasping::GraspCandidatePtr candidate;
90  };
91 } // namespace armarx
armarx::GraspCandidateHelper::setGraspCandidate
void setGraspCandidate(const grasping::GraspCandidatePtr &p)
Definition: GraspCandidateHelper.cpp:111
armarx::GraspCandidateHelper::getGraspCandidate
const grasping::GraspCandidatePtr getGraspCandidate() const
Definition: GraspCandidateHelper.h:62
armarx::GraspCandidateHelper::getGraspPoseInRobotRoot
Eigen::Matrix4f getGraspPoseInRobotRoot() const
Definition: GraspCandidateHelper.cpp:42
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::GraspCandidateHelper::defrost
Eigen::Vector3f defrost(const Vector3BasePtr &base) const
Definition: GraspCandidateHelper.h:70
Pose.h
armarx::GraspCandidateHelper::isTopGrasp
bool isTopGrasp()
Definition: GraspCandidateHelper.cpp:99
armarx::GraspCandidateHelper::GraspCandidateHelper
GraspCandidateHelper()=default
armarx::GraspCandidateHelperPtr
std::shared_ptr< class GraspCandidateHelper > GraspCandidateHelperPtr
Definition: GraspCandidateHelper.h:35
armarx::GraspCandidateHelper::getGraspPositionInRobotRoot
Eigen::Vector3f getGraspPositionInRobotRoot() const
Definition: GraspCandidateHelper.cpp:66
armarx::GraspCandidateHelper::getGraspOrientationInRobotRoot
Eigen::Matrix3f getGraspOrientationInRobotRoot() const
Definition: GraspCandidateHelper.cpp:60
armarx::GraspCandidateHelper::getApproachVector
Eigen::Vector3f getApproachVector() const
Definition: GraspCandidateHelper.cpp:93
armarx::GraspCandidateHelper::defrost
Eigen::Matrix4f defrost(const PoseBasePtr &base) const
Definition: GraspCandidateHelper.h:76
armarx::GraspCandidateHelper
Definition: GraspCandidateHelper.h:37
armarx::GraspCandidateHelper::getGraspPositionInGlobal
Eigen::Vector3f getGraspPositionInGlobal() const
Definition: GraspCandidateHelper.cpp:87
armarx::GraspCandidateHelper::getPrePoseInRobotRoot
Eigen::Matrix4f getPrePoseInRobotRoot(float approachDistance) const
Definition: GraspCandidateHelper.cpp:53
armarx::GraspCandidateHelper::getRobot
const VirtualRobot::RobotPtr & getRobot() const
Definition: GraspCandidateHelper.h:82
armarx::GraspCandidateHelper::isSideGrasp
bool isSideGrasp()
Definition: GraspCandidateHelper.cpp:105
armarx::GraspCandidateHelper::getGraspPoseInGlobal
Eigen::Matrix4f getGraspPoseInGlobal() const
Definition: GraspCandidateHelper.cpp:72
armarx::GraspCandidateHelper::operator=
GraspCandidateHelper & operator=(GraspCandidateHelper &&)=default
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:649
armarx::GraspCandidateHelper::getGraspOrientationInGlobal
Eigen::Matrix3f getGraspOrientationInGlobal() const
Definition: GraspCandidateHelper.cpp:81
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19