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 namespace armarx::viz
13 {
14 
15  /**
16  * @brief Left or right hand of a robot.
17  */
18  class RobotHand : public Robot
19  {
20  public:
21  using Robot::Robot;
22 
23  /**
24  * @brief Set the robot file according the desired side.
25  * @param side The side ("Left" or "Right", see `RobotNameHelper::LocationLeft, LocationRight`)
26  * @param robotInfo
27  * The robot info.
28  * You can get it from a RobotStateComponent: `robotStateComponent->getRobotInfo()`.
29  * If you do this in a loop, you should get the robot info just once before the loop.
30  */
31  RobotHand& fileBySide(const std::string& side, RobotInfoNodePtr robotInfo);
32  RobotHand& fileBySide(const std::string& side, const RobotNameHelper& nameHelper);
35 
36 
37  /**
38  * @brief Set the pose of `robotViz` according to the given TCP pose.
39  *
40  * You must specify the side beforehand using `fileBySide()`.
41  */
43 
44 
45  /// The arm name helper. Set by `fileBySide()`.
46  std::optional<RobotNameHelper::Arm> arm;
47  };
48 
49 } // namespace armarx::viz
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:24
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:650
armarx::RobotNameHelper
Definition: RobotNameHelper.h:143
armarx::armem::human::Robot
@ Robot
Definition: util.h:17
armarx::viz::Robot
Definition: Robot.h:10
armarx::RobotArm
Definition: RobotNameHelper.h:99
armarx::viz::RobotHand
Left or right hand of a robot.
Definition: RobotHand.h:18
armarx::Arm
Definition: RobotNameHelper.h:39
armarx::viz::RobotHand::arm
std::optional< RobotNameHelper::Arm > arm
The arm name helper. Set by fileBySide().
Definition: RobotHand.h:46
armarx::viz
This file is part of ArmarX.
Definition: ArVizStorage.cpp:418
RobotNameHelper.h
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19
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:38