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 
35  {
36  public:
39  {
40  // defineOptionalProperty<float>("AskHumanThreshold", 0.7f, "Confidence threshold below which the human will be asked for confirmation of a replacement");
41  }
42  };
43 
44  /*!
45  * \brief The GraspSelectionManager class
46  */
48  virtual public GraspSelectionManagerInterface,
49  virtual public Component
50  {
51  public:
52  // inherited from Component
53  std::string
54  getDefaultName() const override
55  {
56  return "GraspSelectionManager";
57  }
58 
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,
81  const Ice::Current& = Ice::emptyCurrent) override;
82  GraspingPlacementList filterPlacements(const GraspingPlacementList& placements,
83  const Ice::Current& = Ice::emptyCurrent) override;
84  /**
85  * @brief Checks if a criterion is already registered; if not, register it with the GraspSelectionManager
86  * @param criterion
87  */
88  void registerAsGraspSelectionCriterion(const GraspSelectionCriterionInterfacePrx& criterion,
89  const Ice::Current& = Ice::emptyCurrent) override;
90  GraspSelectionCriterionInterfaceList
91  getRegisteredGraspSelectionCriteria(const Ice::Current&) override;
92  //FeedbackPublisherInterface
93 
94  std::vector<GraspSelectionCriterionInterfacePrx> criteria;
95  };
96 } // namespace armarx
armarx::GraspSelectionManager::criteria
std::vector< GraspSelectionCriterionInterfacePrx > criteria
Definition: GraspSelectionManager.h:94
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
ARMARXCOMPONENT_IMPORT_EXPORT
#define ARMARXCOMPONENT_IMPORT_EXPORT
Definition: ImportExportComponent.h:38
armarx::GraspSelectionManagerPropertyDefinitions::GraspSelectionManagerPropertyDefinitions
GraspSelectionManagerPropertyDefinitions(std::string prefix)
Definition: GraspSelectionManager.h:37
armarx::GraspSelectionManager
The GraspSelectionManager class.
Definition: GraspSelectionManager.h:47
Component.h
armarx::Component
Baseclass for all ArmarX ManagedIceObjects requiring properties.
Definition: Component.h:91
armarx::ComponentPropertyDefinitions
Default component property definition container.
Definition: Component.h:69
IceUtil::Handle
Definition: forward_declarations.h:30
armarx::GraspSelectionManagerPropertyDefinitions
Definition: GraspSelectionManager.h:34
armarx::GraspSelectionManager::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: GraspSelectionManager.h:54
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:35
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
ImportExportComponent.h