AffordanceExtraction.cpp
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 Lesser General Public License as
6  * published by the Free Software Foundation; either version 2 of
7  * the License, or (at your option) any later version.
8  *
9  * ArmarX is distributed in the hope that it will be useful, but
10  * WITHOUT ANY WARRANTY; without even the implied warranty of
11  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
12  * GNU Lesser General Public License for more details.
13  *
14  * You should have received a copy of the GNU General Public License
15  * along with this program. If not, see <http://www.gnu.org/licenses/>.
16  *
17  * @package VisionX
18  * @author Peter Kaiser (peter dot kaiser at kit dot edu)
19  * @date 2014
20  * @copyright http://www.gnu.org/licenses/gpl.txt
21  * GNU General Public License
22  */
23 
24 #include "AffordanceExtraction.h"
25 
32 
33 #include <AffordanceKit/embodiments/Armar3Embodiment.h>
34 #include <AffordanceKit/embodiments/Armar4Embodiment.h>
35 #include <AffordanceKit/embodiments/WalkManEmbodiment.h>
36 
39 
40 using namespace armarx;
41 
43  hasNewPrimitives(false),
44  lastProcessedTimestamp(0),
45  enabled(true)
46 {
47 }
48 
50 {
51  std::unique_lock lock(primitivesMutex);
52 
54  {
56  hasNewPrimitives = true;
57 
58  ARMARX_INFO << "New segmentation available: " << primitiveSegmentation->size() << " Primitives";
59  }
60  else
61  {
62  ARMARX_ERROR << "New segmentation available, but failed to access environmental primitives segment";
63  }
64 }
65 
67 {
68  std::string embodimentName = getProperty<std::string>("EmbodimentName").getValue();
69 
70  ARMARX_INFO << "Using embodiment '" << embodimentName << "'";
71  if (embodimentName == "Armar3")
72  {
73  embodiment.reset(new AffordanceKit::Armar3Embodiment());
74  }
75  else if (embodimentName == "Armar4")
76  {
77  embodiment.reset(new AffordanceKit::Armar4Embodiment());
78  }
79  else if (embodimentName == "WalkMan")
80  {
81  embodiment.reset(new AffordanceKit::WalkManEmbodiment());
82  }
83  else
84  {
85  ARMARX_ERROR << "Unknown embodiment '" << embodimentName << "' specified. Affordance extraction will not work properly.";
86  embodiment.reset(new AffordanceKit::Embodiment());
87  }
88 
89  affordanceExtractionCertainty = getProperty<float>("AffordanceExtractionCertainty").getValue();
90  ARMARX_INFO << "Affordance extraction certainty: " << affordanceExtractionCertainty;
91 
92  platformGraspAffordance.reset(new AffordanceKit::PlatformGraspAffordance(embodiment, affordanceExtractionCertainty));
93  prismaticGraspAffordance.reset(new AffordanceKit::PrismaticGraspAffordance(embodiment, affordanceExtractionCertainty));
94  graspAffordance.reset(new AffordanceKit::GraspAffordance(embodiment, platformGraspAffordance, prismaticGraspAffordance));
95 
96  supportAffordance.reset(new AffordanceKit::SupportAffordance(embodiment, platformGraspAffordance));
97  leanAffordance.reset(new AffordanceKit::LeanAffordance(embodiment, platformGraspAffordance));
98  liftAffordance.reset(new AffordanceKit::LiftAffordance(embodiment, prismaticGraspAffordance));
99  holdAffordance.reset(new AffordanceKit::HoldAffordance(embodiment, prismaticGraspAffordance));
100  turnAffordance.reset(new AffordanceKit::TurnAffordance(embodiment, prismaticGraspAffordance));
101  pushAffordance.reset(new AffordanceKit::PushAffordance(embodiment, graspAffordance));
102  pullAffordance.reset(new AffordanceKit::PullAffordance(embodiment, prismaticGraspAffordance));
103 
104  bimanualPlatformGraspAffordance.reset(new AffordanceKit::BimanualPlatformGraspAffordance(embodiment, platformGraspAffordance));
105  bimanualPrismaticGraspAffordance.reset(new AffordanceKit::BimanualPrismaticGraspAffordance(embodiment, prismaticGraspAffordance));
106  bimanualGraspAffordance.reset(new AffordanceKit::BimanualGraspAffordance(embodiment, bimanualPrismaticGraspAffordance, bimanualPlatformGraspAffordance));
107  bimanualOpposedGraspAffordance.reset(new AffordanceKit::BimanualOpposedGraspAffordance(embodiment, bimanualGraspAffordance));
108  bimanualAlignedGraspAffordance.reset(new AffordanceKit::BimanualAlignedGraspAffordance(embodiment, bimanualGraspAffordance));
109  bimanualOpposedPlatformGraspAffordance.reset(new AffordanceKit::BimanualOpposedPlatformGraspAffordance(embodiment, bimanualPlatformGraspAffordance, bimanualOpposedGraspAffordance));
110  bimanualOpposedPrismaticGraspAffordance.reset(new AffordanceKit::BimanualOpposedPrismaticGraspAffordance(embodiment, bimanualPrismaticGraspAffordance, bimanualOpposedGraspAffordance));
111  bimanualAlignedPlatformGraspAffordance.reset(new AffordanceKit::BimanualAlignedPlatformGraspAffordance(embodiment, bimanualPlatformGraspAffordance, bimanualAlignedGraspAffordance));
112  bimanualAlignedPrismaticGraspAffordance.reset(new AffordanceKit::BimanualAlignedPrismaticGraspAffordance(embodiment, bimanualPrismaticGraspAffordance, bimanualAlignedGraspAffordance));
113  bimanualTurnAffordance.reset(new AffordanceKit::BimanualTurnAffordance(embodiment, bimanualOpposedPrismaticGraspAffordance));
115 
116  affordanceTypes[graspAffordance->getName()] = memoryx::eAffordanceTypeGrasp;
117  affordanceTypes[platformGraspAffordance->getName()] = memoryx::eAffordanceTypeGraspPlatform;
118  affordanceTypes[prismaticGraspAffordance->getName()] = memoryx::eAffordanceTypeGraspPrismatic;
119  affordanceTypes[supportAffordance->getName()] = memoryx::eAffordanceTypeSupport;
120  affordanceTypes[leanAffordance->getName()] = memoryx::eAffordanceTypeLean;
121  affordanceTypes[holdAffordance->getName()] = memoryx::eAffordanceTypeHold;
122  affordanceTypes[pushAffordance->getName()] = memoryx::eAffordanceTypePush;
123  affordanceTypes[pullAffordance->getName()] = memoryx::eAffordanceTypePull;
124  affordanceTypes[liftAffordance->getName()] = memoryx::eAffordanceTypeLift;
125  affordanceTypes[turnAffordance->getName()] = memoryx::eAffordanceTypeTurn;
126  affordanceTypes[pushAffordance->getName()] = memoryx::eAffordanceTypePush;
127  affordanceTypes[bimanualPlatformGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualGraspPlatform;
128  affordanceTypes[bimanualPrismaticGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualGraspPrismatic;
129  affordanceTypes[bimanualGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualGrasp;
130  affordanceTypes[bimanualOpposedGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualGraspOpposed;
131  affordanceTypes[bimanualAlignedGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualGraspAligned;
132  affordanceTypes[bimanualOpposedPlatformGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualOpposedGraspPlatform;
133  affordanceTypes[bimanualOpposedPrismaticGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualOpposedGraspPrismatic;
134  affordanceTypes[bimanualAlignedPlatformGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualAlignedGraspPlatform;
135  affordanceTypes[bimanualAlignedPrismaticGraspAffordance->getName()] = memoryx::eAffordanceTypeBimanualAlignedGraspPrismatic;
136  affordanceTypes[bimanualTurnAffordance->getName()] = memoryx::eAffordanceTypeBimanualTurn;
137  affordanceTypes[bimanualLiftAffordance->getName()] = memoryx::eAffordanceTypeBimanualLift;
138 
149 
161 
162  maxPrimitiveSamplingSize = getProperty<int>("MaxPrimitiveSamplingSize").getValue();
163  ARMARX_INFO << "Ignoring primitives with samplings larger than " << maxPrimitiveSamplingSize << " entries";
164 
165  std::string affordanceRestrictionString = getProperty<std::string>("RestrictToAffordanceList").getValue();
166  if (affordanceRestrictionString != "")
167  {
168  auto affordanceRestrictionList = Split(affordanceRestrictionString, ",");
169  affordanceRestriction.insert(affordanceRestrictionList.begin(), affordanceRestrictionList.end());
170  }
171 
172  std::vector<std::string> affordances;
173  for (auto& a : unimanualAffordances)
174  {
175  if (affordanceRestriction.size() == 0 || affordanceRestriction.find(a->getName()) != affordanceRestriction.end())
176  {
177  affordances.push_back(a->getName());
178  }
179  }
180 
181  for (auto& a : bimanualAffordances)
182  {
183  if (affordanceRestriction.size() == 0 || affordanceRestriction.find(a->getName()) != affordanceRestriction.end())
184  {
185  affordances.push_back(a->getName());
186  }
187  }
188 
189  ARMARX_INFO << "Configured affordances: " << affordances;
190 
191  offeringTopic(getProperty<std::string>("AffordanceExtractionTopicName").getValue());
192  usingTopic(getProperty<std::string>("PrimitiveExtractionTopicName").getValue());
193 
194  usingProxy(getProperty<std::string>("WorkingMemoryName").getValue());
195 
196  offeringTopic(getProperty<std::string>("DebugObserverName").getValue());
197 
199 }
200 
202 {
203  const Ice::CommunicatorPtr ic = getIceManager()->getCommunicator();
204 
205  workingMemoryPrx = getProxy<memoryx::WorkingMemoryInterfacePrx>(getProperty<std::string>("WorkingMemoryName").getValue());
206  if (!workingMemoryPrx)
207  {
208  ARMARX_ERROR << "Failed to obtain working memory proxy";
209  return;
210  }
211 
212  affordanceSegment = workingMemoryPrx->getAffordanceSegment();
213  if (!affordanceSegment)
214  {
215  ARMARX_ERROR << "Failed to obtain affordance segment pointer";
216  return;
217  }
218 
219  environmentalPrimitiveSegment = workingMemoryPrx->getEnvironmentalPrimitiveSegment();
221  {
222  ARMARX_ERROR << "Failed to obtain environmental primitive segment pointer";
223  return;
224  }
225 
226  debugObserver = getTopic<DebugObserverInterfacePrx>(getProperty<std::string>("DebugObserverName").getValue());
227 
228  listenerPrx = getTopic<AffordanceExtractionListenerPrx>(getProperty<std::string>("AffordanceExtractionTopicName").getValue());
229  affordanceExtractionTask->start();
230 
231  hasNewPrimitives = false;
232 }
233 
235 {
236  affordanceExtractionTask->stop();
237 }
238 
240 {
241 }
242 
243 void AffordanceExtraction::addObservation(const PoseBasePtr& endEffectorPose, const std::string& affordance, const std::string& primitiveId, float result, float certainty, float sigma_pos, float sigma_rot, const Ice::Current& c)
244 {
245  std::unique_lock lock1(primitivesMutex);
246  std::unique_lock lock2(affordancesMutex);
247 
248  Eigen::Matrix4f pose = PosePtr::dynamicCast(endEffectorPose)->toEigen();
249 
251  {
252  // This might happen if primitives have already been present in the memory on startup
254  }
255 
256  ARMARX_INFO << "Adding Experiment(primitive=" << primitiveId << ", affordance=" << affordance << ", result=" << result << ", certainty=" << certainty << ", sigma_pos=" << sigma_pos << ", sigma_rot=" << sigma_rot << ")";
257 
258  AffordanceKit::PrimitivePtr primitive = primitiveSegmentation->getPrimitiveById(primitiveId);
259 
260  bool found = false;
261  for (auto& a : unimanualAffordances)
262  {
263  if (a->getName() == affordance && a->existsForPrimitive(primitive))
264  {
265  a->addObservation(AffordanceKit::ObservationPtr(new AffordanceKit::Observation(primitive, pose, result, certainty, sigma_pos, sigma_rot)));
266  found = true;
267  }
268  }
269 
270  for (auto& a : bimanualAffordances)
271  {
272  if (a->getName() == affordance && a->existsForPrimitive(primitive))
273  {
274  a->addObservation(AffordanceKit::ObservationPtr(new AffordanceKit::Observation(primitive, pose, result, certainty, sigma_pos, sigma_rot)));
275  found = true;
276  }
277  }
278 
279  if (!found)
280  {
281  ARMARX_WARNING << "Discarding experiment, because affordance or primitive were not found.";
282  }
283 
284  // Export updated primitives to memory
287  ARMARX_INFO << (unimanualAffordances.size() + bimanualAffordances.size()) << " affordances updated and reported";
288 
289  listenerPrx->reportNewAffordances();
290 }
291 
292 void AffordanceExtraction::exportScene(const std::string& filename, const Ice::Current& c)
293 {
294  ARMARX_INFO << "Exporting current scene to '" << filename << "'";
295 
297  s.save(filename);
298 }
299 
300 void AffordanceExtraction::importScene(const std::string& filename, const Ice::Current& c)
301 {
302  ARMARX_INFO << "Importing scene from '" << filename << "'";
303 
305  s.load(filename);
307 
308  listenerPrx->reportNewAffordances();
309 }
310 
312 {
313  AffordanceKit::PrimitiveSetPtr primitives;
314 
315  {
316  std::unique_lock lock(primitivesMutex);
317 
318  if (!hasNewPrimitives)
319  {
320  return;
321  }
322  hasNewPrimitives = false;
323 
324  primitives = primitiveSegmentation;
325  }
326 
327  {
328  std::unique_lock lock(enableMutex);
329 
330  if (!enabled)
331  {
332  return;
333  }
334  }
335 
336  long originalTimestamp = 0;
337  if (primitives->size() > 0)
338  {
339  originalTimestamp = (*primitives->begin())->getTimestamp();
340 
341  IceUtil::Time ts = IceUtil::Time::microSeconds(originalTimestamp);
342  std::string timestampString = ts.toDateTime().substr(ts.toDateTime().find(' ') + 1);
343 
344  ARMARX_INFO << "Processing new set of primitives (timestamp: " << timestampString << ")";
345 
346  environmentalPrimitiveSegment->removeOlderPrimitives(new armarx::TimestampVariant(originalTimestamp));
347 
348  ARMARX_INFO << "Primitives older than " << timestampString << " removed";
349  }
350 
351  int spatialStepSize = getProperty<float>("SpatialSamplingDistance").getValue();
352  int numOrientationalSteps = getProperty<int>("NumOrientationalSamplings").getValue();
353 
354  {
355  std::unique_lock lock(affordancesMutex);
356 
357  for (auto& a : unimanualAffordances)
358  {
359  if (affordanceRestriction.size() == 0 || affordanceRestriction.find(a->getName()) != affordanceRestriction.end())
360  {
361  a->reset();
362  }
363  }
364  for (auto& a : bimanualAffordances)
365  {
366  if (affordanceRestriction.size() == 0 || affordanceRestriction.find(a->getName()) != affordanceRestriction.end())
367  {
368  a->reset();
369  }
370  }
371 
372  bool samplingNeeded = true;
373  for (auto& primitive : *primitives)
374  {
375  if (primitive->getSamplingSize() > 0)
376  {
377  samplingNeeded = false;
378  }
379 
380  if (maxPrimitiveSamplingSize > 0 && primitive->getSamplingSize() > maxPrimitiveSamplingSize)
381  {
382  // Sampling was read from memory, so we need to apply the max sampling size policy again
383  ARMARX_INFO << "Ignoring primitive " << primitive->getId() << ", sampling size " << primitive->getSamplingSize() << " is too large";
384  primitive->resetSampling();
385  }
386  }
387 
388  IceUtil::Time t = IceUtil::Time::now();
389  if (samplingNeeded)
390  {
391  primitives->sample(spatialStepSize, numOrientationalSteps, maxPrimitiveSamplingSize);
392  ARMARX_INFO << "Sampling of primitives took " << (IceUtil::Time::now() - t).toMilliSeconds() << " ms";
393  }
394  else
395  {
396  ARMARX_INFO << "Sampling not necessary";
397  }
398 
399  for (auto& a : unimanualAffordances)
400  {
401  if (affordanceRestriction.size() == 0 || affordanceRestriction.find(a->getName()) != affordanceRestriction.end())
402  {
403  IceUtil::Time t = IceUtil::Time::now();
404  a->evaluatePrimitiveSet(primitives);
405  ARMARX_INFO << "Evaluation of affordance '" << a->getName() << "' took " << (IceUtil::Time::now() - t).toMilliSeconds() << " ms";
406  }
407  }
408 
409  for (auto& a : bimanualAffordances)
410  {
411  if (affordanceRestriction.size() == 0 || affordanceRestriction.find(a->getName()) != affordanceRestriction.end())
412  {
413  IceUtil::Time t = IceUtil::Time::now();
414  a->evaluatePrimitiveSet(primitives);
415  ARMARX_INFO << "Evaluation of affordance '" << a->getName() << "' took " << (IceUtil::Time::now() - t).toMilliSeconds() << " ms";
416  }
417  }
418 
419  ARMARX_INFO << "Total time for affordance extraction: " << (IceUtil::Time::now() - t).toMilliSeconds() << " ms";
420 
421  {
422  std::unique_lock lock(enableMutex);
423 
424  if (!enabled)
425  {
426  ARMARX_INFO << "Affordance extraction interrupted (pipeline step disabled)";
427  return;
428  }
429  }
430 
431  t = IceUtil::Time::now();
434 
435  std::string affordanceName = "";
436  float uncertainty = s.getTotalUncertainty(affordanceName);
437  float positiveDecisionRate = s.getPositiveDecisionRate(affordanceName);
438  float negativeDecisionRate = s.getNegativeDecisionRate(affordanceName);
439  float conflict = s.getTotalConflict(affordanceName);
440 
442  valueMap["uncertainty"] = new Variant(uncertainty);
443  valueMap["positiveDecisionRate"] = new Variant(positiveDecisionRate);
444  valueMap["negativeDecisionRate"] = new Variant(negativeDecisionRate);
445  valueMap["conflict"] = new Variant(conflict);
446  debugObserver->setDebugChannel(getName(), valueMap);
447 
448 
449  ARMARX_INFO << (unimanualAffordances.size() + bimanualAffordances.size()) << " new affordances written to memory: " << (IceUtil::Time::now() - t).toMilliSeconds() << " ms";
450 
451  {
452  std::unique_lock lock(timestampMutex);
453  lastProcessedTimestamp = originalTimestamp;
454  }
455 
456  listenerPrx->reportNewAffordances();
457  ARMARX_INFO << (unimanualAffordances.size() + bimanualAffordances.size()) << " affordances extracted and reported";
458  }
459 }
460 
462 {
464 }
465 
467 {
468  std::unique_lock lock(enableMutex);
469 
470  ARMARX_INFO << "Pipeline step enabled";
471  enabled = true;
472 }
473 
475 {
476  std::unique_lock lock(enableMutex);
477 
478  ARMARX_INFO << "Pipeline step disabled";
479  enabled = false;
480 }
481 
483 {
484  std::unique_lock lock(enableMutex);
485  return enabled;
486 }
487 
488 armarx::TimestampBasePtr armarx::AffordanceExtraction::getLastProcessedTimestamp(const Ice::Current& c)
489 {
490  std::unique_lock lock(timestampMutex);
491  return new armarx::TimestampVariant(lastProcessedTimestamp);
492 }
armarx::AffordanceExtraction::affordancesMutex
std::mutex affordancesMutex
Definition: AffordanceExtraction.h:157
armarx::AffordanceExtraction::pushAffordance
AffordanceKit::PushAffordancePtr pushAffordance
Definition: AffordanceExtraction.h:187
armarx::Variant
The Variant class is described here: Variants.
Definition: Variant.h:224
armarx::ManagedIceObject::getIceManager
IceManagerPtr getIceManager() const
Returns the IceManager.
Definition: ManagedIceObject.cpp:353
armarx::AffordanceExtraction::onExitComponent
void onExitComponent() override
Definition: AffordanceExtraction.cpp:239
EnvironmentalPrimitive.h
armarx::AffordanceExtraction::getLastProcessedTimestamp
armarx::TimestampBasePtr getLastProcessedTimestamp(const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:488
cyberglove_with_calib_22dof.ic
ic
Definition: cyberglove_with_calib_22dof.py:22
armarx::AffordanceExtraction::onInitComponent
void onInitComponent() override
Definition: AffordanceExtraction.cpp:66
armarx::AffordanceExtraction::lastProcessedTimestamp
long lastProcessedTimestamp
Definition: AffordanceExtraction.h:163
armarx::AffordanceExtraction::affordanceRestriction
std::set< std::string > affordanceRestriction
Definition: AffordanceExtraction.h:207
armarx::StringVariantBaseMap
std::map< std::string, VariantBasePtr > StringVariantBaseMap
Definition: ManagedIceObject.h:111
armarx::AffordanceExtraction::bimanualOpposedPrismaticGraspAffordance
AffordanceKit::BimanualOpposedPrismaticGraspAffordancePtr bimanualOpposedPrismaticGraspAffordance
Definition: AffordanceExtraction.h:196
armarx::AffordanceExtraction::liftAffordance
AffordanceKit::LiftAffordancePtr liftAffordance
Definition: AffordanceExtraction.h:185
armarx::AffordanceExtraction::timestampMutex
std::mutex timestampMutex
Definition: AffordanceExtraction.h:162
armarx::AffordanceExtraction::environmentalPrimitiveSegment
memoryx::EnvironmentalPrimitiveSegmentBasePrx environmentalPrimitiveSegment
Definition: AffordanceExtraction.h:172
armarx::AffordanceExtraction::bimanualPlatformGraspAffordance
AffordanceKit::BimanualPlatformGraspAffordancePtr bimanualPlatformGraspAffordance
Definition: AffordanceExtraction.h:190
armarx::AffordanceExtraction::affordanceExtractionThread
void affordanceExtractionThread()
Definition: AffordanceExtraction.cpp:311
armarx::Split
std::vector< std::string > Split(const std::string &source, const std::string &splitBy, bool trimElements=false, bool removeEmptyElements=false)
Definition: StringHelperTemplates.h:35
armarx::AffordanceExtraction::bimanualOpposedPlatformGraspAffordance
AffordanceKit::BimanualOpposedPlatformGraspAffordancePtr bimanualOpposedPlatformGraspAffordance
Definition: AffordanceExtraction.h:195
armarx::AffordanceExtraction::bimanualLiftAffordance
AffordanceKit::BimanualLiftAffordancePtr bimanualLiftAffordance
Definition: AffordanceExtraction.h:200
armarx::TimestampVariant
Definition: TimestampVariant.h:54
armarx::AffordanceExtraction::embodiment
AffordanceKit::EmbodimentPtr embodiment
Definition: AffordanceExtraction.h:176
armarx::AffordanceExtraction::importScene
void importScene(const std::string &filename, const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:300
armarx::AffordanceExtraction::enabled
bool enabled
Definition: AffordanceExtraction.h:166
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::AffordanceExtraction::enableMutex
std::mutex enableMutex
Definition: AffordanceExtraction.h:165
armarx::AffordanceExtraction::isPipelineStepEnabled
bool isPipelineStepEnabled(const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:482
armarx::AffordanceExtraction::prismaticGraspAffordance
AffordanceKit::PrismaticGraspAffordancePtr prismaticGraspAffordance
Definition: AffordanceExtraction.h:179
Affordance.h
armarx::AffordanceExtraction::workingMemoryPrx
memoryx::WorkingMemoryInterfacePrx workingMemoryPrx
Definition: AffordanceExtraction.h:170
StringHelpers.h
armarx::AffordanceExtraction::leanAffordance
AffordanceKit::LeanAffordancePtr leanAffordance
Definition: AffordanceExtraction.h:183
armarx::AffordanceExtraction::enablePipelineStep
void enablePipelineStep(const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:466
IceInternal::Handle< ::Ice::Communicator >
armarx::AffordanceExtraction::unimanualAffordances
std::vector< AffordanceKit::UnimanualAffordancePtr > unimanualAffordances
Definition: AffordanceExtraction.h:204
armarx::AffordanceExtractionPropertyDefinitions
Definition: AffordanceExtraction.h:72
armarx::AffordanceExtraction::turnAffordance
AffordanceKit::TurnAffordancePtr turnAffordance
Definition: AffordanceExtraction.h:186
armarx::AffordanceExtraction::onDisconnectComponent
void onDisconnectComponent() override
Definition: AffordanceExtraction.cpp:234
armarx::ctrlutil::a
double a(double t, double a0, double j)
Definition: CtrlUtil.h:45
armarx::AffordanceExtraction::bimanualAffordances
std::vector< AffordanceKit::BimanualAffordancePtr > bimanualAffordances
Definition: AffordanceExtraction.h:205
armarx::AffordanceExtraction::addObservation
void addObservation(const PoseBasePtr &endEffectorPose, const std::string &affordance, const std::string &primitiveId, float result, float certainty, float sigma_pos, float sigma_rot, const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:243
armarx::AffordanceExtraction::pullAffordance
AffordanceKit::PullAffordancePtr pullAffordance
Definition: AffordanceExtraction.h:188
TimestampVariant.h
armarx::AffordanceExtraction::supportAffordance
AffordanceKit::SupportAffordancePtr supportAffordance
Definition: AffordanceExtraction.h:182
AffordanceKitArmarX::PrimitiveSetArmarX
Definition: PrimitiveSetArmarX.h:32
enabled
std::atomic< bool > * enabled
Definition: RemoteGuiWidgetController.cpp:75
MemoryXCoreObjectFactories.h
AffordanceKitArmarX::SceneArmarX
Definition: SceneArmarX.h:33
filename
std::string filename
Definition: VisualizationRobot.cpp:83
armarx::AffordanceExtraction::affordanceTypes
std::map< std::string, memoryx::AffordanceType > affordanceTypes
Definition: AffordanceExtraction.h:202
SceneArmarX.h
ARMARX_ERROR
#define ARMARX_ERROR
Definition: Logging.h:189
armarx::AffordanceExtraction::primitiveSegmentation
AffordanceKit::PrimitiveSetPtr primitiveSegmentation
Definition: AffordanceExtraction.h:174
armarx::AffordanceExtraction::disablePipelineStep
void disablePipelineStep(const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:474
armarx::AffordanceExtraction::bimanualGraspAffordance
AffordanceKit::BimanualGraspAffordancePtr bimanualGraspAffordance
Definition: AffordanceExtraction.h:192
armarx::AffordanceExtraction::graspAffordance
AffordanceKit::GraspAffordancePtr graspAffordance
Definition: AffordanceExtraction.h:180
armarx::AffordanceExtraction::bimanualAlignedPrismaticGraspAffordance
AffordanceKit::BimanualAlignedPrismaticGraspAffordancePtr bimanualAlignedPrismaticGraspAffordance
Definition: AffordanceExtraction.h:198
armarx::AffordanceExtraction::bimanualOpposedGraspAffordance
AffordanceKit::BimanualOpposedGraspAffordancePtr bimanualOpposedGraspAffordance
Definition: AffordanceExtraction.h:193
armarx::AffordanceExtraction::AffordanceExtraction
AffordanceExtraction()
Definition: AffordanceExtraction.cpp:42
armarx::armem::Time
armarx::core::time::DateTime Time
Definition: forward_declarations.h:13
armarx::AffordanceExtraction::primitivesMutex
std::mutex primitivesMutex
Definition: AffordanceExtraction.h:159
AffordanceExtraction.h
armarx::AffordanceExtraction::bimanualPrismaticGraspAffordance
AffordanceKit::BimanualPrismaticGraspAffordancePtr bimanualPrismaticGraspAffordance
Definition: AffordanceExtraction.h:191
armarx::ManagedIceObject::usingTopic
void usingTopic(const std::string &name, bool orderedPublishing=false)
Registers a proxy for subscription after initialization.
Definition: ManagedIceObject.cpp:248
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
GfxTL::Matrix4f
MatrixXX< 4, 4, float > Matrix4f
Definition: MatrixXX.h:601
armarx::AffordanceExtraction::hasNewPrimitives
bool hasNewPrimitives
Definition: AffordanceExtraction.h:160
ARMARX_INFO
#define ARMARX_INFO
Definition: Logging.h:174
armarx::AffordanceExtraction::bimanualAlignedPlatformGraspAffordance
AffordanceKit::BimanualAlignedPlatformGraspAffordancePtr bimanualAlignedPlatformGraspAffordance
Definition: AffordanceExtraction.h:197
armarx::AffordanceExtraction::affordanceExtractionTask
PeriodicTask< AffordanceExtraction >::pointer_type affordanceExtractionTask
Definition: AffordanceExtraction.h:168
armarx::ManagedIceObject::offeringTopic
void offeringTopic(const std::string &name)
Registers a topic for retrival after initialization.
Definition: ManagedIceObject.cpp:290
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::AffordanceExtraction::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: AffordanceExtraction.cpp:461
armarx::AffordanceExtraction::onConnectComponent
void onConnectComponent() override
Definition: AffordanceExtraction.cpp:201
MemoryXTypesObjectFactories.h
armarx::AffordanceExtraction::platformGraspAffordance
AffordanceKit::PlatformGraspAffordancePtr platformGraspAffordance
Definition: AffordanceExtraction.h:178
armarx::ManagedIceObject::getName
std::string getName() const
Retrieve name of object.
Definition: ManagedIceObject.cpp:107
armarx::PeriodicTask
Definition: ArmarXManager.h:70
armarx::AffordanceExtraction::reportNewPointCloudSegmentation
void reportNewPointCloudSegmentation(const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:49
PrimitiveSetArmarX.h
armarx::AffordanceExtraction::bimanualAlignedGraspAffordance
AffordanceKit::BimanualAlignedGraspAffordancePtr bimanualAlignedGraspAffordance
Definition: AffordanceExtraction.h:194
armarx::AffordanceExtraction::holdAffordance
AffordanceKit::HoldAffordancePtr holdAffordance
Definition: AffordanceExtraction.h:184
ARMARX_WARNING
#define ARMARX_WARNING
Definition: Logging.h:186
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
armarx::AffordanceExtraction::exportScene
void exportScene(const std::string &filename, const Ice::Current &c=Ice::emptyCurrent) override
Definition: AffordanceExtraction.cpp:292
armarx::AffordanceExtraction::listenerPrx
AffordanceExtractionListenerPrx listenerPrx
Definition: AffordanceExtraction.h:155
armarx::ManagedIceObject::usingProxy
bool usingProxy(const std::string &name, const std::string &endpoints="")
Registers a proxy for retrieval after initialization and adds it to the dependency list.
Definition: ManagedIceObject.cpp:151
armarx::ctrlutil::s
double s(double t, double s0, double v0, double a0, double j)
Definition: CtrlUtil.h:33
armarx::AffordanceExtraction::bimanualTurnAffordance
AffordanceKit::BimanualTurnAffordancePtr bimanualTurnAffordance
Definition: AffordanceExtraction.h:199
armarx::AffordanceExtraction::affordanceExtractionCertainty
float affordanceExtractionCertainty
Definition: AffordanceExtraction.h:210
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
armarx::AffordanceExtraction::affordanceSegment
memoryx::AffordanceSegmentBasePrx affordanceSegment
Definition: AffordanceExtraction.h:171
armarx::AffordanceExtraction::debugObserver
DebugObserverInterfacePrx debugObserver
Definition: AffordanceExtraction.h:213
armarx::AffordanceExtraction::maxPrimitiveSamplingSize
unsigned int maxPrimitiveSamplingSize
Definition: AffordanceExtraction.h:209