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

Virtual class, Base of all the primitive actions. It has some implemented functions that a derived class can use, if you don't want to override to make them more action-specific. All the primitives are defined by: More...

#include <ActionPrimitive.h>

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

Public Types

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

Public Member Functions

virtual 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...
 
virtual std::set< std::string > getKeyElements () const =0
 Depending on the primitive, we can use different "keys" to take info from yaml file when parsing for example, trig and pinches are selected through fingersInvolved, while ActionSingleJointMultipleTips uses the joint name. So each derived class must override this info, which for now is used only in YamlWorker::parseYamlPrimitive() and also by map handler to get the primitive, also on send action test. More...
 
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
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

 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

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

Virtual class, Base of all the primitive actions. It has some implemented functions that a derived class can use, if you don't want to override to make them more action-specific. All the primitives are defined by:

Definition at line 48 of file ActionPrimitive.h.

Member Typedef Documentation

◆ ConstPtr

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

Definition at line 54 of file ActionPrimitive.h.

◆ Ptr

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

Definition at line 53 of file ActionPrimitive.h.

Member Enumeration Documentation

◆ Type

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

Enumerator
PinchTight 
PinchLoose 
MultiplePinchTight 
Trig 
TipFlex 
FingFlex 
SingleJointMultipleTips 
None 

Definition at line 60 of file ActionPrimitive.h.

Constructor & Destructor Documentation

◆ ~ActionPrimitive()

virtual ROSEE::ActionPrimitive::~ActionPrimitive ( )
inlinevirtual

Definition at line 62 of file ActionPrimitive.h.

◆ ActionPrimitive() [1/2]

ROSEE::ActionPrimitive::ActionPrimitive ( std::string  name,
unsigned int  maxStoredActionStates,
ActionPrimitive::Type  primitiveType 
)
protected

Definition at line 39 of file ActionPrimitive.cpp.

◆ ActionPrimitive() [2/2]

ROSEE::ActionPrimitive::ActionPrimitive ( std::string  name,
unsigned int  nFingersInvolved,
unsigned int  maxStoredActionStates,
ActionPrimitive::Type  primitiveType 
)
protected

Protected costructor: object creable only by derived classes. There is no default costructor (without arguments) because we want to set always these members.

Definition at line 42 of file ActionPrimitive.cpp.

Member Function Documentation

◆ emitYaml()

void ROSEE::ActionPrimitive::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.

Implements ROSEE::Action.

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

Definition at line 67 of file ActionPrimitive.cpp.

◆ getKeyElements()

virtual std::set< std::string> ROSEE::ActionPrimitive::getKeyElements ( ) const
pure virtual

Depending on the primitive, we can use different "keys" to take info from yaml file when parsing for example, trig and pinches are selected through fingersInvolved, while ActionSingleJointMultipleTips uses the joint name. So each derived class must override this info, which for now is used only in YamlWorker::parseYamlPrimitive() and also by map handler to get the primitive, also on send action test.

Implemented in ROSEE::ActionTrig, ROSEE::ActionSingleJointMultipleTips, and ROSEE::ActionPinchGeneric.

◆ getMaxStoredActionStates()

unsigned int ROSEE::ActionPrimitive::getMaxStoredActionStates ( ) const

Definition at line 53 of file ActionPrimitive.cpp.

◆ getnFingersInvolved()

unsigned int ROSEE::ActionPrimitive::getnFingersInvolved ( ) const

Definition at line 57 of file ActionPrimitive.cpp.

◆ getPrimitiveType()

ROSEE::ActionPrimitive::Type ROSEE::ActionPrimitive::getPrimitiveType ( ) const

Definition at line 49 of file ActionPrimitive.cpp.

◆ setJointsInvolvedCount()

void ROSEE::ActionPrimitive::setJointsInvolvedCount ( ROSEE::JointsInvolvedCount  jointsInvolvedCount)

Definition at line 61 of file ActionPrimitive.cpp.

Member Data Documentation

◆ maxStoredActionStates

const unsigned int ROSEE::ActionPrimitive::maxStoredActionStates
protected

Definition at line 95 of file ActionPrimitive.h.

◆ nFingersInvolved

unsigned int ROSEE::ActionPrimitive::nFingersInvolved
protected

Definition at line 92 of file ActionPrimitive.h.

◆ primitiveType

const Type ROSEE::ActionPrimitive::primitiveType
protected

Definition at line 97 of file ActionPrimitive.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