UCLObjectRecognition.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 VisionX::ArmarXObjects::UCLObjectRecognition
17  * @author Mirko Waechter (waechter at kit dot edu)
18  * @date 2017
19  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20  * GNU General Public License
21  */
22 
23 #pragma once
24 
25 #include <VirtualRobot/Robot.h>
26 
28 #include <RobotAPI/interface/core/RobotState.h>
29 #include <RobotAPI/interface/speech/SpeechInterface.h>
30 #include <RobotAPI/interface/visualization/DebugDrawerInterface.h>
31 
32 #include <MemoryX/interface/components/LongtermMemoryInterface.h>
33 
35 #include <VisionX/interface/components/FaceRecognitionInterface.h>
36 #include <VisionX/interface/components/ObjectPoseInterface.h>
37 #include <VisionX/interface/components/PointCloudAndImageAndCalibrationProviderInterface.h>
39 
40 //#include <Python.h>
41 
42 
43 namespace visionx
44 {
45  /**
46  * @class UCLObjectRecognitionPropertyDefinitions
47  * @brief
48  */
51  {
52  public:
55  {
56  defineOptionalProperty<std::string>("AgentName", "Armar6", "Name of the robot that does the localization");
57  defineOptionalProperty<std::string>("CameraFrameName", "DepthCamera", "Name of the camera frame of the robot that does the localization");
58  defineOptionalProperty<std::string>("ObjectNameIdMap", "spraybottle:5;brush:1", "map between object names and mask rcnn names");
59 
60  defineOptionalProperty<std::string>("RobotStateComponentName", "RobotStateComponent", "Name of the robot state component that should be used");
61  defineOptionalProperty<std::string>("DebugDrawerTopicName", "DebugDrawerUpdates", "Name of the debug drawer topic");
62  }
63  };
64 
65  /**
66  * @defgroup Component-UCLObjectRecognition UCLObjectRecognition
67  * @ingroup VisionX-Components
68  * A description of the component UCLObjectRecognition.
69  *
70  * @class UCLObjectRecognition
71  * @ingroup Component-UCLObjectRecognition
72  * @brief Brief description of class UCLObjectRecognition.
73  *
74  * Detailed description of class UCLObjectRecognition.
75  */
77  public armarx::Component,
78  virtual public memoryx::ObjectLocalizerInterface
79  {
80  public:
81  /**
82  * @see armarx::ManagedIceObject::getDefaultName()
83  */
84  std::string getDefaultName() const override
85  {
86  return "UCLObjectRecognition";
87  }
88 
89  protected:
90  memoryx::ObjectLocalizationResultList localizeAndIdentifyFaces(CByteImage** cameraImages, armarx::MetaInfoSizeBasePtr imageMetaInfo, CByteImage** resultImages);
91  /**
92  * @see PropertyUser::createPropertyDefinitions()
93  */
95  typedef std::map<std::string, std::list<std::pair<IceUtil::Time, double> > > FaceConfidenceHistory;
96  private:
97 
98  ObjectPoseInterfacePrx prx;
99  armarx::DebugDrawerInterfacePrx debugDrawerTopicPrx;
100  armarx::RobotStateComponentInterfacePrx robotStateComponent;
101  VirtualRobot::RobotPtr localRobot;
102  public:
103  memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList& classes, const Ice::Current&) override;
104 
105  // ManagedIceObject interface
106  protected:
107  void onInitComponent() override;
108  void onConnectComponent() override;
109 
110  };
111 }
112 
RemoteRobot.h
visionx
ArmarX headers.
Definition: OpenPoseStressTest.h:38
visionx::UCLObjectRecognition::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: UCLObjectRecognition.cpp:52
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
visionx::UCLObjectRecognition::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: UCLObjectRecognition.cpp:80
ObjectLocalizerProcessor.h
visionx::UCLObjectRecognitionPropertyDefinitions::UCLObjectRecognitionPropertyDefinitions
UCLObjectRecognitionPropertyDefinitions(std::string prefix)
Definition: UCLObjectRecognition.h:53
visionx::UCLObjectRecognitionPropertyDefinitions
Definition: UCLObjectRecognition.h:49
visionx::UCLObjectRecognition::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: UCLObjectRecognition.cpp:61
visionx::UCLObjectRecognition::FaceConfidenceHistory
std::map< std::string, std::list< std::pair< IceUtil::Time, double > > > FaceConfidenceHistory
Definition: UCLObjectRecognition.h:95
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
visionx::UCLObjectRecognition
Brief description of class UCLObjectRecognition.
Definition: UCLObjectRecognition.h:76
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
visionx::UCLObjectRecognition::getDefaultName
std::string getDefaultName() const override
Definition: UCLObjectRecognition.h:84
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::DebugDrawerInterface >
armarx::ComponentPropertyDefinitions::ComponentPropertyDefinitions
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition: Component.cpp:37
TypeMapping.h
visionx::UCLObjectRecognition::localizeObjectClasses
memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList &classes, const Ice::Current &) override
Definition: UCLObjectRecognition.cpp:88
visionx::UCLObjectRecognition::localizeAndIdentifyFaces
memoryx::ObjectLocalizationResultList localizeAndIdentifyFaces(CByteImage **cameraImages, armarx::MetaInfoSizeBasePtr imageMetaInfo, CByteImage **resultImages)
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:18