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