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
31namespace 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
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
#define ARMARXCOMPONENT_IMPORT_EXPORT
ComponentPropertyDefinitions(std::string prefix, bool hasObjectNameParameter=true)
Definition Component.cpp:46
Component()
Protected default constructor. Used for virtual inheritance. Use createManagedIceObject() instead.
Definition Component.cpp:66
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition Component.cpp:90
The GraspSelectionManager class.
std::vector< GraspSelectionCriterionInterfacePrx > criteria
PropertyDefinitionsPtr createPropertyDefinitions() override
std::string getDefaultName() const override
Retrieve default name of component.
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
This file offers overloads of toIce() and fromIce() functions for STL container types.
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.