#include <ros/ros.h>#include <end_effector/FindActions.h>#include <end_effector/GraspingActions/Action.h>#include <end_effector/GraspingActions/ActionComposed.h>#include <end_effector/GraspingActions/ActionTimed.h>#include <end_effector/GraspingActions/ActionGeneric.h>#include <end_effector/ParserMoveIt.h>#include <end_effector/Parser.h>#include <end_effector/MapActionHandler.h>
Go to the source code of this file.
Functions | |
| int | main (int argc, char **argv) |
| int main | ( | int | argc, |
| char ** | argv | ||
| ) |
********************* PARSING TEST and print... these things should not be here
**************************** COMPOSITE ACTION THINGS ************************************************
if (mapsHandler.getPrimitiveMap(ROSEE::ActionPrimitive::Type::Trig).size() > 0 &&
mapsHandler.getPrimitiveMap(ROSEE::ActionPrimitive::Type::Trig).at(0).size() == parserMoveIt->getNFingers() ) {
std::cout << "A composed action with Independent inner action: " << std::endl; ROSEE::ActionComposed grasp ("grasp", true);
for (auto trig : mapsHandler.getPrimitiveMap("trig")) { grasp.sumAction (trig.second) ; } grasp.print();
yamlWorker.createYamlFile (&grasp, folderForActions + "/generics/");
mapsHandler.parseAllGenerics (folderForActions + "/generics/");
std::cout << "PARSED COMPOSEd" << std::endl; mapsHandler.getGeneric("grasp")->print();
} else { //look if we have a single singleJointMultipleTips_MAXFINGER: it is 99% a grasp
std::cout << "A singleJointMultipleTips that move all fingers: " << std::endl;
std::map < std::string, ROSEE::ActionSingleJointMultipleTips> singleJointMultipleTipsMap = actionsFinder.findSingleJointMultipleTips (parserMoveIt->getNFingers(), folderForActions + "/primitives/") ;
if (singleJointMultipleTipsMap.size() == 1) { //if more, we do not know which is the one for grasping
std::cout << "No Composed Grasp with trig but I found a SingleJointMultipleTips_" <<
parserMoveIt->getNFingers() <<" that probably is a grasp (ie a joint that move all fingers)" << std::endl;
}
std::cout << "PARSED MAP OF singleJointMultipleTips_" << parserMoveIt->getNFingers() << " FROM YAML FILE:" << std::endl;
for (auto &i : mapsHandler.getPrimitiveMap("singleJointMultipleTips_" + std::to_string(parserMoveIt->getNFingers()) )) {
i.second->print();
}
}
**************************** SIMPLE ACTION MANUALLY CREATED ***********************************************
example only doable if maps is not empty
if (maps.first.size() != 0 ) {
ROSEE::JointPos jp;
for now copy jp of another action jp = ROSEE::operator*(maps.first.begin()->second.getJointPos(), 2); auto jpc = maps.first.begin()->second.getJointsInvolvedCount();
ROSEE::ActionGeneric simpleAction("casual", jp, jpc); std::cout << std::endl << "Casual action manually created: " << std::endl;
simpleAction.print();
yamlWorker.createYamlFile( &simpleAction, folderForActions + "/generics/" );
mapsHandler.parseAllGenerics (folderForActions + "/generics/"); //NOTE already called before
std::cout << "The parsed casual: " << std::endl; mapsHandler.getGeneric("casual")->print(); }
**************************** TIMED ACTION THINGS***************************** EXAMPLE ONLY VALID FOR SPECIFIC HANDS
Definition at line 30 of file UniversalFindActions.cpp.