aron_conversions.cpp
Go to the documentation of this file.
1 #include "aron_conversions.h"
2 
5 
8 
9 
11 {
12 
13  /* Robot */
14 
15  void fromAron(const arondto::Robot& dto, Robot& bo)
16  {
17  // fromAron(dto.description, bo.description);
18  fromAron(dto.state, bo.config);
19  }
20 
21  void toAron(arondto::Robot& dto, const Robot& bo)
22  {
23  // toAron(dto.description, bo.description);
24  toAron(dto.state, bo.config);
25  }
26 
27  /* RobotDescription */
28 
29  void fromAron(const arondto::RobotDescription& dto, RobotDescription& bo)
30  {
31  aron::fromAron(dto.name, bo.name);
32  fromAron(dto.xml, bo.xml);
33  }
34 
35  void toAron(arondto::RobotDescription& dto, const RobotDescription& bo)
36  {
37  aron::toAron(dto.name, bo.name);
38  toAron(dto.xml, bo.xml);
39  }
40 
41  /* RobotState */
42 
43  void fromAron(const arondto::RobotState& dto, RobotState& bo)
44  {
45  aron::fromAron(dto.timestamp, bo.timestamp);
46  aron::fromAron(dto.globalPose, bo.globalPose.matrix());
47  aron::fromAron(dto.jointMap, bo.jointMap);
48 
49  }
50 
51  void toAron(arondto::RobotState& dto, const RobotState& bo)
52  {
53  aron::toAron(dto.timestamp, bo.timestamp);
54  aron::toAron(dto.globalPose, bo.globalPose.matrix());
55  aron::toAron(dto.jointMap, bo.jointMap);
56 
57  }
58 
59 } // namespace armarx::armem::robot
60 
61 
62 namespace armarx::armem
63 {
64 
65  void robot::fromAron(const arondto::ObjectClass& dto, RobotDescription& bo)
66  {
67  bo.name = aron::fromAron<armarx::ObjectID>(dto.id).str();
68  fromAron(dto.articulatedSimoxXmlPath, bo.xml);
69  }
70 
71  void robot::toAron(arondto::ObjectClass& dto, const RobotDescription& bo)
72  {
73  toAron(dto.id, ObjectID(bo.name));
74  toAron(dto.articulatedSimoxXmlPath, bo.xml);
75  }
76 
77 
78  void robot::fromAron(const arondto::ObjectInstance& dto, RobotState& bo)
79  {
80  fromAron(dto.pose, bo);
81  }
82 
83  void robot::toAron(arondto::ObjectInstance& dto, const RobotState& bo)
84  {
85  toAron(dto.pose, bo);
86  }
87 
88 
89  void robot::fromAron(const objpose::arondto::ObjectPose& dto, RobotState& bo)
90  {
91  aron::fromAron(dto.timestamp, bo.timestamp);
92  aron::fromAron(dto.objectPoseGlobal, bo.globalPose);
93  aron::fromAron(dto.objectJointValues, bo.jointMap);
94 
95  }
96 
97  void robot::toAron(objpose::arondto::ObjectPose& dto, const RobotState& bo)
98  {
99  aron::toAron(dto.timestamp, bo.timestamp);
100  aron::toAron(dto.objectPoseGlobal, bo.globalPose.matrix());
101  aron::toAron(dto.objectJointValues, bo.jointMap);
102 
103  }
104 
105 
106 } // namespace armarx::armem
armarx::armem::robot
Definition: aron_conversions.cpp:10
armarx::ObjectID
A known object ID of the form "Dataset/ClassName" or "Dataset/ClassName/InstanceName".
Definition: ObjectID.h:11
armarx::armem::robot::Robot
Definition: types.h:68
armarx::armem::toAron
void toAron(arondto::MemoryID &dto, const MemoryID &bo)
Definition: aron_conversions.cpp:19
armarx::armem
Definition: LegacyRobotStateMemoryAdapter.cpp:31
armarx::armem::robot::RobotState
Definition: types.h:54
armarx::armem::robot::RobotDescription
Definition: types.h:17
armarx::armem::human::Robot
@ Robot
Definition: util.h:14
ObjectID.h
aron_conversions.h
armarx::armem::fromAron
void fromAron(const arondto::MemoryID &dto, MemoryID &bo)
Definition: aron_conversions.cpp:8
armarx::armem::robot::fromAron
void fromAron(const arondto::Robot &dto, Robot &bo)
Definition: aron_conversions.cpp:15
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
Logging.h
armarx::aron::fromAron
void fromAron(const T &dto, T &bo)
Definition: aron_conversions.h:79
armarx::armem::robot::toAron
void toAron(arondto::Robot &dto, const Robot &bo)
Definition: aron_conversions.cpp:21
aron_conversions.h
armarx::aron::bo
const std::optional< BoT > & bo
Definition: aron_conversions.h:166