ROSEndEffector
ROS End-Effector package: provides a ROS-based set of standard interfaces to command robotics end-effectors in an agnostic fashion.
|
The action of pinch with two tips. More...
#include <ActionPinchLoose.h>
Classes | |
struct | distComp |
struct to put in order the actionStates set. More... | |
Public Types | |
typedef std::map< std::pair< std::string, std::string >, ActionPinchLoose > | Map |
typedef std::pair< JointPos, double > | StateWithDistance |
A pair to "link" the JointPos with the optional info 'distance'. More... | |
Public Types inherited from ROSEE::ActionPrimitive | |
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... | |
typedef std::shared_ptr< ActionPrimitive > | Ptr |
typedef std::shared_ptr< const ActionPrimitive > | 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 | |
ActionPinchLoose () | |
ActionPinchLoose (unsigned int maxStoredActionStates) | |
ActionPinchLoose (std::string tip1, std::string tip2) | |
ActionPinchLoose (std::pair< std::string, std::string >, JointPos, double distance) | |
JointPos | getJointPos () const override |
Get the position related to this action. More... | |
JointPos | getJointPos (unsigned int index) const |
std::vector< ROSEE::JointPos > | getAllJointPos () const override |
Return all the joint position stored. More... | |
std::vector< ROSEE::ActionPinchLoose::StateWithDistance > | getActionStates () const |
Specific get for this action to return the state with distance info. More... | |
bool | insertActionState (JointPos, double distance) |
function to insert a single action in the actionStates set of possible action. More... | |
void | print () const override |
Overridable functions, if we want to make them more action-specific. More... | |
void | emitYaml (YAML::Emitter &) const override |
Function to fill the argument passed with info about the action. More... | |
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::ActionPinchGeneric | |
ActionPinchGeneric (std::string name, ActionPrimitive::Type type) | |
KNOW the distance at a certain percentage? so se volgio prendere un oggetto largo 3 cm il programma sa quale รจ la percentage per avere una distanza di 3cm More... | |
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. More... | |
Public Member Functions inherited from ROSEE::ActionPrimitive | |
virtual | ~ActionPrimitive () |
Type | getPrimitiveType () const |
unsigned int | getMaxStoredActionStates () const |
unsigned int | getnFingersInvolved () const |
void | setJointsInvolvedCount (ROSEE::JointsInvolvedCount jointsInvolvedCount) |
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... | |
Private Attributes | |
std::set< StateWithDistance, distComp > | actionStates |
For each pair, we want a set of action because we want to store (in general) more possible way to do that action. 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. More... | |
Protected Member Functions inherited from ROSEE::Action | |
Action () | |
Action (std::string actionName, Action::Type type) | |
Protected Attributes inherited from ROSEE::ActionPrimitive | |
unsigned int | nFingersInvolved |
const unsigned int | maxStoredActionStates |
const Type | primitiveType |
Protected Attributes inherited from ROSEE::Action | |
std::string | name |
Action::Type | type |
std::set< std::string > | fingersInvolved |
JointsInvolvedCount | jointsInvolvedCount |
The action of pinch with two tips.
The two tips must not collide ever (otherwise we have a TightPinch). They only need to move towards each other moving the relative joints. This PinchLoose is created because also if the tips do not collide (i.e. there is not a ActionPinchTight) we can have anyway a pinch at least to take object of a certain minimum size. All the non involved fingers are set in the default state. A pinchLoose is defined by:
Definition at line 43 of file ActionPinchLoose.h.
typedef std::map< std::pair<std::string, std::string>, ActionPinchLoose > ROSEE::ActionPinchLoose::Map |
Definition at line 48 of file ActionPinchLoose.h.
typedef std::pair<JointPos, double> ROSEE::ActionPinchLoose::StateWithDistance |
A pair to "link" the JointPos with the optional info 'distance'.
Definition at line 53 of file ActionPinchLoose.h.
ROSEE::ActionPinchLoose::ActionPinchLoose | ( | ) |
Definition at line 21 of file ActionPinchLoose.cpp.
ROSEE::ActionPinchLoose::ActionPinchLoose | ( | unsigned int | maxStoredActionStates | ) |
Definition at line 24 of file ActionPinchLoose.cpp.
ROSEE::ActionPinchLoose::ActionPinchLoose | ( | std::string | tip1, |
std::string | tip2 | ||
) |
Definition at line 27 of file ActionPinchLoose.cpp.
ROSEE::ActionPinchLoose::ActionPinchLoose | ( | std::pair< std::string, std::string > | tipNames, |
JointPos | jp, | ||
double | distance | ||
) |
Definition at line 33 of file ActionPinchLoose.cpp.
|
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 |
Reimplemented from ROSEE::ActionPrimitive.
Definition at line 140 of file ActionPinchLoose.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.
Definition at line 182 of file ActionPinchLoose.cpp.
std::vector< ROSEE::ActionPinchLoose::StateWithDistance > ROSEE::ActionPinchLoose::getActionStates | ( | ) | const |
Specific get for this action to return the state with distance info.
Definition at line 44 of file ActionPinchLoose.cpp.
|
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.
Implements ROSEE::Action.
Definition at line 70 of file ActionPinchLoose.cpp.
|
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.
Implements ROSEE::Action.
Definition at line 56 of file ActionPinchLoose.cpp.
ROSEE::JointPos ROSEE::ActionPinchLoose::getJointPos | ( | unsigned int | index | ) | const |
Definition at line 60 of file ActionPinchLoose.cpp.
bool ROSEE::ActionPinchLoose::insertActionState | ( | ROSEE::JointPos | jp, |
double | distance | ||
) |
function to insert a single action in the actionStates set of possible action.
If the action is not so good (based on distance) the action is not inserted and the function return false
JointPos | The joints position |
distance | the distance from the two tips. |
Definition at line 82 of file ActionPinchLoose.cpp.
|
overridevirtual |
Overridable functions, if we want to make them more action-specific.
Reimplemented from ROSEE::Action.
Definition at line 106 of file ActionPinchLoose.cpp.
|
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 PinchLoose among two tips can theoretically be done in infinite ways, we store the best ways found (ordering them by the distance between fingertips)
Definition at line 105 of file ActionPinchLoose.h.