PutdownObjectUtil.cpp
Go to the documentation of this file.
1
#include "
PutdownObjectUtil.h
"
2
3
#include <VirtualRobot/Grasping/GraspSet.h>
4
#include <VirtualRobot/ManipulationObject.h>
5
#include <VirtualRobot/RobotNodeSet.h>
6
7
#include <
RobotAPI/libraries/core/FramedPose.h
>
8
9
namespace
armarx::skills
10
{
11
namespace
grasp_control::util
12
{
13
GetPlatformOffsetForObjectPutdownOutput
14
GetGlobalPlatformPoseForObjectPutdown
(
const
GetPlatformOffsetForObjectPutdownInput
& in)
15
{
16
GetPlatformOffsetForObjectPutdownOutput
out;
17
18
auto
tcpPoseLocal = in.
synchronizedRobot
.getRobotNode(in.
tcpName
)->getPoseInRootFrame();
19
Eigen::Matrix4f targetPlatformPoseLocal = Eigen::Matrix4f::Identity();
20
21
targetPlatformPoseLocal(1, 3) += 190;
22
if
(tcpPoseLocal(0, 3) < 0)
// Left Hand
23
{
24
targetPlatformPoseLocal(0, 3) += 0;
25
}
26
else
27
{
28
targetPlatformPoseLocal(0, 3) += -0;
29
}
30
31
out.
platformGlobalPose
=
32
in.
synchronizedRobot
.getRootNode()->getGlobalPose() * targetPlatformPoseLocal;
33
out.
distanceToDrive
=
34
(in.
synchronizedRobot
.getRootNode()->getGlobalPose().block<3, 1>(0, 3) -
35
out.
platformGlobalPose
.block<3, 1>(0, 3))
36
.norm();
// only calc cartesian distance
37
38
//ARMARX_INFO << "In order to putdown an object the robot should drive from " << in.synchronizedRobot.getRootNode()->getGlobalPose() << " to " << out.platformGlobalPose << "(distance: " << out.distanceToDrive << ").";
39
return
out;
40
}
41
42
GetPlatformOffsetAfterObjectPutdownOutput
43
GetGlobalPlatformPoseAfterObjectPutdown
(
const
GetPlatformOffsetAfterObjectPutdownInput
& in)
44
{
45
GetPlatformOffsetAfterObjectPutdownOutput
out;
46
47
Eigen::Matrix4f targetPlatformPoseLocal = Eigen::Matrix4f::Identity();
48
targetPlatformPoseLocal(1, 3) += -190;
49
50
out.
platformGlobalPose
=
51
in.
synchronizedRobot
.getRootNode()->getGlobalPose() * targetPlatformPoseLocal;
52
out.
distanceToDrive
=
53
(in.
synchronizedRobot
.getRootNode()->getGlobalPose().block<3, 1>(0, 3) -
54
out.
platformGlobalPose
.block<3, 1>(0, 3))
55
.norm();
// only calc cartesian distance
56
57
return
out;
58
}
59
}
// namespace grasp_control::util
60
}
// namespace armarx::skills
FramedPose.h
PutdownObjectUtil.h
armarx::skills::grasp_control::util
Definition
GraspObjectUtil.cpp:12
armarx::skills::grasp_control::util::GetGlobalPlatformPoseAfterObjectPutdown
GetPlatformOffsetAfterObjectPutdownOutput GetGlobalPlatformPoseAfterObjectPutdown(const GetPlatformOffsetAfterObjectPutdownInput &in)
Definition
PutdownObjectUtil.cpp:43
armarx::skills::grasp_control::util::GetGlobalPlatformPoseForObjectPutdown
GetPlatformOffsetForObjectPutdownOutput GetGlobalPlatformPoseForObjectPutdown(const GetPlatformOffsetForObjectPutdownInput &in)
Definition
PutdownObjectUtil.cpp:14
armarx::skills
This file is part of ArmarX.
Definition
PeriodicUpdateWidget.cpp:12
armarx::skills::grasp_control::util::GetPlatformOffsetAfterObjectPutdownInput
Definition
PutdownObjectUtil.h:26
armarx::skills::grasp_control::util::GetPlatformOffsetAfterObjectPutdownInput::synchronizedRobot
VirtualRobot::Robot & synchronizedRobot
Definition
PutdownObjectUtil.h:27
armarx::skills::grasp_control::util::GetPlatformOffsetAfterObjectPutdownOutput
Definition
PutdownObjectUtil.h:31
armarx::skills::grasp_control::util::GetPlatformOffsetAfterObjectPutdownOutput::platformGlobalPose
Eigen::Matrix4f platformGlobalPose
Definition
PutdownObjectUtil.h:32
armarx::skills::grasp_control::util::GetPlatformOffsetAfterObjectPutdownOutput::distanceToDrive
float distanceToDrive
Definition
PutdownObjectUtil.h:33
armarx::skills::grasp_control::util::GetPlatformOffsetForObjectPutdownInput
Definition
PutdownObjectUtil.h:11
armarx::skills::grasp_control::util::GetPlatformOffsetForObjectPutdownInput::tcpName
std::string tcpName
Definition
PutdownObjectUtil.h:13
armarx::skills::grasp_control::util::GetPlatformOffsetForObjectPutdownInput::synchronizedRobot
VirtualRobot::Robot & synchronizedRobot
Definition
PutdownObjectUtil.h:12
armarx::skills::grasp_control::util::GetPlatformOffsetForObjectPutdownOutput
Definition
PutdownObjectUtil.h:17
armarx::skills::grasp_control::util::GetPlatformOffsetForObjectPutdownOutput::platformGlobalPose
Eigen::Matrix4f platformGlobalPose
Definition
PutdownObjectUtil.h:18
armarx::skills::grasp_control::util::GetPlatformOffsetForObjectPutdownOutput::distanceToDrive
float distanceToDrive
Definition
PutdownObjectUtil.h:19
RobotSkillTemplates
libraries
skill_grasp_object
putdown
util
PutdownObjectUtil.cpp
Generated by
1.13.2