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
8
9namespace armarx::skills
10{
11 namespace grasp_control::util
12 {
15 {
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
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
44 {
46
47 Eigen::Matrix4f targetPlatformPoseLocal = Eigen::Matrix4f::Identity();
48 targetPlatformPoseLocal(1, 3) += -190;
49
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
GetPlatformOffsetAfterObjectPutdownOutput GetGlobalPlatformPoseAfterObjectPutdown(const GetPlatformOffsetAfterObjectPutdownInput &in)
GetPlatformOffsetForObjectPutdownOutput GetGlobalPlatformPoseForObjectPutdown(const GetPlatformOffsetForObjectPutdownInput &in)
This file is part of ArmarX.