RobotHand.cpp
Go to the documentation of this file.
1#include "RobotHand.h"
2
4
5namespace armarx::viz
6{
7
9 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
17 RobotHand::fileBySide(const std::string& side, const RobotNameHelper& nameHelper)
18 {
19 RobotNameHelper::Arm arm = nameHelper.getArm(side);
20 return this->fileByArm(arm);
21 }
22
25 {
26 this->arm = arm;
27 this->file(arm.getHandModelPackage(), arm.getHandModelPath());
28 return *this;
29 }
30
33 {
34 return this->fileByArm(arm.getArm());
35 }
36
38 RobotHand::tcpPose(const Eigen::Matrix4f& tcpPose, VirtualRobot::RobotPtr robot)
39 {
40 ARMARX_CHECK(arm) << "Set RobotHand::side() before setting the TCP pose.";
41 RobotNameHelper::RobotArm robotArm = arm->addRobot(robot);
42 this->pose(tcpPose * robotArm.getTcp2HandRootTransform());
43 return *this;
44 }
45} // namespace armarx::viz
armarx::RobotArm RobotArm
Arm getArm(const std::string &side) const
static RobotNameHelperPtr Create(const RobotInfoNodePtr &robotInfo, const StatechartProfilePtr &profile)
Left or right hand of a robot.
Definition RobotHand.h:19
RobotHand & fileBySide(const std::string &side, RobotInfoNodePtr robotInfo)
Set the robot file according the desired side.
Definition RobotHand.cpp:9
RobotHand & fileByArm(const RobotNameHelper::Arm &arm)
Definition RobotHand.cpp:24
RobotHand & tcpPose(const Eigen::Matrix4f &tcpPose, VirtualRobot::RobotPtr robot)
Set the pose of robotViz according to the given TCP pose.
Definition RobotHand.cpp:38
RobotHand & fileByArm(const RobotNameHelper::RobotArm &arm)
Definition RobotHand.cpp:32
std::optional< RobotNameHelper::Arm > arm
The arm name helper. Set by fileBySide().
Definition RobotHand.h:46
Robot & file(std::string const &project, std::string const &filename)
Definition Robot.h:16
#define ARMARX_CHECK(expression)
Shortcut for ARMARX_CHECK_EXPRESSION.
#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 is part of ArmarX.
std::shared_ptr< class RobotNameHelper > RobotNameHelperPtr
std::string getHandModelPackage() const
Eigen::Matrix4f getTcp2HandRootTransform() const
const Arm & getArm() const