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 <RobotAPI/interface/units/GraspCandidateProviderInterface.h>
28 
29 #include <VirtualRobot/Robot.h>
30 
31 #include <memory>
32 
33 
34 namespace armarx
35 {
36  typedef std::shared_ptr<class GraspCandidateHelper> GraspCandidateHelperPtr;
37 
39  {
40  public:
41  GraspCandidateHelper(const grasping::GraspCandidatePtr& candidate, VirtualRobot::RobotPtr robot);
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 getGraspCandidate() const
62  {
63  return candidate;
64  }
65  void setGraspCandidate(const grasping::GraspCandidatePtr& p);
66 
67  Eigen::Vector3f defrost(const Vector3BasePtr& base) const
68  {
69  return Vector3Ptr::dynamicCast(base)->toEigen();
70  }
71  Eigen::Matrix4f defrost(const PoseBasePtr& base) const
72  {
73  return PosePtr::dynamicCast(base)->toEigen();
74  }
75 
77  {
78  return robot;
79  }
80 
81  private:
82  grasping::GraspCandidatePtr candidate;
84  };
85 }
armarx::GraspCandidateHelper::setGraspCandidate
void setGraspCandidate(const grasping::GraspCandidatePtr &p)
Definition: GraspCandidateHelper.cpp:96
armarx::GraspCandidateHelper::getGraspCandidate
const grasping::GraspCandidatePtr getGraspCandidate() const
Definition: GraspCandidateHelper.h:61
armarx::GraspCandidateHelper::getGraspPoseInRobotRoot
Eigen::Matrix4f getGraspPoseInRobotRoot() const
Definition: GraspCandidateHelper.cpp:39
armarx::GraspCandidateHelper::defrost
Eigen::Vector3f defrost(const Vector3BasePtr &base) const
Definition: GraspCandidateHelper.h:67
Pose.h
armarx::GraspCandidateHelper::isTopGrasp
bool isTopGrasp()
Definition: GraspCandidateHelper.cpp:85
armarx::GraspCandidateHelper::GraspCandidateHelper
GraspCandidateHelper()=default
armarx::GraspCandidateHelperPtr
std::shared_ptr< class GraspCandidateHelper > GraspCandidateHelperPtr
Definition: GraspCandidateHelper.h:36
armarx::GraspCandidateHelper::getGraspPositionInRobotRoot
Eigen::Vector3f getGraspPositionInRobotRoot() const
Definition: GraspCandidateHelper.cpp:59
armarx::GraspCandidateHelper::getGraspOrientationInRobotRoot
Eigen::Matrix3f getGraspOrientationInRobotRoot() const
Definition: GraspCandidateHelper.cpp:54
armarx::GraspCandidateHelper::getApproachVector
Eigen::Vector3f getApproachVector() const
Definition: GraspCandidateHelper.cpp:80
armarx::GraspCandidateHelper::defrost
Eigen::Matrix4f defrost(const PoseBasePtr &base) const
Definition: GraspCandidateHelper.h:71
armarx::GraspCandidateHelper
Definition: GraspCandidateHelper.h:38
armarx::GraspCandidateHelper::getGraspPositionInGlobal
Eigen::Vector3f getGraspPositionInGlobal() const
Definition: GraspCandidateHelper.cpp:75
armarx::GraspCandidateHelper::getPrePoseInRobotRoot
Eigen::Matrix4f getPrePoseInRobotRoot(float approachDistance) const
Definition: GraspCandidateHelper.cpp:49
armarx::GraspCandidateHelper::getRobot
const VirtualRobot::RobotPtr & getRobot() const
Definition: GraspCandidateHelper.h:76
armarx::GraspCandidateHelper::isSideGrasp
bool isSideGrasp()
Definition: GraspCandidateHelper.cpp:90
GfxTL::Matrix3f
MatrixXX< 3, 3, float > Matrix3f
Definition: MatrixXX.h:600
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::GraspCandidateHelper::getGraspPoseInGlobal
Eigen::Matrix4f getGraspPoseInGlobal() const
Definition: GraspCandidateHelper.cpp:64
armarx::GraspCandidateHelper::operator=
GraspCandidateHelper & operator=(GraspCandidateHelper &&)=default
armarx::GraspCandidateHelper::getGraspOrientationInGlobal
Eigen::Matrix3f getGraspOrientationInGlobal() const
Definition: GraspCandidateHelper.cpp:71
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18