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
41 #include <MemoryX/interface/components/PriorKnowledgeInterface.h>
43 
44 //Eigen
45 #include <map>
46 #include <mutex>
47 #include <set>
48 #include <string>
49 #include <vector>
50 
51 #include <Eigen/Core>
52 
53 namespace visionx
54 {
55 
56 
58  {
59  public:
62  {
63  defineOptionalProperty<std::string>(
64  "PriorKnowledgeMemoryProxyName",
65  "PriorKnowledge",
66  "Proxy name for the prior knowledge memory component");
67  }
68  };
69 
70  using Point = Eigen::Vector3f;
71  using Points = std::vector<Point>;
72  using TaggedPoints = std::pair<std::string, Points>;
73 
75  virtual public visionx::ObjectShapeClassificationInterface,
76  virtual public armarx::Component
77  {
78  public:
79  std::string
81  {
82  return "ObjectShapeClassification";
83  }
84 
85  void onInitComponent();
86  void onConnectComponent();
87 
88 
89  std::string FindSimilarKnownObject(const ::visionx::types::PointList& segmentedObjectPoints,
90  const ::Ice::Current&);
91 
92  protected:
93  /**
94  * @see PropertyUser::createPropertyDefinitions()
95  */
98  {
101  }
102 
103  private:
104  FeatureCalculator featureCalculator;
105 
106  void refetchObjects();
107  void checkFeatures();
108  Points getPointsFromIV(memoryx::ObjectClassPtr obj);
109  void matchToFoundPointCloud(const Points& newPoints, const Points& foundPointCloud);
110  TaggedPoints compareToDB(Points& points);
111 
112  std::recursive_mutex mutexEntities;
113 
114  memoryx::PriorKnowledgeInterfacePrx memoryPrx;
115  memoryx::CommonStorageInterfacePrx databasePrx;
116  memoryx::PersistentObjectClassSegmentBasePrx classesSegmentPrx;
117 
118  memoryx::GridFileManagerPtr fileManager;
119 
120  std::vector<memoryx::ObjectClassPtr> dbObjects;
121 
122  std::string settings_priorMemory;
123 
124  bool connected;
125  };
126 
127 } // namespace visionx
LinkedPose.h
visionx::ObjectShapeClassification::FindSimilarKnownObject
std::string FindSimilarKnownObject(const ::visionx::types::PointList &segmentedObjectPoints, const ::Ice::Current &)
Definition: ObjectShapeClassification.cpp:271
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::ObjectShapeClassification::onInitComponent
void onInitComponent()
Pure virtual hook for the subclass.
Definition: ObjectShapeClassification.cpp:57
visionx::Points
std::vector< Point > Points
Definition: ObjectShapeClassification.h:71
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
GridFileManager.h
visionx::ObjectShapeClassificationPropertyDefinitions
Definition: ObjectShapeClassification.h:57
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:80
FeatureCalculator.hpp
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:91
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
visionx::TaggedPoints
std::pair< std::string, Points > TaggedPoints
Definition: ObjectShapeClassification.h:72
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
memoryx::GridFileManagerPtr
std::shared_ptr< GridFileManager > GridFileManagerPtr
Definition: AbstractEntityWrapper.h:33
IceUtil::Handle< class PropertyDefinitionContainer >
visionx::ObjectShapeClassification
Definition: ObjectShapeClassification.h:74
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
visionx::ObjectShapeClassification::onConnectComponent
void onConnectComponent()
Pure virtual hook for the subclass.
Definition: ObjectShapeClassification.cpp:78
visionx::ObjectShapeClassificationPropertyDefinitions::ObjectShapeClassificationPropertyDefinitions
ObjectShapeClassificationPropertyDefinitions(std::string prefix)
Definition: ObjectShapeClassification.h:60
ChannelRef.h
FeatureCalculator
Definition: FeatureCalculator.hpp:35
visionx::ObjectShapeClassification::createPropertyDefinitions
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions()
Definition: ObjectShapeClassification.h:97