BimanualGraspCandidateHelper.cpp
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
25
26#include <VirtualRobot/Robot.h>
27#include <VirtualRobot/math/Helpers.h>
28
30
31using namespace armarx;
32
34 const grasping::BimanualGraspCandidatePtr& candidate,
36 candidate(candidate), robot(robot)
37{
38 ARMARX_CHECK_NOT_NULL(candidate);
40}
41
42Eigen::Matrix4f
44{
45 const Eigen::Matrix4f curRobotPose = helper->robot->getGlobalPose();
46 const Eigen::Matrix4f graspPose = curRobotPose.inverse() * getGraspPoseInGlobal();
47 return graspPose;
48}
49
50Eigen::Matrix4f
52{
53 return math::Helpers::TranslatePose(getGraspPoseInRobotRoot(),
54 getApproachVector() * approachDistance);
55}
56
57Eigen::Matrix3f
62
63Eigen::Vector3f
68
69Eigen::Matrix4f
71{
72 const Eigen::Matrix4f oldRobotPose = helper->defrost(helper->candidate->robotPose);
73 return oldRobotPose * graspPose;
74}
75
76Eigen::Matrix3f
81
82Eigen::Vector3f
84{
85 return math::Helpers::GetPosition(getGraspPoseInGlobal());
86}
87
88Eigen::Vector3f
90{
91 return approachVector;
92}
BimanualGraspCandidateHelper(const grasping::BimanualGraspCandidatePtr &candidate, VirtualRobot::RobotPtr robot)
#define ARMARX_CHECK_NOT_NULL(ptr)
This macro evaluates whether ptr is not null and if it turns out to be false it will throw an Express...
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file offers overloads of toIce() and fromIce() functions for STL container types.
Eigen::Matrix4f getPrePoseInRobotRoot(float approachDistance) const