EnvironmentalPrimitive.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* @package MemoryX::Core
17* @author Peter Kaiser <peter dot kaiser at kit dot edu>
18* @date 2014
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
26
28
31#include <MemoryX/interface/core/EntityBase.h>
32#include <MemoryX/interface/memorytypes/MemoryEntities.h>
33
35{
37 armarx::Variant::addTypeName("::memoryx::EnvironmentalPrimitiveBase");
39 armarx::Variant::addTypeName("::memoryx::PlanePrimitiveBase");
41 armarx::Variant::addTypeName("::memoryx::SpherePrimitiveBase");
43 armarx::Variant::addTypeName("::memoryx::CylinderPrimitiveBase");
45 armarx::Variant::addTypeName("::memoryx::ConePrimitiveBase");
47 armarx::Variant::addTypeName("::memoryx::BoxPrimitiveBase");
49 armarx::Variant::addTypeName("::memoryx::HigherSemanticStructureBase");
50} // namespace memoryx::VariantType
51
52namespace memoryx
53{
56
57 class EnvironmentalPrimitive : virtual public EnvironmentalPrimitiveBase, virtual public Entity
58 {
59 public:
60 EnvironmentalPrimitive(const std::string& name = "",
61 const std::string& id = "",
62 const std::string& shape = "");
63
64 std::string getShape(const Ice::Current& c = Ice::emptyCurrent) const override;
65
66 armarx::Vector3BasePtr
67 getOBBDimensions(const Ice::Current& c = Ice::emptyCurrent) const override;
68 void setOBBDimensions(const armarx::Vector3BasePtr& dimensions,
69 const Ice::Current& c = Ice::emptyCurrent) override;
70
71 armarx::FramedPoseBasePtr getPose(const Ice::Current& c = Ice::emptyCurrent) const override;
72 void setPose(const armarx::FramedPoseBasePtr& pose,
73 const Ice::Current& c = Ice::emptyCurrent) override;
74
75 PointList getInliers(const Ice::Current& c = Ice::emptyCurrent) const override;
76 void setInliers(const PointList& inliers,
77 const Ice::Current& c = Ice::emptyCurrent) override;
78
79 PointList getGraspPoints(const Ice::Current& c = Ice::emptyCurrent) const override;
80 void setGraspPoints(const PointList& graspPoints,
81 const Ice::Current& c = Ice::emptyCurrent) override;
82
83 float getProbability(const Ice::Current& c = Ice::emptyCurrent) const override;
84 void setProbability(float probability, const Ice::Current& c = Ice::emptyCurrent) override;
85
86 float getCircularityProbability(const Ice::Current& c = Ice::emptyCurrent) const override;
87 void setCircularityProbability(float probability,
88 const Ice::Current& c = Ice::emptyCurrent) override;
89
90 float getLength(const Ice::Current& c = Ice::emptyCurrent) const override;
91 void setLength(float length, const Ice::Current& c = Ice::emptyCurrent) override;
92
93 int getLabel(const Ice::Current& c = Ice::emptyCurrent) const override;
94 void setLabel(int label, const Ice::Current& c = Ice::emptyCurrent) override;
95
96 armarx::TimestampBasePtr getTime(const Ice::Current& c = Ice::emptyCurrent) const override;
97 void setTime(const armarx::TimestampBasePtr& time,
98 const Ice::Current& c = Ice::emptyCurrent) override;
99
100 armarx::MatrixFloatBasePtr
101 getSampling(const Ice::Current& c = Ice::emptyCurrent) const override;
102 void setSampling(const armarx::MatrixFloatBasePtr& sampling,
103 const Ice::Current& c = Ice::emptyCurrent) override;
104
105 Ice::ObjectPtr ice_clone() const override;
106 EnvironmentalPrimitivePtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
107
108 protected:
109 void setShape(const std::string& shape, const Ice::Current& c = Ice::emptyCurrent) override;
110 };
111
112
113 class PlanePrimitive;
115
116 class PlanePrimitive : virtual public PlanePrimitiveBase, virtual public EnvironmentalPrimitive
117 {
118 public:
119 PlanePrimitive(const std::string& name = "", const std::string& id = "");
120 PlanePrimitive(std::vector<float>& coeffs);
121
122 armarx::Vector3BasePtr
123 getPlaneNormal(const Ice::Current& c = Ice::emptyCurrent) const override;
124 void setPlaneNormal(const armarx::Vector3BasePtr& normal,
125 const Ice::Current& c = Ice::emptyCurrent) override;
126
127 float getPlaneDistance(const Ice::Current& c = Ice::emptyCurrent) const override;
128 void setPlaneDistance(float distance, const Ice::Current& c = Ice::emptyCurrent) override;
129
130 Ice::ObjectPtr ice_clone() const override;
131 PlanePrimitivePtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
132 };
133
134 class SpherePrimitive;
136
138 virtual public SpherePrimitiveBase,
139 virtual public EnvironmentalPrimitive
140 {
141 public:
142 SpherePrimitive(const std::string& name = "", const std::string& id = "");
143 SpherePrimitive(std::vector<float>& coeffs);
144
145 armarx::Vector3BasePtr
146 getSphereCenter(const Ice::Current& c = Ice::emptyCurrent) const override;
147 void setSphereCenter(const armarx::Vector3BasePtr& center,
148 const Ice::Current& c = Ice::emptyCurrent) override;
149
150 float getSphereRadius(const Ice::Current& c = Ice::emptyCurrent) const override;
151 void setSphereRadius(float radius, const Ice::Current& c = Ice::emptyCurrent) override;
152
153 Ice::ObjectPtr ice_clone() const override;
154 SpherePrimitivePtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
155 };
156
157 class CylinderPrimitive;
159
161 virtual public CylinderPrimitiveBase,
162 virtual public EnvironmentalPrimitive
163 {
164 public:
165 CylinderPrimitive(const std::string& name = "", const std::string& id = "");
166 CylinderPrimitive(std::vector<float>& coeffs);
167
168 armarx::Vector3BasePtr
169 getCylinderPoint(const Ice::Current& c = Ice::emptyCurrent) const override;
170 void setCylinderPoint(const armarx::Vector3BasePtr& point,
171 const Ice::Current& c = Ice::emptyCurrent) override;
172
173 armarx::Vector3BasePtr
174 getCylinderAxisDirection(const Ice::Current& c = Ice::emptyCurrent) const override;
175 void setCylinderAxisDirection(const armarx::Vector3BasePtr& axis,
176 const Ice::Current& c = Ice::emptyCurrent) override;
177
178 float getCylinderRadius(const Ice::Current& c = Ice::emptyCurrent) const override;
179 void setCylinderRadius(float radius, const Ice::Current& c = Ice::emptyCurrent) override;
180
181 Ice::ObjectPtr ice_clone() const override;
182 CylinderPrimitivePtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
183 };
184
185
186 class ConePrimitive;
188
189 class ConePrimitive : virtual public ConePrimitiveBase, virtual public EnvironmentalPrimitive
190 {
191
192 public:
193 ConePrimitive(const std::string& name = "", const std::string& id = "");
194 ConePrimitive(std::vector<float>& coeffs);
195
196 armarx::Vector3BasePtr
197 getConeApex(const Ice::Current& c = Ice::emptyCurrent) const override;
198 void setConeApex(const armarx::Vector3BasePtr& apex,
199 const Ice::Current& c = Ice::emptyCurrent) override;
200
201 armarx::Vector3BasePtr
202 getConeAxisDirection(const Ice::Current& c = Ice::emptyCurrent) const override;
203 void setConeAxisDirection(const armarx::Vector3BasePtr& axis,
204 const Ice::Current& c = Ice::emptyCurrent) override;
205
206 float getConeOpeningAngle(const Ice::Current&) const override;
207 void setConeOpeningAngle(float angle, const Ice::Current& c = Ice::emptyCurrent) override;
208
209 Ice::ObjectPtr ice_clone() const override;
210 ConePrimitivePtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
211 };
212
213
214 class BoxPrimitive;
216
217 class BoxPrimitive : virtual public BoxPrimitiveBase, virtual public EnvironmentalPrimitive
218 {
219
220 public:
221 BoxPrimitive(const std::string& name = "", const std::string& id = "");
222
223 EntityRefList getBoxSides(const Ice::Current& c = Ice::emptyCurrent) const override;
224 void setBoxSides(const EntityRefList& sides,
225 const Ice::Current& c = Ice::emptyCurrent) override;
226
227 Ice::ObjectPtr ice_clone() const override;
228 BoxPrimitivePtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
229 };
230
231
234
236 virtual public HigherSemanticStructureBase,
237 virtual public EnvironmentalPrimitive
238 {
239
240 public:
241 HigherSemanticStructure(const std::string& name = "", const std::string& id = "");
242
243 EntityRefList getPrimitives(const Ice::Current& c = Ice::emptyCurrent) const override;
244 void setPrimitives(const EntityRefList& primitives,
245 const Ice::Current& c = Ice::emptyCurrent) override;
246
247 Ice::StringSeq getLabels(const Ice::Current& c = Ice::emptyCurrent) const override;
248 void setLabels(const Ice::StringSeq& labels,
249 const Ice::Current& c = Ice::emptyCurrent) override;
250
251 Ice::ObjectPtr ice_clone() const override;
252 HigherSemanticStructurePtr clone(const Ice::Current& c = Ice::emptyCurrent) const;
253 };
254
255
256} // namespace memoryx
constexpr T c
static VariantTypeId addTypeName(const std::string &typeName)
Register a new type for the use in a Variant.
Definition Variant.cpp:869
BoxPrimitive(const std::string &name="", const std::string &id="")
BoxPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Ice::ObjectPtr ice_clone() const override
EntityRefList getBoxSides(const Ice::Current &c=Ice::emptyCurrent) const override
void setBoxSides(const EntityRefList &sides, const Ice::Current &c=Ice::emptyCurrent) override
ConePrimitive(const std::string &name="", const std::string &id="")
armarx::Vector3BasePtr getConeApex(const Ice::Current &c=Ice::emptyCurrent) const override
void setConeApex(const armarx::Vector3BasePtr &apex, const Ice::Current &c=Ice::emptyCurrent) override
void setConeOpeningAngle(float angle, const Ice::Current &c=Ice::emptyCurrent) override
armarx::Vector3BasePtr getConeAxisDirection(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
float getConeOpeningAngle(const Ice::Current &) const override
ConePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setConeAxisDirection(const armarx::Vector3BasePtr &axis, const Ice::Current &c=Ice::emptyCurrent) override
CylinderPrimitive(const std::string &name="", const std::string &id="")
void setCylinderPoint(const armarx::Vector3BasePtr &point, const Ice::Current &c=Ice::emptyCurrent) override
CylinderPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
float getCylinderRadius(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::Vector3BasePtr getCylinderAxisDirection(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::ObjectPtr ice_clone() const override
armarx::Vector3BasePtr getCylinderPoint(const Ice::Current &c=Ice::emptyCurrent) const override
void setCylinderAxisDirection(const armarx::Vector3BasePtr &axis, const Ice::Current &c=Ice::emptyCurrent) override
void setCylinderRadius(float radius, const Ice::Current &c=Ice::emptyCurrent) override
Entity(const Entity &source)
Definition Entity.cpp:34
void setTime(const armarx::TimestampBasePtr &time, const Ice::Current &c=Ice::emptyCurrent) override
PointList getGraspPoints(const Ice::Current &c=Ice::emptyCurrent) const override
void setLabel(int label, const Ice::Current &c=Ice::emptyCurrent) override
PointList getInliers(const Ice::Current &c=Ice::emptyCurrent) const override
void setOBBDimensions(const armarx::Vector3BasePtr &dimensions, const Ice::Current &c=Ice::emptyCurrent) override
void setGraspPoints(const PointList &graspPoints, const Ice::Current &c=Ice::emptyCurrent) override
void setSampling(const armarx::MatrixFloatBasePtr &sampling, const Ice::Current &c=Ice::emptyCurrent) override
void setInliers(const PointList &inliers, const Ice::Current &c=Ice::emptyCurrent) override
void setCircularityProbability(float probability, const Ice::Current &c=Ice::emptyCurrent) override
EnvironmentalPrimitive(const std::string &name="", const std::string &id="", const std::string &shape="")
void setLength(float length, const Ice::Current &c=Ice::emptyCurrent) override
float getCircularityProbability(const Ice::Current &c=Ice::emptyCurrent) const override
std::string getShape(const Ice::Current &c=Ice::emptyCurrent) const override
void setShape(const std::string &shape, const Ice::Current &c=Ice::emptyCurrent) override
float getProbability(const Ice::Current &c=Ice::emptyCurrent) const override
int getLabel(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::FramedPoseBasePtr getPose(const Ice::Current &c=Ice::emptyCurrent) const override
EnvironmentalPrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setProbability(float probability, const Ice::Current &c=Ice::emptyCurrent) override
Ice::ObjectPtr ice_clone() const override
float getLength(const Ice::Current &c=Ice::emptyCurrent) const override
void setPose(const armarx::FramedPoseBasePtr &pose, const Ice::Current &c=Ice::emptyCurrent) override
armarx::TimestampBasePtr getTime(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::MatrixFloatBasePtr getSampling(const Ice::Current &c=Ice::emptyCurrent) const override
armarx::Vector3BasePtr getOBBDimensions(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::StringSeq getLabels(const Ice::Current &c=Ice::emptyCurrent) const override
EntityRefList getPrimitives(const Ice::Current &c=Ice::emptyCurrent) const override
void setPrimitives(const EntityRefList &primitives, const Ice::Current &c=Ice::emptyCurrent) override
void setLabels(const Ice::StringSeq &labels, const Ice::Current &c=Ice::emptyCurrent) override
Ice::ObjectPtr ice_clone() const override
HigherSemanticStructurePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
HigherSemanticStructure(const std::string &name="", const std::string &id="")
PlanePrimitive(const std::string &name="", const std::string &id="")
armarx::Vector3BasePtr getPlaneNormal(const Ice::Current &c=Ice::emptyCurrent) const override
void setPlaneDistance(float distance, const Ice::Current &c=Ice::emptyCurrent) override
PlanePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
Ice::ObjectPtr ice_clone() const override
float getPlaneDistance(const Ice::Current &c=Ice::emptyCurrent) const override
void setPlaneNormal(const armarx::Vector3BasePtr &normal, const Ice::Current &c=Ice::emptyCurrent) override
SpherePrimitivePtr clone(const Ice::Current &c=Ice::emptyCurrent) const
void setSphereRadius(float radius, const Ice::Current &c=Ice::emptyCurrent) override
armarx::Vector3BasePtr getSphereCenter(const Ice::Current &c=Ice::emptyCurrent) const override
SpherePrimitive(const std::string &name="", const std::string &id="")
Ice::ObjectPtr ice_clone() const override
void setSphereCenter(const armarx::Vector3BasePtr &center, const Ice::Current &c=Ice::emptyCurrent) override
float getSphereRadius(const Ice::Current &c=Ice::emptyCurrent) const override
Ice::Int VariantTypeId
Definition Variant.h:43
const armarx::VariantTypeId BoxPrimitive
const armarx::VariantTypeId EnvironmentalPrimitive
const armarx::VariantTypeId HigherSemanticStructure
const armarx::VariantTypeId PlanePrimitive
const armarx::VariantTypeId SpherePrimitive
const armarx::VariantTypeId ConePrimitive
const armarx::VariantTypeId CylinderPrimitive
VirtualRobot headers.
IceInternal::Handle< SpherePrimitive > SpherePrimitivePtr
IceInternal::Handle< HigherSemanticStructure > HigherSemanticStructurePtr
IceInternal::Handle< PlanePrimitive > PlanePrimitivePtr
IceInternal::Handle< ConePrimitive > ConePrimitivePtr
IceInternal::Handle< EnvironmentalPrimitive > EnvironmentalPrimitivePtr
IceInternal::Handle< BoxPrimitive > BoxPrimitivePtr
IceInternal::Handle< CylinderPrimitive > CylinderPrimitivePtr
double distance(const Point &a, const Point &b)
Definition point.hpp:95
double angle(const Point &a, const Point &b, const Point &c)
Definition point.hpp:109