Classes | Public Types | Public Member Functions | Private Member Functions | Private Attributes | List of all members
ROSEE::ActionPinchTight Class Reference

The action of pinch with two tips. The two tips must collide for some hand configuration to mark this configuration as a pinchTight. All the non involved fingers are set in the default state. A pinchTight is defined by: More...

#include <ActionPinchTight.h>

Inheritance diagram for ROSEE::ActionPinchTight:
Inheritance graph
[legend]

Classes

struct  depthComp
 struct to put in order the actionStates. The first elements are the ones with greater depth , even if is almost impossible, two different contact with same depth will be considered equal with this definition of depthComp. Theoretically they are equal only if the joint status are equal (of only joints that act for the collision). In fact, we should have the possibility to have two contact with the same depth (if joint statuses are different), they will be equally good More...
 

Public Types

typedef std::map< std::pair< std::string, std::string >, ActionPinchTightMap
 
typedef std::pair< JointPos, collision_detection::ContactStateWithContact
 A pair to "link" the JointPos with infos about the collision among the two tips. More...
 
- Public Types inherited from ROSEE::ActionPrimitive
typedef std::shared_ptr< const ActionPrimitiveConstPtr
 
typedef std::shared_ptr< ActionPrimitivePtr
 
enum  Type {
  PinchTight, PinchLoose, MultiplePinchTight, Trig,
  TipFlex, FingFlex, SingleJointMultipleTips, None
}
 Enum useful to discriminate each primitive action when, for example, we want to parse a file if you change this enum, change also the ROSEEControl.msg accordingly. More...
 
- Public Types inherited from ROSEE::Action
typedef std::shared_ptr< const ActionConstPtr
 
typedef std::shared_ptr< ActionPtr
 
enum  Type {
  Primitive, Generic, Composed, Timed,
  None
}
 Enum useful to discriminate each action when, for example, we want to parse a file if you change this enum, change also the ROSEEControl.msg accordingly. More...
 

Public Member Functions

 ActionPinchTight ()
 
 ActionPinchTight (unsigned int maxStoredActionStates)
 
 ActionPinchTight (std::pair< std::string, std::string >, JointPos, collision_detection::Contact)
 
 ActionPinchTight (std::string finger1, std::string finger2, JointPos, collision_detection::Contact)
 
void emitYaml (YAML::Emitter &) const override
 Function to fill the argument passed with info about the action. Pure virtual because each derived class has different infos and stored differently. check YamlWorker to correctly emit and parse the file. More...
 
bool fillFromYaml (YAML::const_iterator yamlIt) override
 function to fill members of the Action with infos taken from yaml files More...
 
std::vector< ROSEE::ActionPinchTight::StateWithContactgetActionStates () const
 Specific get for the ActionPinchTight to return the state with contact info. More...
 
std::vector< ROSEE::JointPosgetAllJointPos () const override
 Return all the joint position stored. If the concrete (derived from Action) has only one joint position info, this function is equal to getJointPos. More...
 
JointPos getJointPos () const override
 Get the position related to this action. Pure Virtual function: the derived class store this info differently so they are in charge of providing the read. More...
 
JointPos getJointPos (unsigned int index) const
 
bool insertActionState (JointPos, collision_detection::Contact)
 function to insert a single action in the actionStates set of possible action. If the action is not so good (based on depth now) the action is not inserted and the function return false More...
 
void print () const override
 
- Public Member Functions inherited from ROSEE::ActionPinchGeneric
 ActionPinchGeneric (std::string name, ActionPrimitive::Type type)
 
 ActionPinchGeneric (std::string name, unsigned int maxStoredActionStates, ActionPrimitive::Type type)
 
 ActionPinchGeneric (std::string name, unsigned int nFingerInvolved, unsigned int maxStoredActionStates, ActionPrimitive::Type type)
 
std::set< std::string > getKeyElements () const override
 Necessary method to know the key used by the maps which store all the Actions of one type. Used by YamlWorker. More...
 
