ActionMultiplePinchTight.h
Go to the documentation of this file.
1 /*
2  * Copyright (C) 2020 IIT-HHCM
3  * Author: Davide Torielli
4  * email: davide.torielli@iit.it
5  *
6  * Licensed under the Apache License, Version 2.0 (the "License");
7  * you may not use this file except in compliance with the License.
8  * You may obtain a copy of the License at
9  *
10  * http://www.apache.org/licenses/LICENSE-2.0
11  *
12  * Unless required by applicable law or agreed to in writing, software
13  * distributed under the License is distributed on an "AS IS" BASIS,
14  * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
15  * See the License for the specific language governing permissions and
16  * limitations under the License.
17  */
18 
19 #ifndef __ROSEE_ACTIONMULTIPLEPINCHTIGHT_H
20 #define __ROSEE_ACTIONMULTIPLEPINCHTIGHT_H
21 
24 #include <yaml-cpp/yaml.h>
25 #include <iostream>
26 
27 namespace ROSEE {
28 
49 {
50 
51 public:
52 
53  typedef std::map < std::set<std::string>, ActionMultiplePinchTight > Map;
54 
56  typedef std::pair <JointPos, double> StateWithDepth;
57 
60  ActionMultiplePinchTight (std::set <std::string>, JointPos, double depthSum );
61 
62  JointPos getJointPos () const override;
63  JointPos getJointPos (unsigned int index) const;
64 
65  std::vector < ROSEE::JointPos > getAllJointPos () const override;
66 
71  std::vector < ROSEE::ActionMultiplePinchTight::StateWithDepth > getActionStates() const;
72 
83  bool insertActionState (JointPos, double depthSum);
84 
85  void print () const override;
86  void emitYaml ( YAML::Emitter& ) const override;
87  bool fillFromYaml( YAML::const_iterator yamlIt ) override;
88 
89 private:
90 
95  struct depthComp {
96  bool operator() (const StateWithDepth& a, const StateWithDepth& b) const
97  {return (std::abs(a.second) < std::abs(b.second) );}
98  };
99 
105  std::set < StateWithDepth, depthComp > actionStates;
106 
107 };
108 
109 }
110 
111 #endif // __ROSEE_ACTIONMULTIPLEPINCHTIGHT_H
ROSEE
Definition: EEInterface.h:30
ActionPinchGeneric.h
ROSEE::ActionMultiplePinchTight::fillFromYaml
bool fillFromYaml(YAML::const_iterator yamlIt) override
function to fill members of the Action with infos taken from yaml files
Definition: ActionMultiplePinchTight.cpp:182
ROSEE::ActionPinchGeneric
A base virtual class for the PinchTight and PinchLoose classes. It includes member and method that ar...
Definition: ActionPinchGeneric.h:31
ROSEE::ActionMultiplePinchTight::depthComp::operator()
bool operator()(const StateWithDepth &a, const StateWithDepth &b) const
Definition: ActionMultiplePinchTight.h:96
ROSEE::ActionMultiplePinchTight::depthComp
struct to put in order the actionStates. with "<" we put as best the position that has less sumDepth.
Definition: ActionMultiplePinchTight.h:95
ROSEE::ActionMultiplePinchTight::emitYaml
void emitYaml(YAML::Emitter &) const override
Function to fill the argument passed with info about the action. Pure virtual because each derived cl...
Definition: ActionMultiplePinchTight.cpp:140
ROSEE::ActionMultiplePinchTight::insertActionState
bool insertActionState(JointPos, double depthSum)
function to insert a single action in the actionStates set of possible action. If the action is not s...
Definition: ActionMultiplePinchTight.cpp:78
ROSEE::ActionMultiplePinchTight::getAllJointPos
std::vector< ROSEE::JointPos > getAllJointPos() const override
Return all the joint position stored. If the concrete (derived from Action) has only one joint positi...
Definition: ActionMultiplePinchTight.cpp:52
ROSEE::ActionMultiplePinchTight
Class to describe the action of "pinching" with more than 2 tips (with 2 tips there is the ActionPinc...
Definition: ActionMultiplePinchTight.h:48
a
list a
ROSEE::ActionMultiplePinchTight::print
void print() const override
Overridable functions, if we want to make them more action-specific.
Definition: ActionMultiplePinchTight.cpp:108
ROSEE::ActionMultiplePinchTight::Map
std::map< std::set< std::string >, ActionMultiplePinchTight > Map
Definition: ActionMultiplePinchTight.h:53
ROSEE::ActionMultiplePinchTight::actionStates
std::set< StateWithDepth, depthComp > actionStates
For each multiple pinch possible, we want a set of action because we want to store (in general) more ...
Definition: ActionMultiplePinchTight.h:105
planning_scene.h
ROSEE::ActionMultiplePinchTight::getJointPos
JointPos getJointPos() const override
Get the position related to this action. Pure Virtual function: the derived class store this info dif...
Definition: ActionMultiplePinchTight.cpp:39
ROSEE::ActionMultiplePinchTight::StateWithDepth
std::pair< JointPos, double > StateWithDepth
A pair to "link" the JointPos with the depthSum info to order the StateWithDepth in the actionState s...
Definition: ActionMultiplePinchTight.h:56
ROSEE::JointPos
std::map< std::string, std::vector< double > > JointPos
The map to describe the position of all actuated joints. The key is the name of the string,...
Definition: Action.h:40
ROSEE::ActionMultiplePinchTight::getActionStates
std::vector< ROSEE::ActionMultiplePinchTight::StateWithDepth > getActionStates() const
Specific get for the ActionMultiplePinchTight to return the state with the paired depthSum.
Definition: ActionMultiplePinchTight.cpp:65
ROSEE::ActionMultiplePinchTight::ActionMultiplePinchTight
ActionMultiplePinchTight()
Definition: ActionMultiplePinchTight.cpp:21
ROSEE::ActionPrimitive::maxStoredActionStates
const unsigned int maxStoredActionStates
Definition: ActionPrimitive.h:95


end-effector
Author(s): Luca Muratore , Davide Torielli , Liana Bertoni
autogenerated on Sat Dec 14 2024 03:49:26