GraspablePredicateProvider.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 ArmarX::
17* @author Valerij Wittenbeck ( valerij.wittenbeck at student dot kit dot edu)
18* @date 2015
19* @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20* GNU General Public License
21*/
22
23#pragma once
24
26
27#include "Box.hpp"
30#include <MemoryX/interface/components/WorkingMemoryInterface.h>
31#include <MemoryX/interface/memorytypes/MemorySegments.h>
34
35namespace memoryx
36{
39 {
40 public:
43 {
45 "DebugDrawerTopicName",
46 "DebugDrawerUpdates",
47 "Where to draw the provided bounding boxes (if empty -> don't draw)");
48 //countertop;sideboard?;fridge;table?
50 "BoundingBoxesR",
51 "2960.0 9885.0 1000.0 1970.0 990.0 500.0;4490.0 7100.0 1000.0 1000.0 1180.0 "
52 "500.0;4465.0 10255.0 1750 490.0 500.0 2000;2680 6051 1100 800 800 500",
53 "Format: 'xCenter yCenter zCenter xSize ySize zSize' for one 6-tuple, separate "
54 "multiple tuples with ';'");
56 "BoundingBoxesL",
57 "3350.0 9960.0 1000.0 1820.0 840.0 500.0;4490.0 7100.0 1000.0 1000.0 1180.0 "
58 "500.0;4465.0 10255.0 1750 490.0 500.0 2000;2680 6051 1100 800 800 500",
59 "Format: 'xCenter yCenter zCenter xSize ySize zSize' for one 6-tuple, separate "
60 "multiple tuples with ';'");
61 }
62 };
63
65 {
66 public:
68
69 // ManagedIceObject interface
70 protected:
71 void onInitWorldStateUpdater() override;
72 void onConnectWorldStateUpdater() override;
73 std::string getDefaultName() const override;
74
81
82 // WorldStateUpdaterInterface interface
83 public:
84 PredicateInfoList getPredicateInfos(const Ice::Current& = Ice::emptyCurrent) override;
85 PredicateInstanceList calcPredicates(const Ice::Current& = Ice::emptyCurrent) override;
86
87 private:
88 struct GraspabilityDescriptor
89 {
90 std::string className;
91 bool hasGraspableSuperclass;
92 bool hasLeftGrasp;
93 bool hasRightGrasp;
94 };
95
96 std::vector<Box> stringToBoxes(const std::string& boxesString);
97 void addPredicateIfInside(PredicateInstanceList& result,
98 const std::string& predicateName,
99 const ObjectInstancePtr& obj,
100 const std::vector<Box>& boxes);
101 std::string debugDrawerTopicName;
102 std::vector<Box> boxesL;
103 std::vector<Box> boxesR;
104 WorkingMemoryInterfacePrx wm;
105 WorkingMemoryEntitySegmentBasePrx objectInstances;
106 PriorKnowledgeInterfacePrx prior;
107 PersistentObjectClassSegmentBasePrx objectClasses;
108
109 armarx::DrawColor leftColor;
110 armarx::DrawColor rightColor;
111 PredicateInfo leftGraspable;
112 PredicateInfo rightGraspable;
113
114 memoryx::GridFileManagerPtr fileManager;
115 std::vector<GraspabilityDescriptor> graspabilityDescriptors;
116 };
117
118} // namespace memoryx
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
PropertyDefinition< PropertyType > & defineOptionalProperty(const std::string &name, PropertyType defaultValue, const std::string &description="", PropertyDefinitionBase::PropertyConstness constness=PropertyDefinitionBase::eConstant)
PredicateInfoList getPredicateInfos(const Ice::Current &=Ice::emptyCurrent) override
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
std::string getDefaultName() const override
Retrieve default name of component.
PredicateInstanceList calcPredicates(const Ice::Current &=Ice::emptyCurrent) override
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
VirtualRobot headers.
IceInternal::Handle< ObjectInstance > ObjectInstancePtr
std::shared_ptr< GridFileManager > GridFileManagerPtr