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
140 fromAron(const arondto::Robot& dto, Robot& bo)
141 {
142 // fromAron(dto.description, bo.description);
143 fromAron(dto.state, bo.config);
144 }
145
146 void
147 toAron(arondto::Robot& dto, const Robot& bo)
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
#define ARMARX_ERROR
The logging level for unexpected behaviour, that must be fixed.
Definition Logging.h:196
void fromAron(const arondto::ObjectClass &dto, RobotDescription &bo)
void toAron(arondto::ObjectClass &dto, const RobotDescription &bo)
void toAron(armarx::armem::exteroception::arondto::ToF &dto, const ToF &bo)
void fromAron(const armarx::armem::exteroception::arondto::ToF &dto, ToF &bo)
void toAron(arondto::Transform &dto, const Transform &bo)
void fromAron(const arondto::Transform &dto, Transform &bo)
void fromAron(const armarx::armem::prop::arondto::ForceTorque &dto, ForceTorque &bo)
void toAron(armarx::armem::prop::arondto::ForceTorque &dto, const ForceTorque &bo)
void fromAron(const arondto::ObjectInstance &dto, RobotState &bo)
void toAron(arondto::ObjectInstance &dto, const RobotState &bo)
void fromAron(const T &dto, T &bo)
void toAron(T &dto, const T &bo)
Framework for converting ARON DTOs (Data Transfer Objects) to C++ BOs (Business Objects) and back.
std::optional< std::map< std::string, std::vector< armarx::armem::arondto::ManipulationCapability > > > manipulationCapabilities
Definition types.h:55
arondto::RobotDescriptionVisualization visualization
Definition types.h:51
TargetDetectedMatrixType targetDetected
Definition types.h:106