49 std::vector < JointPos > retVect {
jointPos};
62 std::vector <std::string> fingInvolvedVect = yamlIt->first.as <std::vector < std::string >> ();
63 for (
const auto &it : fingInvolvedVect) {
67 for ( YAML::const_iterator element = yamlIt->second.begin(); element != yamlIt->second.end(); ++element) {
69 std::string key = element->first.as<std::string>();
70 if ( key.compare (
"ActionName") == 0 ){
71 name = element->second.as < std::string > ();
73 }
else if (key.compare(
"JointsInvolvedCount") == 0) {
76 }
else if (key.compare (
"PrimitiveType") == 0) {
78 element->second.as <
unsigned int>() );
80 std::cerr <<
"[ERROR ActionTrig::" << __func__ <<
" parsed a type " << parsedType <<
81 " but this object has primitive type " <<
primitiveType << std::endl;
85 }
else if (key.compare(0, 12,
"ActionState_") == 0) {
86 for(YAML::const_iterator asEl = element->second.begin(); asEl != element->second.end(); ++asEl) {
89 if (asEl->first.as<std::string>().compare (
"JointPos") == 0 ) {
94 std::cerr <<
"[ERROR ActionTrig::" << __func__ <<
" not know key " 95 << asEl->first.as<std::string>() <<
96 " found in the yaml file at this level" << std::endl;
102 std::cerr <<
"[ERROR ActionTrig::" << __func__ <<
"not know key " << key <<
103 " found in the yaml file" << std::endl;
void setJointPos(JointPos)
Virtual class, Base of all the primitive actions.
std::map< std::string, std::vector< double > > JointPos
The map to describe the position of all actuated joints.
std::map< std::string, unsigned int > JointsInvolvedCount
The map to describe, how many times a joint is set by the action.
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...
Type
Enum useful to discriminate each primitive action when, for example, we want to parse a file if you ...
bool fillFromYaml(YAML::const_iterator yamlIt) override
function to fill members of the Action with infos taken from yaml files
JointsInvolvedCount jointsInvolvedCount
ActionTrig(std::string actionName, ActionPrimitive::Type)
std::string getFingerInvolved() const
Specific method of trig to simply return a string instead of the full vector fingersInvolved that in ...
void setFingerInvolved(std::string)
std::vector< JointPos > getAllJointPos() const override
Overriden get from the pure virtual function of the base class ActionPrimitive The signature must be ...
JointPos getJointPos() const override
Overriden get from the pure virtual function of the base class Action.
std::set< std::string > fingersInvolved