RobotHand.h
Go to the documentation of this file.
1 #pragma once
2 
3 #include <optional>
4 
5 #include <VirtualRobot/VirtualRobot.h>
6 
7 #include <RobotAPI/interface/core/RobotState.h>
9 
10 #include "Robot.h"
11 
12 
13 namespace armarx::viz
14 {
15 
16  /**
17  * @brief Left or right hand of a robot.
18  */
19  class RobotHand : public Robot
20  {
21  public:
22 
23  using Robot::Robot;
24 
25  /**
26  * @brief Set the robot file according the desired side.
27  * @param side The side ("Left" or "Right", see `RobotNameHelper::LocationLeft, LocationRight`)
28  * @param robotInfo
29  * The robot info.
30  * You can get it from a RobotStateComponent: `robotStateComponent->getRobotInfo()`.
31  * If you do this in a loop, you should get the robot info just once before the loop.
32  */
33  RobotHand& fileBySide(const std::string& side, RobotInfoNodePtr robotInfo);
34  RobotHand& fileBySide(const std::string& side, const RobotNameHelper& nameHelper);
37 
38 
39  /**
40  * @brief Set the pose of `robotViz` according to the given TCP pose.
41  *
42  * You must specify the side beforehand using `fileBySide()`.
43  */
45 
46 
47  /// The arm name helper. Set by `fileBySide()`.
48  std::optional<RobotNameHelper::Arm> arm;
49 
50  };
51 
52 }
armarx::viz::RobotHand::fileBySide
RobotHand & fileBySide(const std::string &side, RobotInfoNodePtr robotInfo)
Set the robot file according the desired side.
Definition: RobotHand.cpp:9
Robot.h
armarx::viz::RobotHand::fileByArm
RobotHand & fileByArm(const RobotNameHelper::Arm &arm)
Definition: RobotHand.cpp:22
armarx::RobotNameHelper
Definition: RobotNameHelper.h:145
armarx::armem::human::Robot
@ Robot
Definition: util.h:14
armarx::viz::Robot
Definition: Robot.h:9
armarx::RobotArm
Definition: RobotNameHelper.h:101
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::Arm
Definition: RobotNameHelper.h:41
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:370
RobotNameHelper.h
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18
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