1 #ifndef MULTIAGENTHANDOVERS_H
2 #define MULTIAGENTHANDOVERS_H
4 #include "MultiHandOverUtils.hpp"
5 #include "ConfGenerator.h"
6 #include "Chronometer.hpp"
19 virtual bool check(FrontierPtr frontier)=0;
20 virtual std::string getName()=0;
29 DummyHandOverTest(FrontierCells::FrontierCheckStatus req,FrontierCells::FrontierCheckStatus lvl):
30 _req(req),_lvl(lvl) { }
32 virtual bool check(FrontierPtr frontier){
34 if (frontier->check_status>=_req && frontier->status_ok[_req]){
39 frontier->check_status=_lvl;
40 frontier->status_ok[_lvl]=ok;
43 virtual std::string getName(){
return "dummy";}
49 FrontierCells::FrontierCheckStatus _req,_lvl;
64 bool test(FrontierPtr frontier,std::string
const & method);
71 bool test(FrontierPtr frontier, FrontierCells::FrontierCheckStatus target_status);
85 std::vector< std::pair<std::string,bool> > listTesterNames(
bool default_only=
false);
86 std::vector< std::pair<AbstractHandOverTest*,bool> > listTesters(
bool default_only=
false);
88 unsigned int getCheckCount(FrontierCells::FrontierCheckStatus st){
return _check_counts[st].first;}
89 double getCheckTime(FrontierCells::FrontierCheckStatus st){
return _check_counts[st].second;}
93 std::map<std::string,AbstractHandOverTest*> _testers;
98 std::map<FrontierCells::FrontierCheckStatus,std::string> _defaults;
99 std::map<FrontierCells::FrontierCheckStatus,std::pair<unsigned int,double> > _check_counts;
109 _robots(std::make_pair(r1,r2)){
110 setLogger(&_dummy_logger);
113 virtual bool check() =0;
118 void timeLimit(
double time_limit_ms){_time_limit=time_limit_ms;}
119 double timeLimit(){
return _time_limit;}
120 void object(
Robot* obj){_object=obj;}
121 Robot* object(
void){
return _object;}
124 void shoulders(Eigen::Vector3d shoulder1,Eigen::Vector3d shoulder2){this->_shoulder1=shoulder1;this->_shoulder2=shoulder2;}
125 Eigen::Vector3d shoulder1(){
return _shoulder1;}
126 Eigen::Vector3d shoulder2(){
return _shoulder2;}
127 void reach(
double r1,
double r2){_reach1=r1;_reach2=r2;}
128 double reach1(){
return _reach1;}
129 double reach2(){
return _reach2;}
130 void grabs(Eigen::Vector3d& g1,Eigen::Vector3d& g2){_grab1=g1;_grab2=g2;}
131 Eigen::Vector3d& grab1(){
return _grab1;}
132 Eigen::Vector3d& grab2(){
return _grab2;}
134 void robots(
Robot* r1,
Robot* r2){_robots=std::make_pair(r1,r2);}
135 inline std::pair<Robot*,Robot*>& robots(){
return _robots;}
137 virtual confPtr_t getQMiddle() =0;
138 void setLogger(AlgoLoggerInterface* logger){_logger=logger;}
139 virtual std::string getName()=0;
141 AlgoLoggerInterface *_logger;
144 std::pair<Robot*,Robot*> _robots;
145 Eigen::Vector3d _shoulder1,_shoulder2;
146 Eigen::Vector3d _grab1,_grab2;
147 double _reach1,_reach2;
148 AlgoLoggerInterface _dummy_logger;
159 virtual bool check(FrontierPtr frontier);
162 virtual std::string getName(){
return _name;}
166 std::vector<MultiHandOverAgent> *_agents;
167 static const std::string _name;
180 virtual bool check(FrontierPtr frontier);
181 virtual std::string getName(){
return _object_check->getName();}
187 std::vector<MultiHandOverAgent> *_agents;
199 virtual bool check(FrontierPtr frontier);
200 virtual std::string getName(){
return _name;}
204 std::vector<MultiHandOverAgent> *_agents;
205 Robot **_object_pt_pt;
206 static const std::string _name;
216 HandOverTestPreDefined(std::vector<MultiHandOverAgent> *agents, std::string file_directory,
double grid_discrete_step);
218 virtual bool check(FrontierPtr frontier);
219 virtual std::string getName(){
return _name;}
224 struct _ConfGenAlias{
227 std::vector<HRICS::ConfigHR> conf_list;
234 std::vector<MultiHandOverAgent> *_agents;
235 std::string _file_dir;
236 std::map<pair<MultiHandOverAgent*,MultiHandOverAgent*> , _ConfGenAlias> _conf_generators_alias;
238 std::pair<double,double> _robot_robot_min_max_dists,_human_robot_min_max_dists;
240 static const std::string _name;
249 virtual bool check(FrontierPtr frontier);
250 virtual std::string getName() {
return _name;}
256 std::vector<MultiHandOverAgent> *_agents;
258 static const std::string _name;
264 HandOverTestSelection(std::vector<MultiHandOverAgent> *agents,
Robot *
object,std::string file_directory,
double grid_discrete_step);
267 virtual bool check(FrontierPtr frontier);
268 virtual std::string getName() {
return _name;}
273 std::vector<MultiHandOverAgent> *_agents;
278 static const std::string _name;
287 virtual bool check(FrontierPtr frontier);
288 virtual std::string getName(){
return _name;}
296 std::vector<MultiHandOverAgent> *_agents;
297 static const std::string _name;
302 #endif // MULTIAGENTHANDOVERS_H
The HandOverTestPreSelected class search in predefined configurations for a good handover configurati...
Definition: MultiAgentHandOvers.h:214
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()=0
get the required status level for the class to compute its check.
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:163
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:202
void shoulders(Eigen::Vector3d shoulder1, Eigen::Vector3d shoulder2)
sets the positions of each shoulder.
Definition: MultiAgentHandOvers.h:124
void addTester(AbstractHandOverTest *tester, bool is_default=false)
add tester, the object will own the pointer.
Definition: MultiAgentHandOvers.cpp:20
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:290
void addDefault(std::string const &name)
sets an already added method as the default for the status level it provides
Definition: MultiAgentHandOvers.cpp:33
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:252
AbstractHandOverTest * getTester(std::string const &name)
the the tester named name (by the developper of the tester)
Definition: MultiAgentHandOvers.cpp:37
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:269
AbstractHandOverTest * getDefault(FrontierCells::FrontierCheckStatus target_status)
get the default method class set for this status level
Definition: MultiAgentHandOvers.cpp:43
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:45
Definition: MultiAgentHandOvers.h:27
The HandOverTestDistance class tests if the distance between 2 agents allows them to make a hand over...
Definition: MultiAgentHandOvers.h:154
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:164
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:289
The AbstractHandOverTest class is an abstract class providing the basic interface for a handover/fron...
Definition: MultiAgentHandOvers.h:15
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()=0
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:244
The FrontierTester class is a unique interface for all available/desired handover/frontier testers...
Definition: MultiAgentHandOvers.h:60
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:220
Definition: MultiHandOverUtils.hpp:92
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:182
Definition: trajectory.hpp:40
void timeLimit(double time_limit_ms)
sets the time limit for the motion planner, in milliseconds
Definition: MultiAgentHandOvers.h:118
The HandOverTestGrabs class tests if a grab conf exists for both agent to grasp the object...
Definition: MultiAgentHandOvers.h:194
The HandOverTestObject class tests if ha handover is correct regarding to the object.
Definition: MultiAgentHandOvers.h:175
Definition: MultiAgentHandOvers.h:261
Plannar HRI Cell.
Definition: HRICS_MultiAgentGrid.hpp:462
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:270
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:201
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:221
The AbstracHandOverObjectCheck class is an abstract class providing tools to check the possibility of...
Definition: MultiAgentHandOvers.h:106
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:183
Definition: ConfGenerator.h:51
virtual FrontierCells::FrontierCheckStatus getCheckStatusLevel()
get the status level that the class provides.
Definition: MultiAgentHandOvers.h:251
Definition: MultiAgentHandOvers.h:282
Definition: Chronometer.hpp:9
virtual FrontierCells::FrontierCheckStatus getRequiredCheckStatus()
get the required status level for the class to compute its check.
Definition: MultiAgentHandOvers.h:47