ProvidedObjectPose.cpp
Go to the documentation of this file.
1 #include "ProvidedObjectPose.h"
2 
5 
9 
10 #include "ice_conversions.h"
11 
12 
13 namespace armarx::objpose
14 {
16  {
17  }
18 
19  ProvidedObjectPose::ProvidedObjectPose(const data::ProvidedObjectPose& ice)
20  {
21  fromIce(ice);
22  }
23 
24  void ProvidedObjectPose::fromIce(const data::ProvidedObjectPose& ice)
25  {
26  providerName = ice.providerName;
27  objectType = ice.objectType;
28  isStatic = ice.isStatic;
29  armarx::fromIce(ice.objectID, objectID);
30 
31  armarx::fromIce(ice.objectPose, objectPose);
32  objectPoseFrame = ice.objectPoseFrame;
33  objpose::fromIce(ice.objectPoseGaussian, objectPoseGaussian);
34 
35  objectJointValues = ice.objectJointValues;
36 
37  confidence = ice.confidence;
38  armarx::core::time::fromIce(ice.timestamp, timestamp);
39 
40  objpose::fromIce(ice.localOOBB, localOOBB);
41  }
42 
43  data::ProvidedObjectPose ProvidedObjectPose::toIce() const
44  {
45  data::ProvidedObjectPose ice;
46  toIce(ice);
47  return ice;
48  }
49 
50  void ProvidedObjectPose::toIce(data::ProvidedObjectPose& ice) const
51  {
52  ice.providerName = providerName;
53  ice.objectType = objectType;
54  ice.isStatic = isStatic;
55  armarx::toIce(ice.objectID, objectID);
56 
57  armarx::toIce(ice.objectPose, objectPose);
58  ice.objectPoseFrame = objectPoseFrame;
59  objpose::toIce(ice.objectPoseGaussian, objectPoseGaussian);
60 
61  ice.objectJointValues = objectJointValues;
62 
63  ice.confidence = confidence;
64  armarx::core::time::toIce(ice.timestamp, timestamp);
65 
66  objpose::toIce(ice.localOOBB, localOOBB);
67  }
68 }
69 
70 namespace armarx
71 {
72 
73  void objpose::fromIce(const data::ProvidedObjectPose& ice, ProvidedObjectPose& pose)
74  {
75  pose.fromIce(ice);
76  }
77  objpose::ProvidedObjectPose objpose::fromIce(const data::ProvidedObjectPose& ice)
78  {
79  return ProvidedObjectPose(ice);
80  }
81 
83  {
84  poses.clear();
85  poses.reserve(ice.size());
86  for (const auto& i : ice)
87  {
88  poses.emplace_back(i);
89  }
90  }
91 
93  {
95  fromIce(ice, poses);
96  return poses;
97  }
98 
99 
100  void objpose::toIce(data::ProvidedObjectPose& ice, const ProvidedObjectPose& pose)
101  {
102  pose.toIce(ice);
103  }
104 
105  objpose::data::ProvidedObjectPose objpose::toIce(const ProvidedObjectPose& pose)
106  {
107  return pose.toIce();
108  }
109 
110 
112  {
113  ice.clear();
114  ice.reserve(poses.size());
115  for (const auto& p : poses)
116  {
117  ice.emplace_back(p.toIce());
118  }
119  }
120 
122  {
124  toIce(ice, poses);
125  return ice;
126  }
127 
128 }
129 
130 
131 
armarx::objpose::ProvidedObjectPose::fromIce
void fromIce(const data::ProvidedObjectPose &ice)
Definition: ProvidedObjectPose.cpp:24
ice_conversions.h
armarx::objpose::ProvidedObjectPose::objectID
armarx::ObjectID objectID
The object ID, i.e. dataset, class name and instance name.
Definition: ProvidedObjectPose.h:47
armarx::core::time::fromIce
void fromIce(const dto::ClockType::ClockTypeEnum &dto, ClockType &bo)
Definition: ice_conversions.cpp:12
Pose.h
armarx::core::time::toIce
void toIce(dto::ClockType::ClockTypeEnum &dto, const ClockType &bo)
Definition: ice_conversions.cpp:33
armarx::objpose::fromIce
void fromIce(const Box &box, simox::OrientedBox< float > &oobb)
ice_conversions.h
armarx::objpose::ProvidedObjectPose::objectPoseFrame
std::string objectPoseFrame
Definition: ProvidedObjectPose.h:50
armarx::objpose::ProvidedObjectPose::toIce
data::ProvidedObjectPose toIce() const
Definition: ProvidedObjectPose.cpp:43
armarx::toIce
void toIce(std::map< IceKeyT, IceValueT > &iceMap, const boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
Definition: ice_conversions_boost_templates.h:15
FramedPose.h
armarx::objpose::ProvidedObjectPose::objectPoseGaussian
std::optional< PoseManifoldGaussian > objectPoseGaussian
Definition: ProvidedObjectPose.h:51
armarx::objpose
This file is part of ArmarX.
Definition: objpose.h:7
armarx::objpose::ProvidedObjectPose::providerName
std::string providerName
Name of the providing component.
Definition: ProvidedObjectPose.h:40
armarx::objpose::ProvidedObjectPose::ProvidedObjectPose
ProvidedObjectPose()
Definition: ProvidedObjectPose.cpp:15
armarx::objpose::ProvidedObjectPoseSeq
std::vector< ProvidedObjectPose > ProvidedObjectPoseSeq
Definition: forward_declarations.h:25
armarx::fromIce
void fromIce(const std::map< IceKeyT, IceValueT > &iceMap, boost::container::flat_map< CppKeyT, CppValueT > &cppMap)
Definition: ice_conversions_boost_templates.h:26
ExpressionException.h
armarx::objpose::ProvidedObjectPose
An object pose provided by an ObjectPoseProvider.
Definition: ProvidedObjectPose.h:25
armarx::objpose::toIce
objpose::AABB toIce(const simox::AxisAlignedBoundingBox &aabb)
Definition: ice_conversions.cpp:94
armarx::objpose::ProvidedObjectPose::objectType
ObjectType objectType
Known or unknown object.
Definition: ProvidedObjectPose.h:42
ProvidedObjectPose.h
armarx::objpose::ProvidedObjectPose::isStatic
bool isStatic
Whether object is static. Static objects don't decay.
Definition: ProvidedObjectPose.h:44
armarx::objpose::ProvidedObjectPose::objectJointValues
std::map< std::string, float > objectJointValues
The object's joint values if it is articulated.
Definition: ProvidedObjectPose.h:54
armarx::objpose::ProvidedObjectPose::localOOBB
std::optional< simox::OrientedBoxf > localOOBB
Object bounding box in object's local coordinate frame.
Definition: ProvidedObjectPose.h:64
armarx::objpose::ProvidedObjectPose::confidence
float confidence
Confidence in [0, 1] (1 = full, 0 = none).
Definition: ProvidedObjectPose.h:58
armarx::objpose::ProvidedObjectPose::timestamp
DateTime timestamp
Source timestamp.
Definition: ProvidedObjectPose.h:60
armarx::objpose::ProvidedObjectPose::objectPose
Eigen::Matrix4f objectPose
Definition: ProvidedObjectPose.h:49
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28