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
53namespace visionx
54{
55
56
58 {
59 public:
62 {
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 */
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
Default component property definition container.
Definition Component.h:70
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition Component.h:94
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)
std::string FindSimilarKnownObject(const ::visionx::types::PointList &segmentedObjectPoints, const ::Ice::Current &)
void onInitComponent()
Pure virtual hook for the subclass.
std::string getDefaultName() const
Retrieve default name of component.
void onConnectComponent()
Pure virtual hook for the subclass.
virtual armarx::PropertyDefinitionsPtr createPropertyDefinitions()
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
IceInternal::Handle< ObjectClass > ObjectClassPtr
Definition ObjectClass.h:35
std::shared_ptr< GridFileManager > GridFileManagerPtr
ArmarX headers.
Eigen::Vector3f Point
std::vector< Point > Points
std::pair< std::string, Points > TaggedPoints