NaturalGraspFilter.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
17 * @author Christoph Pohl ( christoph.pohl at 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 
26 
28 
30 
31 namespace armarx
32 {
34  {
35  public:
38  {
39  // defineOptionalProperty<std::string>("CommonPlacesLearnerName", "CommonPlacesLearnerGraspSelectionCriterion", "The CommonPlacesLearner to use");
40  }
41  };
42 
44  {
45  public:
47 
48  // ManagedIceObject interface
49  protected:
50  void onInitGraspSelectionCriterion() override;
51  void onConnectGraspSelectionCriterion() override;
52  std::string getDefaultName() const override;
53 
56  {
59  }
60 
61  public:
62  GeneratedGraspList filterGrasps(const GeneratedGraspList& grasps,
63  const Ice::Current&) override;
64 
65  /*****
66  * @brief Filters Grasps that are unnatural from the human point of view
67  *
68  * Checks if the X-Axis of the Grasp (points out of the back of the Hand for the Right Hand and into the
69  * direction for the Left Hand) is in the Unit-3Sphere in Robot Coordinates with the left half excluded
70  * (x < -0.1) and a circle cut out towards the robot; Based on heuristics for naturalness of a grasp.
71  **/
72  GraspingPlacementList filterPlacements(const GraspingPlacementList& placements,
73  const Ice::Current&) override;
74 
75  Ice::Int getHash(const Ice::Current&) const override;
76 
77  private:
79  VirtualRobot::RobotPtr localRobot;
80  bool
81  vectorIsWithinCircleSegment(const Eigen::Vector2f vector, double angle1, double angle2);
82  };
83 
84 } // namespace armarx
armarx::NaturalGraspFilter::getDefaultName
std::string getDefaultName() const override
Retrieve default name of component.
Definition: NaturalGraspFilter.cpp:59
armarx::NaturalGraspFilter::filterPlacements
GraspingPlacementList filterPlacements(const GraspingPlacementList &placements, const Ice::Current &) override
Definition: NaturalGraspFilter.cpp:86
armarx::NaturalGraspFilter::NaturalGraspFilter
NaturalGraspFilter()
Definition: NaturalGraspFilter.cpp:36
armarx::PropertyDefinitionContainer::prefix
std::string prefix
Prefix of the properties such as namespace, domain, component name, etc.
Definition: PropertyDefinitionContainer.h:345
armarx::NaturalGraspFilter
Definition: NaturalGraspFilter.h:43
armarx::GraspSelectionCriterionBase
Definition: GraspSelectionCriterionBase.h:44
GraspSelectionCriterionBase.h
armarx::NaturalGraspFilter::getHash
Ice::Int getHash(const Ice::Current &) const override
Definition: NaturalGraspFilter.cpp:131
armarx::NaturalGraspFilterPropertyDefinitions
Definition: NaturalGraspFilter.h:33
CommonPlacesLearner.h
Component.h
armarx::NaturalGraspFilter::filterGrasps
GeneratedGraspList filterGrasps(const GeneratedGraspList &grasps, const Ice::Current &) override
Definition: NaturalGraspFilter.cpp:65
armarx::Component::getConfigIdentifier
std::string getConfigIdentifier()
Retrieve config identifier for this component as set in constructor.
Definition: Component.cpp:79
armarx::NaturalGraspFilter::createPropertyDefinitions
armarx::PropertyDefinitionsPtr createPropertyDefinitions() override
Definition: NaturalGraspFilter.h:55
IceUtil::Handle< class PropertyDefinitionContainer >
IceInternal::ProxyHandle<::IceProxy::armarx::RobotStateComponentInterface >
armarx::VariantType::Int
const VariantTypeId Int
Definition: Variant.h:917
armarx::NaturalGraspFilter::onConnectGraspSelectionCriterion
void onConnectGraspSelectionCriterion() override
Definition: NaturalGraspFilter.cpp:48
armarx::NaturalGraspFilter::onInitGraspSelectionCriterion
void onInitGraspSelectionCriterion() override
Definition: NaturalGraspFilter.cpp:41
armarx::PropertyDefinitionsPtr
IceUtil::Handle< class PropertyDefinitionContainer > PropertyDefinitionsPtr
PropertyDefinitions smart pointer type.
Definition: forward_declarations.h:35
armarx::NaturalGraspFilterPropertyDefinitions::NaturalGraspFilterPropertyDefinitions
NaturalGraspFilterPropertyDefinitions(std::string prefix)
Definition: NaturalGraspFilter.h:36
armarx
This file offers overloads of toIce() and fromIce() functions for STL container types.
Definition: ArmarXTimeserver.cpp:27
armarx::GraspSelectionCriterionPropertyDefinitions
Definition: GraspSelectionCriterionBase.h:32
VirtualRobot::RobotPtr
std::shared_ptr< class Robot > RobotPtr
Definition: Bus.h:19