- Public Member Functions inherited from ROSEE::ActionPrimitive
unsigned int getMaxStoredActionStates () const
 
unsigned int getnFingersInvolved () const
 
Type getPrimitiveType () const
 
void setJointsInvolvedCount (ROSEE::JointsInvolvedCount jointsInvolvedCount)
 
virtual ~ActionPrimitive ()
 
- Public Member Functions inherited from ROSEE::Action
std::set< std::string > getFingersInvolved () const
 Get for fingersInvolved. More...
 
JointsInvolvedCount getJointsInvolvedCount () const
 Get for jointsInvolvedCount. More...
 
std::string getName () const
 Get the name of the action. More...
 
Type getType () const
 
virtual ~Action ()
 

Private Member Functions

bool emitYamlForContact (collision_detection::Contact, YAML::Emitter &) const
 

Private Attributes

std::set< StateWithContact, depthCompactionStates
 For each pair, we want a set of action because we want to store (in general) more possible way to do that action. The pinch among two tips can theoretically be done in infinite ways, we store the best ways found (ordering them by the depth of fingertips compenetration) More...
 

Additional Inherited Members

- Protected Member Functions inherited from ROSEE::ActionPrimitive
 ActionPrimitive (std::string name, unsigned int maxStoredActionStates, Type type)
 
 ActionPrimitive (std::string name, unsigned int nFingersInvolved, unsigned int maxStoredActionStates, Type type)
 Protected costructor: object creable only by derived classes. There is no default costructor (without arguments) because we want to set always these members. More...
 
- Protected Member Functions inherited from ROSEE::Action
 Action ()
 
 Action (std::string actionName, Action::Type type)
 
- Protected Attributes inherited from ROSEE::ActionPrimitive
const unsigned int maxStoredActionStates
 
unsigned int nFingersInvolved
 
const Type primitiveType
 
- Protected Attributes inherited from ROSEE::Action
std::set< std::string > fingersInvolved
 
JointsInvolvedCount jointsInvolvedCount
 
std::string name
 
Action::Type type
 

Detailed Description

The action of pinch with two tips. The two tips must collide for some hand configuration to mark this configuration as a pinchTight. All the non involved fingers are set in the default state. A pinchTight is defined by:

Definition at line 40 of file ActionPinchTight.h.

Member Typedef Documentation

◆ Map

typedef std::map< std::pair<std::string, std::string>, ActionPinchTight > ROSEE::ActionPinchTight::Map

Definition at line 45 of file ActionPinchTight.h.

◆ StateWithContact

A pair to "link" the JointPos with infos about the collision among the two tips.

Definition at line 49 of file ActionPinchTight.h.

Constructor & Destructor Documentation

◆ ActionPinchTight() [1/4]

ROSEE::ActionPinchTight::ActionPinchTight ( )

Definition at line 21 of file ActionPinchTight.cpp.

◆ ActionPinchTight() [2/4]

ROSEE::ActionPinchTight::ActionPinchTight ( unsigned int  maxStoredActionStates)

Definition at line 24 of file ActionPinchTight.cpp.

◆ ActionPinchTight() [3/4]

ROSEE::ActionPinchTight::ActionPinchTight ( std::pair< std::string, std::string >  fingerNamesPair,
JointPos  jp,
collision_detection::Contact  cont 
)

Definition at line 27 of file ActionPinchTight.cpp.

◆ ActionPinchTight() [4/4]

ROSEE::ActionPinchTight::ActionPinchTight ( std::string  finger1,
std::string  finger2,
JointPos  jp,
collision_detection::Contact  cont 
)

Definition at line 37 of file ActionPinchTight.cpp.

Member Function Documentation

◆ emitYaml()

void ROSEE::ActionPinchTight::emitYaml ( YAML::Emitter &  out) const
overridevirtual

