#include <MapActionHandler.h>
Public Types | |
typedef std::map< std::set< std::string >, ROSEE::ActionPrimitive::Ptr > | ActionPrimitiveMap |
typedef std::shared_ptr< MapActionHandler > | Ptr |
Public Member Functions | |
std::map< std::string, std::shared_ptr< ROSEE::ActionGeneric > > | getAllGenerics () const |
std::map< std::string, ActionPrimitiveMap > | getAllPrimitiveMaps () const |
std::map< std::string, std::shared_ptr< ROSEE::ActionTimed > > | getAllTimeds () const |
std::set< std::string > | getFingertipsForPinch (std::string finger, ROSEE::ActionPrimitive::Type pinchType) const |
std::shared_ptr< ROSEE::ActionGeneric > | getGeneric (std::string name, bool verbose=true) const |
ROSEE::Action::Ptr | getGrasp (unsigned int nFingers, std::string graspName="grasp") |
This function try to get an action that should be a grasp. More... | |
std::map< std::string, std::set< std::string > > | getPinchLoosePairsMap () const |
std::map< std::string, std::set< std::string > > | getPinchTightPairsMap () const |
ROSEE::ActionPrimitive::Ptr | getPrimitive (std::string primitiveName, std::set< std::string > key) const |
std::vector< ROSEE::ActionPrimitive::Ptr > | getPrimitive (ROSEE::ActionPrimitive::Type, std::set< std::string > key) const |
ROSEE::ActionPrimitive::Ptr | getPrimitive (std::string primitiveName, std::vector< std::string > key) const |
std::vector< ROSEE::ActionPrimitive::Ptr > | getPrimitive (ROSEE::ActionPrimitive::Type, std::vector< std::string > key) const |
ROSEE::ActionPrimitive::Ptr | getPrimitive (std::string primitiveName, std::pair< std::string, std::string > key) const |
std::vector< ROSEE::ActionPrimitive::Ptr > | getPrimitive (ROSEE::ActionPrimitive::Type, std::pair< std::string, std::string > key) const |
ROSEE::ActionPrimitive::Ptr | getPrimitive (std::string primitiveName, std::string key) const |
std::vector< ROSEE::ActionPrimitive::Ptr > | getPrimitive (ROSEE::ActionPrimitive::Type, std::string key) const |
std::vector< ActionPrimitiveMap > | getPrimitiveMap (ROSEE::ActionPrimitive::Type type) const |
getter to take all the primitives maps of one type ( More... | |
ActionPrimitiveMap | getPrimitiveMap (std::string primitiveName) const |
std::map< std::string, ROSEE::ActionPrimitive::Ptr > | getPrimitiveSingleJointMultipleTipsMap (unsigned int nFingers) const |
function to return the map that contains all the singleJointMultipleTips primitive with that moves the specific number of fingers nFingers . This is in practice, the file singleJointMultipleTips_*nFingers*.yaml More... | |
std::shared_ptr< ROSEE::ActionTimed > | getTimed (std::string name) const |
bool | insertSingleGeneric (ROSEE::ActionGeneric::Ptr generic) |
This is needed by rosservicehandler which has to include a new doable action, if received the service. More... | |
MapActionHandler () | |
bool | parseAllActions (std::string pathFolder) |
bool | parseAllGenerics (std::string pathFolder) |
bool | parseAllPrimitives (std::string pathFolder) |
bool | parseAllTimeds (std::string pathFolder) |
Private Member Functions | |
void | findPinchPairsMap () |
Private Attributes | |
std::map< std::string, std::shared_ptr< ROSEE::ActionGeneric > > | generics |
std::string | handName |
std::map< std::string, std::set< std::string > > | pinchLoosePairsMap |
std::map< std::string, std::set< std::string > > | pinchTightPairsMap |
std::map< std::string, ActionPrimitiveMap > | primitives |
std::map< std::string, std::shared_ptr< ROSEE::ActionTimed > > | timeds |
Definition at line 39 of file MapActionHandler.h.
typedef std::map< std::set < std::string >, ROSEE::ActionPrimitive::Ptr > ROSEE::MapActionHandler::ActionPrimitiveMap |
Definition at line 47 of file MapActionHandler.h.
typedef std::shared_ptr<MapActionHandler> ROSEE::MapActionHandler::Ptr |
Definition at line 43 of file MapActionHandler.h.
ROSEE::MapActionHandler::MapActionHandler | ( | ) |
Definition at line 19 of file MapActionHandler.cpp.
|
private |
Definition at line 389 of file MapActionHandler.cpp.
std::map< std::string, std::shared_ptr< ROSEE::ActionGeneric > > ROSEE::MapActionHandler::getAllGenerics | ( | ) | const |
Definition at line 187 of file MapActionHandler.cpp.
std::map< std::string, ROSEE::MapActionHandler::ActionPrimitiveMap > ROSEE::MapActionHandler::getAllPrimitiveMaps | ( | ) | const |
Definition at line 48 of file MapActionHandler.cpp.
std::map< std::string, std::shared_ptr< ROSEE::ActionTimed > > ROSEE::MapActionHandler::getAllTimeds | ( | ) | const |
Definition at line 202 of file MapActionHandler.cpp.
std::set< std::string > ROSEE::MapActionHandler::getFingertipsForPinch | ( | std::string | finger, |
ROSEE::ActionPrimitive::Type | pinchType | ||
) | const |
Definition at line 256 of file MapActionHandler.cpp.
std::shared_ptr< ROSEE::ActionGeneric > ROSEE::MapActionHandler::getGeneric | ( | std::string | name, |
bool | verbose = true |
||
) | const |
Definition at line 174 of file MapActionHandler.cpp.
ROSEE::Action::Ptr ROSEE::MapActionHandler::getGrasp | ( | unsigned int | nFingers, |
std::string | graspName = "grasp" |
||
) |
This function try to get an action that should be a grasp.
A real grasp, until now, can be two things:
This function look first for a generic (or composed, that is a derived class of generic) action with name graspName
, that should have been created and emitted before calling the parseAllActions (or parseAllGenerics) (e.g. in UniversalFindActions putting all the trigs togheter, but we can also define the grasp in another way).
nFingers | the number of the finger of the hand, that is an information that this class hasn't |
graspName | name given to the action grasp, default is "grasp" |
Definition at line 234 of file MapActionHandler.cpp.
std::map< std::string, std::set< std::string > > ROSEE::MapActionHandler::getPinchLoosePairsMap | ( | ) | const |
Definition at line 170 of file MapActionHandler.cpp.
std::map< std::string, std::set< std::string > > ROSEE::MapActionHandler::getPinchTightPairsMap | ( | ) | const |
Definition at line 166 of file MapActionHandler.cpp.
ROSEE::ActionPrimitive::Ptr ROSEE::MapActionHandler::getPrimitive | ( | std::string | primitiveName, |
std::set< std::string > | key | ||
) | const |
Definition at line 52 of file MapActionHandler.cpp.
std::vector< ROSEE::ActionPrimitive::Ptr > ROSEE::MapActionHandler::getPrimitive | ( | ROSEE::ActionPrimitive::Type | type, |
std::set< std::string > | key | ||
) | const |
Definition at line 101 of file MapActionHandler.cpp.
ROSEE::ActionPrimitive::Ptr ROSEE::MapActionHandler::getPrimitive | ( | std::string | primitiveName, |
std::vector< std::string > | key | ||
) | const |
Definition at line 83 of file MapActionHandler.cpp.
std::vector< ROSEE::ActionPrimitive::Ptr > ROSEE::MapActionHandler::getPrimitive | ( | ROSEE::ActionPrimitive::Type | type, |
std::vector< std::string > | key | ||
) | const |
Definition at line 148 of file MapActionHandler.cpp.
ROSEE::ActionPrimitive::Ptr ROSEE::MapActionHandler::getPrimitive | ( | std::string | primitiveName, |
std::pair< std::string, std::string > | key | ||
) | const |
Definition at line 95 of file MapActionHandler.cpp.
std::vector< ROSEE::ActionPrimitive::Ptr > ROSEE::MapActionHandler::getPrimitive | ( | ROSEE::ActionPrimitive::Type | type, |
std::pair< std::string, std::string > | key | ||
) | const |
Definition at line 160 of file MapActionHandler.cpp.
ROSEE::ActionPrimitive::Ptr ROSEE::MapActionHandler::getPrimitive | ( | std::string | primitiveName, |
std::string | key | ||
) | const |
Definition at line 89 of file MapActionHandler.cpp.
std::vector< ROSEE::ActionPrimitive::Ptr > ROSEE::MapActionHandler::getPrimitive | ( | ROSEE::ActionPrimitive::Type | type, |
std::string | key | ||
) | const |
Definition at line 154 of file MapActionHandler.cpp.
std::vector< ROSEE::MapActionHandler::ActionPrimitiveMap > ROSEE::MapActionHandler::getPrimitiveMap | ( | ROSEE::ActionPrimitive::Type | type | ) | const |
getter to take all the primitives maps of one type (
type) | A primitive map is a map where key is the element involved (joints or fingers) and values the action primitive itself It returns a vector (differently from version with string as argument) because we can have more primitives with same type (e.g. a singleJointMultipleTips primitive, which are differente between them because of the joint they move (singleJointMultipleTips_5 , singleJointMultipleTips_4 ... ) , or also multipinch)). This consideration is valid for all the other getPrimitive |
type | the primitive type of the action that we want |
type |
Definition at line 32 of file MapActionHandler.cpp.
ROSEE::MapActionHandler::ActionPrimitiveMap ROSEE::MapActionHandler::getPrimitiveMap | ( | std::string | primitiveName | ) | const |
Definition at line 21 of file MapActionHandler.cpp.
std::map< std::string, ROSEE::ActionPrimitive::Ptr > ROSEE::MapActionHandler::getPrimitiveSingleJointMultipleTipsMap | ( | unsigned int | nFingers | ) | const |
function to return the map that contains all the singleJointMultipleTips primitive with that moves the specific number of fingers nFingers
. This is in practice, the file singleJointMultipleTips_*nFingers*.yaml
It return only one map because per definition we have only one ActionPrimitiveMap of type singleJointMultipleTips with a defined number of nFinger. (Then inside it we can have more primitives ( when we have a hand with more joints that moves more than 1 finger), but always with the same number of nFinger)
nFingers | the number of the finger that the singleJointMultipleTips primitives moves |
nFingers
and as value the primitive with all the info to command it to the hand. Obvioulsy we can have more joints that move a certain number (nFingers
) of fingers Definition at line 207 of file MapActionHandler.cpp.
std::shared_ptr< ROSEE::ActionTimed > ROSEE::MapActionHandler::getTimed | ( | std::string | name | ) | const |
Definition at line 191 of file MapActionHandler.cpp.
bool ROSEE::MapActionHandler::insertSingleGeneric | ( | ROSEE::ActionGeneric::Ptr | generic | ) |
This is needed by rosservicehandler which has to include a new doable action, if received the service.
Definition at line 365 of file MapActionHandler.cpp.
bool ROSEE::MapActionHandler::parseAllActions | ( | std::string | pathFolder | ) |
Definition at line 301 of file MapActionHandler.cpp.
bool ROSEE::MapActionHandler::parseAllGenerics | ( | std::string | pathFolder | ) |
Definition at line 334 of file MapActionHandler.cpp.
bool ROSEE::MapActionHandler::parseAllPrimitives | ( | std::string | pathFolder | ) |
folder | where the action are. the action will be look in (<pkg_path> + pathFolder + "/" + handName + "/") ; |
Definition at line 318 of file MapActionHandler.cpp.
bool ROSEE::MapActionHandler::parseAllTimeds | ( | std::string | pathFolder | ) |
Definition at line 351 of file MapActionHandler.cpp.
|
private |
Definition at line 167 of file MapActionHandler.h.
|
private |
Definition at line 164 of file MapActionHandler.h.
|
private |
Definition at line 171 of file MapActionHandler.h.
|
private |
Definition at line 170 of file MapActionHandler.h.
|
private |
Definition at line 166 of file MapActionHandler.h.
|
private |
Definition at line 168 of file MapActionHandler.h.