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
33namespace armarx
34{
35 typedef std::shared_ptr<class GraspCandidateHelper> GraspCandidateHelperPtr;
36
38 {
39 public:
40 GraspCandidateHelper(const grasping::GraspCandidatePtr& candidate,
47
48 Eigen::Matrix4f getGraspPoseInRobotRoot() const;
49 Eigen::Matrix4f getPrePoseInRobotRoot(float approachDistance) const;
50 Eigen::Matrix3f getGraspOrientationInRobotRoot() const;
51 Eigen::Vector3f getGraspPositionInRobotRoot() const;
52
53 Eigen::Matrix4f getGraspPoseInGlobal() const;
54 Eigen::Matrix3f getGraspOrientationInGlobal() const;
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
75 Eigen::Matrix4f
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
Eigen::Vector3f getApproachVector() const
Eigen::Vector3f getGraspPositionInRobotRoot() const
GraspCandidateHelper(GraspCandidateHelper &&)=default
Eigen::Matrix3f getGraspOrientationInRobotRoot() const
Eigen::Matrix4f getPrePoseInRobotRoot(float approachDistance) const
Eigen::Matrix4f getGraspPoseInGlobal() const
Eigen::Matrix3f getGraspOrientationInGlobal() const
void setGraspCandidate(const grasping::GraspCandidatePtr &p)
GraspCandidateHelper(const GraspCandidateHelper &)=default
Eigen::Matrix4f getGraspPoseInRobotRoot() const
Eigen::Vector3f getGraspPositionInGlobal() const
Eigen::Matrix4f defrost(const PoseBasePtr &base) const
const grasping::GraspCandidatePtr getGraspCandidate() const
GraspCandidateHelper & operator=(GraspCandidateHelper &&)=default
GraspCandidateHelper(const grasping::GraspCandidatePtr &candidate, VirtualRobot::RobotPtr robot)
GraspCandidateHelper & operator=(const GraspCandidateHelper &)=default
const VirtualRobot::RobotPtr & getRobot() const
Eigen::Vector3f defrost(const Vector3BasePtr &base) const
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
std::shared_ptr< class GraspCandidateHelper > GraspCandidateHelperPtr