Function to fill the argument passed with info about the action. Pure virtual because each derived class has different infos and stored differently. check YamlWorker to correctly emit and parse the file.

Parameters
outthe yaml-cpp emitter which store infos about the action
Note
this function does not print in a file, but simply fill a YAML::Emitter.

Reimplemented from ROSEE::ActionPrimitive.

Definition at line 156 of file ActionPinchTight.cpp.

◆ emitYamlForContact()

bool ROSEE::ActionPinchTight::emitYamlForContact ( collision_detection::Contact  moveitContact,
YAML::Emitter &  out 
) const
private

private function to be called by the emitYaml

Definition at line 294 of file ActionPinchTight.cpp.

◆ fillFromYaml()

bool ROSEE::ActionPinchTight::fillFromYaml ( YAML::const_iterator  yamlIt)
overridevirtual

function to fill members of the Action with infos taken from yaml files

Parameters
yamlIta YAML::const_iterator to the node that is loaded with YAML::LoadFile(dirPath + filename). check YamlWorker to correctly parse and emit the file

Implements ROSEE::Action.

Definition at line 197 of file ActionPinchTight.cpp.

◆ getActionStates()

std::vector< ROSEE::ActionPinchTight::StateWithContact > ROSEE::ActionPinchTight::getActionStates ( ) const

Specific get for the ActionPinchTight to return the state with contact info.

Returns
The vector (of size maxStoredActionStates) containing all the StateWithContact objects

Definition at line 73 of file ActionPinchTight.cpp.

◆ getAllJointPos()

std::vector< ROSEE::JointPos > ROSEE::ActionPinchTight::getAllJointPos ( ) const
overridevirtual

Return all the joint position stored. If the concrete (derived from Action) has only one joint position info, this function is equal to getJointPos.

Returns
vector containing all the joint pos of the action

Implements ROSEE::Action.

Definition at line 60 of file ActionPinchTight.cpp.

◆ getJointPos() [1/2]

ROSEE::JointPos ROSEE::ActionPinchTight::getJointPos ( ) const
overridevirtual

Get the position related to this action. Pure Virtual function: the derived class store this info differently so they are in charge of providing the read.

Returns
JointsPos the map indicating how the position of the joint

Implements ROSEE::Action.

Definition at line 47 of file ActionPinchTight.cpp.

◆ getJointPos() [2/2]

ROSEE::JointPos ROSEE::ActionPinchTight::getJointPos ( unsigned int  index) const

Definition at line 51 of file ActionPinchTight.cpp.

◆ insertActionState()

bool ROSEE::ActionPinchTight::insertActionState ( ROSEE::JointPos  jp,
collision_detection::Contact  cont 
)

function to insert a single action in the actionStates set of possible action. If the action is not so good (based on depth now) the action is not inserted and the function return false

Parameters
JointPosThe joints position
collision_detection::Contactthe contact associated with the action
Returns
TRUE if the action is good and is inserted in the set actionStates FALSE if the action given as param was not good as the others in the set actionStates and the set was already full (maxStoredActionStates)

Definition at line 86 of file ActionPinchTight.cpp.

◆ print()

void ROSEE::ActionPinchTight::print ( ) const
overridevirtual

For the pinch, we override these function to print, emit and parse the optional info Contact, which is specific of the pinch

Reimplemented from ROSEE::Action.

Definition at line 115 of file ActionPinchTight.cpp.

Member Data Documentation

◆ actionStates

std::set< StateWithContact, depthComp > ROSEE::ActionPinchTight::actionStates
private

For each pair, we want a set of action because we want to store (in general) more possible way to do that action. The pinch among two tips can theoretically be done in infinite ways, we store the best ways found (ordering them by the depth of fingertips compenetration)

Definition at line 109 of file ActionPinchTight.h.


The documentation for this class was generated from the following files:


end-effector
Author(s): Luca Muratore , Davide Torielli , Liana Bertoni
autogenerated on Tue Apr 5 2022 02:57:53