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
12namespace 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 */
42 RobotHand& tcpPose(const Eigen::Matrix4f& tcpPose, VirtualRobot::RobotPtr robot);
43
44
45 /// The arm name helper. Set by `fileBySide()`.
46 std::optional<RobotNameHelper::Arm> arm;
47 };
48
49} // namespace armarx::viz
armarx::RobotArm RobotArm
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
std::optional< RobotNameHelper::Arm > arm
The arm name helper. Set by fileBySide().
Definition RobotHand.h:46
std::shared_ptr< class Robot > RobotPtr
Definition Bus.h:19
This file is part of ArmarX.