HandPredicateProvider.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 2014
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
26 #include <MemoryX/interface/memorytypes/MemorySegments.h>
27 #include <MemoryX/interface/components/WorkingMemoryInterface.h>
29 
30 namespace memoryx
31 {
32 
35  {
36  public:
39  {
40  defineOptionalProperty<float>("DistanceThreshold", 150.f, "Threshold below which an object is considered to be grasped (one hand)");
41  }
42  };
43 
45  {
46  public:
48 
49  // ManagedIceObject interface
50  protected:
51  void onInitWorldStateUpdater() override;
52  void onConnectWorldStateUpdater() override;
53  std::string getDefaultName() const override;
54 
56  {
60  }
61 
62  // WorldStateUpdaterInterface interface
63  public:
64  PredicateInfoList getPredicateInfos(const Ice::Current& = Ice::emptyCurrent) override;
65  PredicateInstanceList calcPredicates(const Ice::Current& = Ice::emptyCurrent) override;
66 
67  private:
68  struct ObjectInfo
69  {
70  enum class ObjectType
71  {
72  OneHandGraspable,
73  TwoHandGraspable,
74  Other
75  };
76 
77  ObjectInstancePtr objectInstance;
78  ObjectType type;
79  };
80 
81  WorkingMemoryInterfacePrx wm;
82  PriorKnowledgeInterfacePrx prior;
83 
84  AgentInstancesSegmentBasePrx agentInstances;
85  ObjectInstanceMemorySegmentBasePrx objectInstances;
86  PersistentObjectClassSegmentBasePrx objectClasses;
87 
88  float distanceThreshold;
89  float bothHandGraspedDistanceThreshold;
90 
91  PredicateInfo graspedPredicate;
92  PredicateInfo graspedBothPredicate;
93  PredicateInfo handEmptyPredicate;
94  };
95 
96 } // namespace memoryx
97 
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
memoryx::HandPredicateProvider::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: HandPredicateProvider.cpp:59
memoryx
VirtualRobot headers.
Definition: CommonPlacesTester.cpp:48
memoryx::WorldStateUpdaterBase
Definition: WorldStateUpdaterBase.h:44
ObjectMemoryObserver.h
memoryx::HandPredicateProvider::onConnectWorldStateUpdater
void onConnectWorldStateUpdater() override
Definition: HandPredicateProvider.cpp:48
memoryx::HandPredicateProviderPropertyDefinitions
Definition: HandPredicateProvider.h:33
memoryx::HandPredicateProvider::calcPredicates
PredicateInstanceList calcPredicates(const Ice::Current &=Ice::emptyCurrent) override
Definition: HandPredicateProvider.cpp:69
memoryx::ObjectInstancePtr
IceInternal::Handle< ObjectInstance > ObjectInstancePtr
Definition: ObjectInstance.h:42
WorldStateUpdaterBase.h
memoryx::HandPredicateProvider::HandPredicateProvider
HandPredicateProvider()
Definition: HandPredicateProvider.cpp:34
memoryx::WorldStateUpdaterPropertyDefinitions
Definition: WorldStateUpdaterBase.h:33
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
memoryx::HandPredicateProvider
Definition: HandPredicateProvider.h:44
memoryx::HandPredicateProvider::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: HandPredicateProvider.h:55
IceUtil::Handle< class PropertyDefinitionContainer >
memoryx::HandPredicateProviderPropertyDefinitions::HandPredicateProviderPropertyDefinitions
HandPredicateProviderPropertyDefinitions(std::string prefix)
Definition: HandPredicateProvider.h:37
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
memoryx::HandPredicateProvider::getPredicateInfos
PredicateInfoList getPredicateInfos(const Ice::Current &=Ice::emptyCurrent) override
Definition: HandPredicateProvider.cpp:64
memoryx::HandPredicateProvider::onInitWorldStateUpdater
void onInitWorldStateUpdater() override
Definition: HandPredicateProvider.cpp:42