aron_conversions.cpp
Go to the documentation of this file.
1 #include "aron_conversions.h"
2 
4 
5 #include <RobotAPI/libraries/armem_robot_state/aron/Exteroception.aron.generated.h>
6 #include <RobotAPI/libraries/armem_robot_state/aron/Proprioception.aron.generated.h>
7 #include <RobotAPI/libraries/armem_robot_state/aron/Transform.aron.generated.h>
10 
12 {
13 
14  /* Transform */
15 
16  void
17  fromAron(const arondto::Transform& dto, Transform& bo)
18  {
19  fromAron(dto.header, bo.header);
20  aron::fromAron(dto.transform, bo.transform);
21  }
22 
23  void
24  toAron(arondto::Transform& dto, const Transform& bo)
25  {
26  toAron(dto.header, bo.header);
27  aron::toAron(dto.transform, bo.transform);
28  }
29 
30  /* TransformHeader */
31 
32  void
33  toAron(arondto::TransformHeader& dto, const TransformHeader& bo)
34  {
35  aron::toAron(dto.parentFrame, bo.parentFrame);
36  aron::toAron(dto.frame, bo.frame);
37  aron::toAron(dto.agent, bo.agent);
38  aron::toAron(dto.timestamp, bo.timestamp);
39  }
40 
41  void
42  fromAron(const arondto::TransformHeader& dto, TransformHeader& bo)
43  {
44  aron::fromAron(dto.parentFrame, bo.parentFrame);
45  aron::fromAron(dto.frame, bo.frame);
46  aron::fromAron(dto.agent, bo.agent);
47  aron::fromAron(dto.timestamp, bo.timestamp);
48  }
49 } // namespace armarx::armem::robot_state::localization
50 
52 {
53  void
54  fromAron(const armarx::armem::prop::arondto::Platform& dto, robot_state::PlatformState& bo)
55  {
56  bo.twist.linear.setZero();
57  bo.twist.linear.head<2>() = dto.velocity.head<2>(); // x and y
58 
59  bo.twist.angular.setZero();
60  bo.twist.angular.z() = dto.velocity.z(); // yaw
61  }
62 
63  void
64  toAron(armarx::armem::prop::arondto::Platform& dto, const robot_state::PlatformState& bo)
65  {
66  ARMARX_ERROR << "Not implemented yet.";
67  }
68 } // namespace armarx::armem::robot_state
69 
71 {
72  void
73  fromAron(const armarx::armem::prop::arondto::ForceTorque& dto, ForceTorque& bo)
74  {
75  aron::fromAron(dto.force, bo.force);
76  aron::fromAron(dto.gravityCompensationForce, bo.gravityCompensatedForce);
77  aron::fromAron(dto.torque, bo.torque);
78  aron::fromAron(dto.gravityCompensationTorque, bo.gravityCompensatedTorque);
79  }
80 
81  void
82  toAron(armarx::armem::prop::arondto::ForceTorque& dto, const ForceTorque& bo)
83  {
84  aron::toAron(dto.force, bo.force);
85  aron::toAron(dto.gravityCompensationForce, bo.gravityCompensatedForce);
86  aron::toAron(dto.torque, bo.torque);
87  aron::toAron(dto.gravityCompensationTorque, bo.gravityCompensatedTorque);
88  }
89 } // namespace armarx::armem::robot_state::proprioception
90 
92 {
93  void
94  fromAron(const armarx::armem::exteroception::arondto::ToF& dto, ToF& bo)
95  {
96  bo.depth = dto.depth;
97  bo.sigma = dto.sigma;
98  bo.targetDetected = dto.targetDetected;
99  }
100 
101  void
102  toAron(armarx::armem::exteroception::arondto::ToF& dto, const ToF& bo)
103  {
104  dto.depth = bo.depth;
105  dto.sigma = bo.sigma;
106  dto.targetDetected = bo.targetDetected;
107  }
108 
109 } // namespace armarx::armem::robot_state::exteroception
110 
112 {
113  void
114  fromAron(const arondto::RobotDescription& dto, RobotDescription& bo)
115  {
116  aron::fromAron(dto.name, bo.name);
117  fromAron(dto.xml, bo.xml);
118  aron::fromAron(dto.visualization, bo.visualization);
119  aron::fromAron(dto.info, bo.info);
120  aron::fromAron(dto.manipulationCapabilities, bo.manipulationCapabilities);
121  }
122 
123  void
124  toAron(arondto::RobotDescription& dto, const RobotDescription& bo)
125  {
126  aron::toAron(dto.name, bo.name);
127  toAron(dto.xml, bo.xml);
128  aron::toAron(dto.visualization, bo.visualization);
129  aron::toAron(dto.info, bo.info);
130  aron::toAron(dto.manipulationCapabilities, bo.manipulationCapabilities);
131  }
132 } // namespace armarx::armem::robot_state::description
133 
135 {
136 
137  /* Robot */
138 
139  void
141  {
142  // fromAron(dto.description, bo.description);
143  fromAron(dto.state, bo.config);
144  }
145 
146  void
148  {
149  // toAron(dto.description, bo.description);
150  toAron(dto.state, bo.config);
151  }
152 
153  /* RobotDescription */
154 
155  /* RobotState */
156 
157  void
158  fromAron(const arondto::RobotState& dto, RobotState& bo)
159  {
160  aron::fromAron(dto.timestamp, bo.timestamp);
161  aron::fromAron(dto.globalPose, bo.globalPose.matrix());
162  aron::fromAron(dto.jointMap, bo.jointMap);
163  }
164 
165  void
166  toAron(arondto::RobotState& dto, const RobotState& bo)
167  {
168  aron::toAron(dto.timestamp, bo.timestamp);
169  aron::toAron(dto.globalPose, bo.globalPose.matrix());
170  aron::toAron(dto.jointMap, bo.jointMap);
171  }
172 
173 } // namespace armarx::armem::robot_state
armarx::armem::robot_state::fromAron
void fromAron(const arondto::ObjectInstance &dto, RobotState &bo)
Definition: aron_conversions.cpp:27
armarx::armem::robot_state::localization
Definition: aron_conversions.cpp:11
armarx::armem::robot_state::description::RobotDescription
Definition: types.h:44
armarx::armem::robot_state::Robot
Definition: types.h:126
armarx::armem::robot_state::description::fromAron
void fromAron(const arondto::ObjectClass &dto, RobotDescription &bo)
Definition: aron_conversions.cpp:10
armarx::armem::robot_state::RobotState
Definition: types.h:113
armarx::armem::robot_state
Definition: RobotStatePredictionClient.cpp:42
armarx::armem::robot_state::exteroception::ToF
Definition: types.h:98
armarx::armem::robot_state::localization::Transform
Definition: types.h:154
armarx::armem::robot_state::proprioception::fromAron
void fromAron(const armarx::armem::prop::arondto::ForceTorque &dto, ForceTorque &bo)
Definition: aron_conversions.cpp:73
armarx::armem::robot_state::proprioception::toAron
void toAron(armarx::armem::prop::arondto::ForceTorque &dto, const ForceTorque &bo)
Definition: aron_conversions.cpp:82
armarx::armem::robot_state::localization::toAron
void toAron(arondto::Transform &dto, const Transform &bo)
Definition: aron_conversions.cpp:24
armarx::armem::human::Robot
@ Robot
Definition: util.h:14
armarx::armem::robot_state::localization::fromAron
void fromAron(const arondto::Transform &dto, Transform &bo)
Definition: aron_conversions.cpp:17
armarx::armem::robot_state::exteroception
Definition: aron_conversions.cpp:91
armarx::armem::robot_state::description
Definition: aron_conversions.cpp:6
aron_conversions.h
armarx::armem::robot_state::description::toAron
void toAron(arondto::ObjectClass &dto, const RobotDescription &bo)
Definition: aron_conversions.cpp:17
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
types.h
armarx::armem::robot_state::PlatformState
Definition: types.h:71
aron_conversions.h
armarx::armem::robot_state::proprioception
Definition: aron_conversions.cpp:70
armarx::armem::robot_state::exteroception::fromAron
void fromAron(const armarx::armem::exteroception::arondto::ToF &dto, ToF &bo)
Definition: aron_conversions.cpp:94
armarx::armem::robot_state::proprioception::ForceTorque
Definition: types.h:79
armarx::aron::toAron
void toAron(T &dto, const T &bo)
Framework for converting ARON DTOs (Data Transfer Objects) to C++ BOs (Business Objects) and back.
Definition: aron_conversions.h:74
armarx::armem::robot_state::localization::TransformHeader
Definition: types.h:144
Logging.h
armarx::aron::fromAron
void fromAron(const T &dto, T &bo)
Definition: aron_conversions.h:79
armarx::armem::robot_state::toAron
void toAron(arondto::ObjectInstance &dto, const RobotState &bo)
Definition: aron_conversions.cpp:33
armarx::aron::bo
const std::optional< BoT > & bo
Definition: aron_conversions.h:168
armarx::armem::robot_state::exteroception::toAron
void toAron(armarx::armem::exteroception::arondto::ToF &dto, const ToF &bo)
Definition: aron_conversions.cpp:102