ObjectLocalizerDynamicSimulation.h
Go to the documentation of this file.
1 /*
2  * This file is part of ArmarX.
3  *
4  * Copyright (C) 2013-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 ArmarXSimulation::ArmarXObjects::ObjectLocalizerDynamicSimulation
19  * @author welke ( welke at kit dot edu )
20  * @date 2013
21  * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
22  * GNU General Public License
23  */
24 
25 #pragma once
26 
27 
29 #include <ArmarXCore/interface/observers/ObserverInterface.h>
30 
31 #include <MemoryX/interface/workingmemory/WorkingMemoryUpdaterBase.h>
32 #include <ArmarXSimulation/interface/simulator/SimulatorInterface.h>
33 //#include <Calibration/StereoCalibration.h>
34 //#include <Calibration/Calibration.h>
37 
38 
39 namespace armarx
40 {
43  {
44  public:
46  };
47 
48  /**
49  * @class ObjectLocalizerDynamicSimulation
50  * @brief This component connects to the ArmarX Simulator and reports object poses from the physics world.
51  * By default it uses the simulator topic with name "Simulator".
52  *
53  * @ingroup ArmarXSimulatorComponents
54  *
55  */
57  virtual public armarx::Component,
58  virtual public memoryx::ObjectLocalizerInterface
59  {
60  public:
61  EIGEN_MAKE_ALIGNED_OPERATOR_NEW
62 
63  /// @see PropertyUser::createPropertyDefinitions()
65 
66 
67  protected:
68 
69  void onInitComponent() override;
70  void onConnectComponent() override;
71  void onDisconnectComponent() override {}
72  void onExitComponent() override {}
73 
74  /**
75  * localizes simulated object instances
76  *
77  * @param objectClassNames names of the class to localize
78  *
79  * @return list of object instances
80  */
81  memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList& objectClassNames, const Ice::Current& c = Ice::emptyCurrent) override;
82 
83  /// @see armarx::ManagedIceObject::getDefaultName()
84  std::string getDefaultName() const override;
85 
87 
88 
89  private:
90 
91  //memoryx::MultivariateNormalDistributionPtr calculateLocalizationUncertainty(Vec2d left_point, Vec2d right_point);
92  //memoryx::MultivariateNormalDistributionPtr calculateLocalizationUncertainty(const Eigen::Vector3f& position);
93  //void getImagePositions(const Eigen::Vector3f& position, Vec2d& left_point, Vec2d& right_point);
94  //bool isVisible(const Eigen::Vector3f& position);
95 
96  std::string robotName;
97  std::string frameName;
98  float recognitionCertainty;
99  bool performVisibilityCheck;
100 
101  SimulatorInterfacePrx simulatorPrx;
102  //CStereoCalibration stereoCalibration;
103 
104  // noise
105  //Eigen::Vector2d imageNoiseLeft;
106  //Eigen::Vector2d imageNoiseRight;
107  };
108 }
109 
armarx::ObjectLocalizerDynamicSimulation::onConnectComponent
void onConnectComponent() override
Pure virtual hook for the subclass.
Definition: ObjectLocalizerDynamicSimulation.cpp:94
armarx::ObjectLocalizerDynamicSimulation::computePositionNoise
::memoryx::MultivariateNormalDistributionPtr computePositionNoise(const Eigen::Vector3f &pos)
Definition: ObjectLocalizerDynamicSimulation.cpp:100
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
armarx::ObjectLocalizerDynamicSimulation::onDisconnectComponent
void onDisconnectComponent() override
Hook for subclass.
Definition: ObjectLocalizerDynamicSimulation.h:71
c
constexpr T c
Definition: UnscentedKalmanFilterTest.cpp:43
armarx::ObjectLocalizerDynamicSimulationPropertyDefinitions
Definition: ObjectLocalizerDynamicSimulation.h:41
armarx::ObjectLocalizerDynamicSimulation::onInitComponent
void onInitComponent() override
Pure virtual hook for the subclass.
Definition: ObjectLocalizerDynamicSimulation.cpp:53
armarx::ObjectLocalizerDynamicSimulation::getDefaultName
std::string getDefaultName() const override
Definition: ObjectLocalizerDynamicSimulation.cpp:174
armarx::ObjectLocalizerDynamicSimulation::localizeObjectClasses
memoryx::ObjectLocalizationResultList localizeObjectClasses(const memoryx::ObjectClassNameList &objectClassNames, const Ice::Current &c=Ice::emptyCurrent) override
localizes simulated object instances
Definition: ObjectLocalizerDynamicSimulation.cpp:116
IceInternal::Handle
Definition: forward_declarations.h:8
armarx::ObjectLocalizerDynamicSimulation::onExitComponent
void onExitComponent() override
Hook for subclass.
Definition: ObjectLocalizerDynamicSimulation.h:72
armarx::ObjectLocalizerDynamicSimulation
This component connects to the ArmarX Simulator and reports object poses from the physics world....
Definition: ObjectLocalizerDynamicSimulation.h:56
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
ProbabilityMeasures.h
armarx::ObjectLocalizerDynamicSimulationPropertyDefinitions::ObjectLocalizerDynamicSimulationPropertyDefinitions
ObjectLocalizerDynamicSimulationPropertyDefinitions(std::string prefix)
Definition: ObjectLocalizerDynamicSimulation.cpp:40
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
Entity.h
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::ObjectLocalizerDynamicSimulation::createPropertyDefinitions
EIGEN_MAKE_ALIGNED_OPERATOR_NEW armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: ObjectLocalizerDynamicSimulation.cpp:285
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28