GraspSelectionManager.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 RobotComponents::GraspSelectionManager
17 * @author Valerij Wittenbeck ( valerij.wittenbeck at student dot kit dot edu)
18 * @date 2016
19 * @copyright http://www.gnu.org/licenses/gpl-2.0.txt
20 * GNU General Public License
21 */
22 
23 #pragma once
24 
27 
28 #include <RobotComponents/interface/components/GraspingManager/GraspSelectionManagerInterface.h>
29 #include <RobotComponents/interface/components/GraspingManager/RobotPlacementInterface.h>
30 
31 namespace armarx
32 {
33 
36  {
37  public:
40  {
41  // defineOptionalProperty<float>("AskHumanThreshold", 0.7f, "Confidence threshold below which the human will be asked for confirmation of a replacement");
42  }
43  };
44 
45 
46  /*!
47  * \brief The GraspSelectionManager class
48  */
50  virtual public GraspSelectionManagerInterface,
51  virtual public Component
52  {
53  public:
54  // inherited from Component
55  std::string getDefaultName() const override
56  {
57  return "GraspSelectionManager";
58  }
59 
61  {
63  new GraspSelectionManagerPropertyDefinitions(getConfigIdentifier()));
64  }
65 
66  void onInitComponent() override;
67  void onConnectComponent() override;
68 
69  /**
70  * @brief Filters the grasps for each registered criterion.
71  *
72  * The criteria have to be defined in the calling method, before filterGrasps is called and register themselves
73  * with the GraspSelectionManager. If no criteria are
74  * defined, the criteria vector stays uninitilized and no grasps are filtered. In this case the original grasp
75  * list is returned. Otherwise, the list of grasps is filtered for/by each registered criterion.
76  *
77  * @param grasps
78  * @return list of grasps
79  */
80  GeneratedGraspList filterGrasps(const GeneratedGraspList& grasps, const Ice::Current& = Ice::emptyCurrent) override;
81  GraspingPlacementList filterPlacements(const GraspingPlacementList& placements, const Ice::Current& = Ice::emptyCurrent) override;
82  /**
83  * @brief Checks if a criterion is already registered; if not, register it with the GraspSelectionManager
84  * @param criterion
85  */
86  void registerAsGraspSelectionCriterion(const GraspSelectionCriterionInterfacePrx& criterion, const Ice::Current& = Ice::emptyCurrent) override;
87  GraspSelectionCriterionInterfaceList getRegisteredGraspSelectionCriteria(const Ice::Current&) override;
88  //FeedbackPublisherInterface
89 
90  std::vector<GraspSelectionCriterionInterfacePrx> criteria;
91  };
92 }
93 
armarx::GraspSelectionManager::criteria
std::vector< GraspSelectionCriterionInterfacePrx > criteria
Definition: GraspSelectionManager.h:90
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:333
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::GraspSelectionManagerPropertyDefinitions::GraspSelectionManagerPropertyDefinitions
GraspSelectionManagerPropertyDefinitions(std::string prefix)
Definition: GraspSelectionManager.h:38
armarx::GraspSelectionManager
The GraspSelectionManager class.
Definition: GraspSelectionManager.h:49
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:95
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:70
IceUtil::Handle< class PropertyDefinitionContainer >
armarx::GraspSelectionManagerPropertyDefinitions
Definition: GraspSelectionManager.h:34
armarx::GraspSelectionManager::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: GraspSelectionManager.h:55
armarx::GraspSelectionManager::createPropertyDefinitions
PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: GraspSelectionManager.h:60
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:34
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:28
ImportExportComponent.h