RobotHand.cpp
Go to the documentation of this file.
1 #include "RobotHand.h"
2 
4 
5 
6 namespace armarx::viz
7 {
8 
9  RobotHand& RobotHand::fileBySide(const std::string& side, RobotInfoNodePtr robotInfo)
10  {
11  ARMARX_CHECK_NOT_NULL(robotInfo);
12  RobotNameHelperPtr nh = RobotNameHelper::Create(robotInfo, nullptr);
13  return this->fileBySide(side, *nh);
14  }
15 
16  RobotHand& RobotHand::fileBySide(const std::string& side, const RobotNameHelper& nameHelper)
17  {
18  RobotNameHelper::Arm arm = nameHelper.getArm(side);
19  return this->fileByArm(arm);
20  }
21 
23  {
24  this->arm = arm;
25  this->file(arm.getHandModelPackage(), arm.getHandModelPath());
26  return *this;
27  }
28 
30  {
31  return this->fileByArm(arm.getArm());
32  }
33 
35  {
36  ARMARX_CHECK(arm) << "Set RobotHand::side() before setting the TCP pose.";
37  RobotNameHelper::RobotArm robotArm = arm->addRobot(robot);
38  this->pose(tcpPose * robotArm.getTcp2HandRootTransform());
39  return *this;
40  }
41 }
42 
43 
44 
45 
armarx::viz::RobotHand::fileBySide
RobotHand & fileBySide(const std::string &side, RobotInfoNodePtr robotInfo)
Set the robot file according the desired side.
Definition: RobotHand.cpp:9
armarx::viz::RobotHand::fileByArm
RobotHand & fileByArm(const RobotNameHelper::Arm &arm)
Definition: RobotHand.cpp:22
armarx::viz::Robot::file
Robot & file(std::string const &project, std::string const &filename)
Definition: Robot.h:15
armarx::Arm::getHandModelPackage
std::string getHandModelPackage() const
Definition: RobotNameHelper.cpp:278
ARMARX_CHECK_NOT_NULL
#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...
Definition: ExpressionException.h:206
armarx::RobotNameHelper
Definition: RobotNameHelper.h:147
RobotHand.h
ARMARX_CHECK
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
Definition: ExpressionException.h:82
armarx::viz::ElementOps< Robot, data::ElementRobot >::pose
Eigen::Matrix4f pose() const
Definition: ElementOps.h:179
armarx::RobotNameHelperPtr
std::shared_ptr< class RobotNameHelper > RobotNameHelperPtr
Definition: RobotNameHelper.h:34
armarx::RobotArm::getTcp2HandRootTransform
Eigen::Matrix4f getTcp2HandRootTransform() const
Definition: RobotNameHelper.cpp:365
armarx::RobotArm
Definition: RobotNameHelper.h:103
ExpressionException.h
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::viz::RobotHand
Left or right hand of a robot.
Definition: RobotHand.h:19
armarx::RobotNameHelper::Create
static RobotNameHelperPtr Create(const RobotInfoNodePtr &robotInfo, const StatechartProfilePtr &profile)
Definition: RobotNameHelper.cpp:96
armarx::Arm
Definition: RobotNameHelper.h:41
armarx::RobotArm::getArm
const Arm & getArm() const
Definition: RobotNameHelper.cpp:380
armarx::viz::RobotHand::arm
std::optional< RobotNameHelper::Arm > arm
The arm name helper. Set by fileBySide().
Definition: RobotHand.h:48
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:416
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
armarx::RobotNameHelper::getArm
Arm getArm(const std::string &side) const
Definition: RobotNameHelper.cpp:133
armarx::viz::RobotHand::tcpPose
RobotHand & tcpPose(const Eigen::Matrix4f &tcpPose, VirtualRobot::RobotPtr robot)
Set the pose of robotViz according to the given TCP pose.
Definition: RobotHand.cpp:34