ROSEndEffector
ROS End-Effector package: provides a ROS-based set of standard interfaces to command robotics end-effectors in an agnostic fashion.
|
Class to handle a generic, simple action. More...
#include <ActionGeneric.h>
Public Types | |
typedef std::shared_ptr< ActionGeneric > | Ptr |
typedef std::shared_ptr< const ActionGeneric > | ConstPtr |
Public Types inherited from ROSEE::Action | |
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... | |
typedef std::shared_ptr< Action > | Ptr |
typedef std::shared_ptr< const Action > | ConstPtr |
Public Member Functions | |
ActionGeneric () | |
default costructor. More... | |
ActionGeneric (std::string actionName, ROSEE::JointPos jointPos) | |
Simpliest costructor, need only essential infos. More... | |
ActionGeneric (std::string actionName, ROSEE::JointPos jointPos, JointsInvolvedCount jic) | |
Another costructor. More... | |
ActionGeneric (std::string actionName, ROSEE::JointPos jointPos, JointsInvolvedCount jic, std::set< std::string > fingersInvolved) | |
JointPos | getJointPos () const override |
Get the joint position related to this action, overriden from Action. More... | |
std::vector< ROSEE::JointPos > | getAllJointPos () const override |
Get the joint position related to this action, overriden from Action Necessary to not make this class abstact, even if for a composed action we store only a single JointPos, so this function return a single element vector. More... | |
virtual void | emitYaml (YAML::Emitter &out) const override |
Function to fill the argument passed with info about the action. More... | |
virtual bool | fillFromYaml (YAML::const_iterator yamlIt) override |
function to fill members of the Action with infos taken from yaml files More... | |
Public Member Functions inherited from ROSEE::Action | |
virtual | ~Action () |
std::string | getName () const |
Get the name of the action. More... | |
Type | getType () const |
std::set< std::string > | getFingersInvolved () const |
Get for fingersInvolved. More... | |
JointsInvolvedCount | getJointsInvolvedCount () const |
Get for jointsInvolvedCount. More... | |
virtual void | print () const |
Overridable functions, if we want to make them more action-specific. More... | |
Protected Member Functions | |
ActionGeneric (std::string actionName) | |
this costructor is only for derived class More... | |
Protected Member Functions inherited from ROSEE::Action | |
Action () | |
Action (std::string actionName, Action::Type type) | |
Protected Attributes | |
JointPos | jointPos |
Protected Attributes inherited from ROSEE::Action | |
std::string | name |
Action::Type | type |
std::set< std::string > | fingersInvolved |
JointsInvolvedCount | jointsInvolvedCount |
Class to handle a generic, simple action.
Differently from other class, this is easily creable manually, for ex giving a name and a JointPos map to the costructor. It contains essential infos about the action, and override the necessary pure virtual functions of base class Action
Definition at line 32 of file ActionGeneric.h.
typedef std::shared_ptr<const ActionGeneric> ROSEE::ActionGeneric::ConstPtr |
Definition at line 36 of file ActionGeneric.h.
typedef std::shared_ptr<ActionGeneric> ROSEE::ActionGeneric::Ptr |
Definition at line 35 of file ActionGeneric.h.
ROSEE::ActionGeneric::ActionGeneric | ( | ) |
default costructor.
It is used when parsing a file with YamlWorker,
Definition at line 20 of file ActionGeneric.cpp.
ROSEE::ActionGeneric::ActionGeneric | ( | std::string | actionName, |
ROSEE::JointPos | jointPos | ||
) |
Simpliest costructor, need only essential infos.
Definition at line 24 of file ActionGeneric.cpp.
ROSEE::ActionGeneric::ActionGeneric | ( | std::string | actionName, |
ROSEE::JointPos | jointPos, | ||
JointsInvolvedCount | jic | ||
) |
Another costructor.
actionName | the name of this action |
jointPos | map containing position of ALL joints of your robot |
jic | map of counters of times of joints involved (e.g. joint not used –> 0 ; joint used for the action –> 1) |
Be | sure that keys of jointPos and jic are the same, otherwise exception is throw |
Definition at line 41 of file ActionGeneric.cpp.
ROSEE::ActionGeneric::ActionGeneric | ( | std::string | actionName, |
ROSEE::JointPos | jointPos, | ||
JointsInvolvedCount | jic, | ||
std::set< std::string > | fingersInvolved | ||
) |
Definition at line 68 of file ActionGeneric.cpp.
|
protected |
|
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
out | the yaml-cpp emitter which store infos about the action |
Implements ROSEE::Action.
Reimplemented in ROSEE::ActionComposed.
Definition at line 107 of file ActionGeneric.cpp.
|
overridevirtual |
function to fill members of the Action with infos taken from yaml files
yamlIt | a 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.
Reimplemented in ROSEE::ActionComposed.
Definition at line 130 of file ActionGeneric.cpp.
|
overridevirtual |
Get the joint position related to this action, overriden from Action Necessary to not make this class abstact, even if for a composed action we store only a single JointPos, so this function return a single element vector.
Implements ROSEE::Action.
Definition at line 101 of file ActionGeneric.cpp.
|
overridevirtual |
Get the joint position related to this action, overriden from Action.
Implements ROSEE::Action.
Definition at line 97 of file ActionGeneric.cpp.
|
protected |
Definition at line 94 of file ActionGeneric.h.