ObjectShapeClassification.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2011-2016, High Performance Humanoid Technologies (H2T), Karlsruhe Institute of Technology (KIT), all rights reserved.
5  *
6  * ArmarX is free software; you can redistribute it and/or modify
7  * it under the terms of the GNU General Public License version 2 as
8  * published by the Free Software Foundation.
9  *
10  * ArmarX is distributed in the hope that it will be useful, but
11  * WITHOUT ANY WARRANTY; without even the implied warranty of
12  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13  * GNU General Public License for more details.
14  *
15  * You should have received a copy of the GNU General Public License
16  * along with this program. If not, see <http://www.gnu.org/licenses/>.
17  *
18  * @package
19  * @author
20  * @date
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 #pragma once
25 
27 
28 // RobotAPI
30 
31 // Core
34 
35 // VisionX
37 #include <VisionX/interface/components/ObjectShapeClassification.h>
38 
39 // MemoryX
40 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
43 
44 //Eigen
45 #include <Eigen/Core>
46 
47 #include <map>
48 #include <string>
49 #include <set>
50 #include <vector>
51 #include <mutex>
52 
53 
54 namespace visionx
55 {
56 
57 
60  {
61  public:
64  {
65  defineOptionalProperty<std::string>("PriorKnowledgeMemoryProxyName", "PriorKnowledge", "Proxy name for the prior knowledge memory component");
66  }
67  };
68 
69  using Point = Eigen::Vector3f;
70  using Points = std::vector<Point>;
71  using TaggedPoints = std::pair<std::string, Points>;
72 
74  virtual public visionx::ObjectShapeClassificationInterface,
75  virtual public armarx::Component
76  {
77  public:
78 
79  std::string getDefaultName() const
80  {
81  return "ObjectShapeClassification";
82  }
83 
84  void onInitComponent();
85  void onConnectComponent();
86 
87 
88  std::string FindSimilarKnownObject(const ::visionx::types::PointList& segmentedObjectPoints, const ::Ice::Current&);
89 
90  protected:
91  /**
92  * @see PropertyUser::createPropertyDefinitions()
93  */
95  {
97  }
98 
99  private:
100  FeatureCalculator featureCalculator;
101 
102  void refetchObjects();
103  void checkFeatures();
104  Points getPointsFromIV(memoryx::ObjectClassPtr obj);
105  void matchToFoundPointCloud(const Points& newPoints, const Points& foundPointCloud);
106  TaggedPoints compareToDB(Points& points);
107 
108  std::recursive_mutex mutexEntities;
109 
110  memoryx::PriorKnowledgeInterfacePrx memoryPrx;
111  memoryx::CommonStorageInterfacePrx databasePrx;
112  memoryx::PersistentObjectClassSegmentBasePrx classesSegmentPrx;
113 
114  memoryx::GridFileManagerPtr fileManager;
115 
116  std::vector<memoryx::ObjectClassPtr> dbObjects;
117 
118  std::string settings_priorMemory;
119 
120  bool connected;
121  };
122 
123 }
124 
125 
126 
LinkedPose.h
visionx::ObjectShapeClassification::FindSimilarKnownObject
std::string FindSimilarKnownObject(const ::visionx::types::PointList &segmentedObjectPoints, const ::Ice::Current &)
Definition: ObjectShapeClassification.cpp:257
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::ObjectShapeClassification::onInitComponent
void onInitComponent()
Pure virtual hook for the subclass.
Definition: ObjectShapeClassification.cpp:56
visionx::Points
std::vector< Point > Points
Definition: ObjectShapeClassification.h:70
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
GridFileManager.h
visionx::ObjectShapeClassificationPropertyDefinitions
Definition: ObjectShapeClassification.h:58
ObjectClass.h
Observer.h
IceInternal::Handle< ObjectClass >
ImageProcessor.h
Point
Definition: PointCloud.h:21
visionx::ObjectShapeClassification::getDefaultName
std::string getDefaultName() const
Retrieve default name of component.
Definition: ObjectShapeClassification.h:79
FeatureCalculator.hpp
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:74
visionx::TaggedPoints
std::pair< std::string, Points > TaggedPoints
Definition: ObjectShapeClassification.h:71
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
memoryx::GridFileManagerPtr
std::shared_ptr< GridFileManager > GridFileManagerPtr
Definition: AbstractEntityWrapper.h:32
IceUtil::Handle< class PropertyDefinitionContainer >
visionx::ObjectShapeClassification
Definition: ObjectShapeClassification.h:73
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
visionx::ObjectShapeClassification::onConnectComponent
void onConnectComponent()
Pure virtual hook for the subclass.
Definition: ObjectShapeClassification.cpp:76
visionx::ObjectShapeClassificationPropertyDefinitions::ObjectShapeClassificationPropertyDefinitions
ObjectShapeClassificationPropertyDefinitions(std::string prefix)
Definition: ObjectShapeClassification.h:62
ChannelRef.h
FeatureCalculator
Definition: FeatureCalculator.hpp:35
visionx::ObjectShapeClassification::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions()
Definition: ObjectShapeClassification.h:94