types.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * ArmarX is free software; you can redistribute it and/or modify
5  * it under the terms of the GNU General Public License version 2 as
6  * published by the Free Software Foundation.
7  *
8  * ArmarX is distributed in the hope that it will be useful, but
9  * WITHOUT ANY WARRANTY; without even the implied warranty of
10  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
11  * GNU General Public License for more details.
12  *
13  * You should have received a copy of the GNU General Public License
14  * along with this program. If not, see <http://www.gnu.org/licenses/>.
15  *
16  * @author Fabian Reister ( fabian dot reister at kit dot edu )
17  * @date 2021
18  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
19  * GNU General Public License
20  */
21 
22 #pragma once
23 
24 #include <filesystem>
25 #include <map>
26 #include <optional>
27 #include <vector>
28 
29 #include <Eigen/Geometry>
30 
33 
36 #include <RobotAPI/libraries/armem_robot_state/aron/Proprioception.aron.generated.h>
37 #include <RobotAPI/libraries/armem_robot_state/aron/RobotDescription.aron.generated.h>
38 
40 {
41 
42  namespace description
43  {
45  {
46  // DateTime timestamp;
47 
48  std::string name;
49  PackagePath xml{"", std::filesystem::path("")};
50 
51  arondto::RobotDescriptionVisualization visualization;
52  arondto::RobotInfo info;
53  std::optional<
54  std::map<std::string, std::vector<armarx::armem::arondto::ManipulationCapability>>>
55  manipulationCapabilities = std::nullopt;
56  };
57 
58  using RobotDescriptions = std::vector<RobotDescription>;
59 
60  std::ostream& operator<<(std::ostream& os, const RobotDescription& rhs);
61 
62 
63  } // namespace description
64 
65  struct Twist
66  {
67  Eigen::Vector3f linear{Eigen::Vector3f::Zero()};
68  Eigen::Vector3f angular{Eigen::Vector3f::Zero()};
69  };
70 
72  {
74  };
75 
76  namespace proprioception
77  {
78 
79  struct ForceTorque
80  {
81  Eigen::Vector3f force;
82  Eigen::Vector3f gravityCompensatedForce;
83  Eigen::Vector3f torque;
84  Eigen::Vector3f gravityCompensatedTorque;
85  };
86 
87  struct JointState
88  {
89  std::string name;
90  float position;
91  };
92 
93  } // namespace proprioception
94 
95  namespace exteroception
96  {
97 
98  struct ToF
99  {
100  using DepthMatrixType = Eigen::MatrixXf; // FIXME uint16
101  using DepthSigmaMatrixType = Eigen::MatrixXf; // FIXME uint8
102  using TargetDetectedMatrixType = Eigen::MatrixXf; // FIXME uint8
103 
107 
108  std::string frame;
109  };
110 
111  } // namespace exteroception
112 
113  struct RobotState
114  {
115  using JointMap = std::map<std::string, float>;
116  using Pose = Eigen::Isometry3f;
117 
119 
122 
123  std::optional<armarx::armem::arondto::Proprioception> proprioception;
124  };
125 
126  struct Robot
127  {
129  std::string instance;
130 
132 
134 
135  std::string name() const;
136  };
137 
138  using Robots = std::vector<Robot>;
139  using RobotStates = std::vector<RobotState>;
140 
141  namespace localization
142  {
143 
145  {
146  std::string parentFrame;
147  std::string frame;
148 
149  std::string agent;
150 
152  };
153 
154  struct Transform
155  {
157 
158  Eigen::Isometry3f transform = Eigen::Isometry3f::Identity();
159 
160  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
161  };
162  } // namespace localization
163 
164 
165 } // namespace armarx::armem::robot_state
armarx::armem::robot_state::description::RobotDescription
Definition: types.h:44
armarx::armem::robot_state::exteroception::ToF::frame
std::string frame
Definition: types.h:108
armarx::armem::robot_state::Robot
Definition: types.h:126
armarx::armem::robot_state::description::operator<<
std::ostream & operator<<(std::ostream &os, const RobotDescription &rhs)
Definition: types.cpp:9
DateTime.h
armarx::armem::robot_state::RobotState
Definition: types.h:113
armarx::armem::robot_state::RobotState::JointMap
std::map< std::string, float > JointMap
Definition: types.h:115
armarx::armem::robot_state
Definition: RobotStatePredictionClient.cpp:42
armarx::armem::robot_state::proprioception::JointState::name
std::string name
Definition: types.h:89
armarx::armem::robot_state::exteroception::ToF
Definition: types.h:98
armarx::armem::robot_state::localization::Transform
Definition: types.h:154
armarx::armem::robot_state::description::RobotDescription::xml
PackagePath xml
Definition: types.h:49
armarx::armem::robot_state::RobotState::jointMap
JointMap jointMap
Definition: types.h:121
armarx::armem::robot_state::RobotState::timestamp
DateTime timestamp
Definition: types.h:118
armarx::armem::robot_state::proprioception::JointState
Definition: types.h:87
armarx::armem::robot_state::proprioception::ForceTorque::torque
Eigen::Vector3f torque
Definition: types.h:83
armarx::armem::robot_state::proprioception::ForceTorque::force
Eigen::Vector3f force
Definition: types.h:81
armarx::armem::robot_state::exteroception::ToF::TargetDetectedMatrixType
Eigen::MatrixXf TargetDetectedMatrixType
Definition: types.h:102
armarx::armem::robot_state::exteroception::ToF::depth
DepthMatrixType depth
Definition: types.h:104
armarx::armem::robot_state::Twist
Definition: types.h:65
armarx::armem::robot_state::RobotStates
std::vector< RobotState > RobotStates
Definition: forward_declarations.h:53
armarx::armem::robot_state::Robots
std::vector< Robot > Robots
Definition: forward_declarations.h:52
armarx::armem::robot_state::PlatformState::twist
Twist twist
Definition: types.h:73
armarx::armem::robot_state::localization::TransformHeader::parentFrame
std::string parentFrame
Definition: types.h:146
armarx::armem::robot_state::Robot::timestamp
DateTime timestamp
Definition: types.h:133
armarx::armem::robot_state::proprioception::ForceTorque::gravityCompensatedTorque
Eigen::Vector3f gravityCompensatedTorque
Definition: types.h:84
GfxTL::Identity
void Identity(MatrixXX< N, N, T > *a)
Definition: MatrixXX.h:523
armarx::armem::robot_state::proprioception::JointState::position
float position
Definition: types.h:90
armarx::armem::robot_state::Robot::name
std::string name() const
Definition: types.cpp:20
armarx::armem::robot_state::Robot::config
RobotState config
Definition: types.h:131
armarx::armem::robot_state::RobotState::proprioception
std::optional< armarx::armem::arondto::Proprioception > proprioception
Definition: types.h:123
ObjectID.h
armarx::armem::robot_state::description::RobotDescriptions
std::vector< RobotDescription > RobotDescriptions
Definition: forward_declarations.h:46
armarx::armem::robot_state::localization::TransformHeader::agent
std::string agent
Definition: types.h:149
armarx::armem::robot_state::exteroception::ToF::sigma
DepthSigmaMatrixType sigma
Definition: types.h:105
armarx::armem::robot_state::localization::Transform::transform
Eigen::Isometry3f transform
Definition: types.h:158
armarx::armem::robot_state::description::RobotDescription::visualization
arondto::RobotDescriptionVisualization visualization
Definition: types.h:51
armarx::armem::robot_state::exteroception::ToF::DepthSigmaMatrixType
Eigen::MatrixXf DepthSigmaMatrixType
Definition: types.h:101
armarx::armem::robot_state::RobotState::globalPose
Pose globalPose
Definition: types.h:120
armarx::armem::robot_state::localization::TransformHeader::frame
std::string frame
Definition: types.h:147
armarx::armem::robot_state::Twist::angular
Eigen::Vector3f angular
Definition: types.h:68
armarx::armem::robot_state::Robot::instance
std::string instance
Definition: types.h:129
armarx::armem::robot_state::PlatformState
Definition: types.h:71
armarx::armem::robot_state::localization::Transform::header
TransformHeader header
Definition: types.h:156
armarx::armem::robot_state::Twist::linear
Eigen::Vector3f linear
Definition: types.h:67
armarx::core::time::DateTime
Represents a point in time.
Definition: DateTime.h:24
armarx::armem::robot_state::proprioception::ForceTorque
Definition: types.h:79
armarx::armem::robot_state::RobotState::Pose
Eigen::Isometry3f Pose
Definition: types.h:116
armarx::armem::robot_state::description::RobotDescription::name
std::string name
Definition: types.h:48
armarx::armem::robot_state::localization::TransformHeader
Definition: types.h:144
armarx::armem::robot_state::exteroception::ToF::targetDetected
TargetDetectedMatrixType targetDetected
Definition: types.h:106
Time.h
armarx::armem::robot_state::description::RobotDescription::manipulationCapabilities
std::optional< std::map< std::string, std::vector< armarx::armem::arondto::ManipulationCapability > > > manipulationCapabilities
Definition: types.h:55
armarx::PackagePath
Definition: PackagePath.h:55
armarx::armem::robot_state::exteroception::ToF::DepthMatrixType
Eigen::MatrixXf DepthMatrixType
Definition: types.h:100
armarx::armem::robot_state::proprioception::ForceTorque::gravityCompensatedForce
Eigen::Vector3f gravityCompensatedForce
Definition: types.h:82
armarx::armem::robot_state::description::RobotDescription::info
arondto::RobotInfo info
Definition: types.h:52
armarx::armem::robot_state::Robot::description
description::RobotDescription description
Definition: types.h:128
armarx::armem::robot_state::localization::TransformHeader::timestamp
armem::Time timestamp
Definition: types.h:151
PackagePath.h