Public Types | Public Member Functions | Protected Member Functions | Protected Attributes | List of all members
ROSEE::Action Class Referenceabstract

The pure virtual class representing an Action. It has members that are in common to all derived class. More...

#include <Action.h>

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

Public Types

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 @remind if you change this enum, change also the ROSEEControl.msg accordingly. More...
 

Public Member Functions

virtual void emitYaml (YAML::Emitter &out) const =0
 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...
 
virtual bool fillFromYaml (YAML::const_iterator yamlIt)=0
 function to fill members of the Action with infos taken from yaml files More...
 
virtual std::vector< ROSEE::JointPosgetAllJointPos () const =0
 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...
 
std::set< std::string > getFingersInvolved () const
 Get for fingersInvolved. More...
 
virtual JointPos getJointPos () const =0
 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...
 
JointsInvolvedCount getJointsInvolvedCount () const
 Get for jointsInvolvedCount. More...
 
std::string getName () const
 Get the name of the action. More...
 
Type getType () const
 
virtual void print () const
 Overridable functions, if we want to make them more action-specific. More...
 
virtual ~Action ()
 

Protected Member Functions

 Action ()
 
 Action (std::string actionName, Action::Type type)
 

Protected Attributes

std::set< std::string > fingersInvolved
 
JointsInvolvedCount jointsInvolvedCount
 
std::string name
 
Action::Type type
 

Detailed Description

The pure virtual class representing an Action. It has members that are in common to all derived class.

Definition at line 71 of file Action.h.

Member Typedef Documentation

◆ ConstPtr

typedef std::shared_ptr<const Action> ROSEE::Action::ConstPtr

Definition at line 76 of file Action.h.

◆ Ptr

typedef std::shared_ptr<Action> ROSEE::Action::Ptr

Definition at line 75 of file Action.h.

Member Enumeration Documentation

◆ Type

Enum useful to discriminate each action when, for example, we want to parse a file @remind if you change this enum, change also the ROSEEControl.msg accordingly.

Enumerator
Primitive 
Generic 
Composed 
Timed 
None 

Definition at line 82 of file Action.h.

Constructor & Destructor Documentation

◆ ~Action()

virtual ROSEE::Action::~Action ( )
inlinevirtual

Definition at line 85 of file Action.h.

◆ Action() [1/2]

ROSEE::Action::Action ( )
protected

Definition at line 106 of file Action.cpp.

◆ Action() [2/2]

ROSEE::Action::Action ( std::string  actionName,
Action::Type  type 
)
protected

Definition at line 111 of file Action.cpp.

Member Function Documentation

◆ emitYaml()

virtual void ROSEE::Action::emitYaml ( YAML::Emitter &  out) const
pure virtual

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.

Implemented in ROSEE::ActionTimed, ROSEE::ActionComposed, ROSEE::ActionSingleJointMultipleTips, ROSEE::ActionGeneric, ROSEE::ActionPinchLoose, ROSEE::ActionMultiplePinchTight, ROSEE::ActionPinchTight, and ROSEE::ActionPrimitive.

◆ fillFromYaml()

virtual bool ROSEE::Action::fillFromYaml ( YAML::const_iterator  yamlIt)
pure virtual

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

Implemented in ROSEE::ActionTimed, ROSEE::ActionTrig, ROSEE::ActionComposed, ROSEE::ActionPinchLoose, ROSEE::ActionMultiplePinchTight, ROSEE::ActionGeneric, ROSEE::ActionSingleJointMultipleTips, and ROSEE::ActionPinchTight.

◆ getAllJointPos()

virtual std::vector< ROSEE::JointPos > ROSEE::Action::getAllJointPos ( ) const
pure virtual

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

Implemented in ROSEE::ActionTrig, ROSEE::ActionGeneric, ROSEE::ActionTimed, ROSEE::ActionMultiplePinchTight, ROSEE::ActionSingleJointMultipleTips, ROSEE::ActionPinchLoose, and ROSEE::ActionPinchTight.

◆ getFingersInvolved()

std::set< std::string > ROSEE::Action::getFingersInvolved ( ) const

Get for fingersInvolved.

Returns
std::set<std::string> the set containing all the hand's fingers involved in the action

Definition at line 125 of file Action.cpp.

◆ getJointPos()

virtual JointPos ROSEE::Action::getJointPos ( ) const
pure virtual

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

Implemented in ROSEE::ActionTrig, ROSEE::ActionSingleJointMultipleTips, ROSEE::ActionGeneric, ROSEE::ActionTimed, ROSEE::ActionMultiplePinchTight, ROSEE::ActionPinchLoose, and ROSEE::ActionPinchTight.

◆ getJointsInvolvedCount()

ROSEE::JointsInvolvedCount ROSEE::Action::getJointsInvolvedCount ( ) const

Get for jointsInvolvedCount.

Returns
JointsInvolvedCount the map indicating how many times the joint is set by the action

Definition at line 130 of file Action.cpp.

◆ getName()

std::string ROSEE::Action::getName ( ) const

Get the name of the action.

Returns
std::string the name of the action

Definition at line 116 of file Action.cpp.

◆ getType()

ROSEE::Action::Type ROSEE::Action::getType ( ) const

Definition at line 120 of file Action.cpp.

◆ print()

void ROSEE::Action::print ( ) const
virtual

Overridable functions, if we want to make them more action-specific.

Reimplemented in ROSEE::ActionTimed, ROSEE::ActionPinchLoose, ROSEE::ActionMultiplePinchTight, ROSEE::ActionSingleJointMultipleTips, ROSEE::ActionPinchTight, and ROSEE::ActionComposed.

Definition at line 135 of file Action.cpp.

Member Data Documentation

◆ fingersInvolved

std::set<std::string> ROSEE::Action::fingersInvolved
protected

Definition at line 148 of file Action.h.

◆ jointsInvolvedCount

JointsInvolvedCount ROSEE::Action::jointsInvolvedCount
protected

Definition at line 149 of file Action.h.

◆ name

std::string ROSEE::Action::name
protected

Definition at line 146 of file Action.h.

◆ type

Action::Type ROSEE::Action::type
protected

Definition at line 147 of file Action.h.


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


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