libmove3d-planners
 All Classes Namespaces Files Functions Variables Enumerations Enumerator Friends Macros Groups Pages
MultiHandOverUtils.hpp
1 #ifndef MULTIHANDOVERUTILS_HPP
2 #define MULTIHANDOVERUTILS_HPP
3 
4 #include <Eigen/Core>
5 
6 #include "P3d-pkg.h"
7 #include "API/Device/robot.hpp"
8 #include "HRI_costspace/Grid/HRICS_MultiAgentGrid.hpp"
9 #include "multiHandOver/LazyWAstar.h"
10 #include "multiHandOver/SimpleGraph.h"
11 //#include "MultiHandOverAlgos.h"
12 //#include "HRI_costspace/HRICS_MultiHandOver.h"
13 #include "utils/multiHandOver/graphAlgorithms.h"
14 #include "Logging/Logger.h"
15 
16 #include "GTP/taskManagerInterface.hpp"
17 
18 
19 extern taskManagerInterface *TMI;
20 
21 
22 namespace HRICS {
23 class MultiHandOver;
24 
25 namespace MHO{
26 class AbstractSolutionTools;
27 class AbstracHandOverObjectCheck;
28 class ToolSet;
29 
30 
37 public:
39  {
40  }
41  virtual ~AlgoLoggerInterface(){}
42  //virtual void textlog(std::stringstream ss){}
43  virtual void drawcells(MultiAgentCell* c1,MultiAgentCell* c2,bool marker){}
44  virtual void draw() {}
45  virtual void resetdisp() {}
46  //virtual void drawcellsdist(std::vector<MultiAgentCell*> &cells) =0;
47 };
48 
84 {
85 public:
87  bool configure_from_xml(std::istream & is);
88 private:
89  MultiHandOver* _mho;
90 };
91 
93 public:
94  MultiHandOverAgent(Robot *r,double use_cost,double speed,unsigned int index);
95  Robot *robot;
96  bool is_human;
97  unsigned int index;
98  std::string shortname;
99  double use_cost;
100  double speed;
101  double safe_dist;
103  double reach();
107  double shoulderHeight();
108  bool have_final_position;
109 };
110 
112 {
113 public:
114  MultiHandOver3dPlanner(Robot * robot, bool is_human);
115 
116  bool grabConfIK(configPt &q, confPtr_t robotPos, const Eigen::Vector3d & grab_point);
117 
126  bool grabConfCheck(configPt &q, const Eigen::Vector2d robot_pos, const Eigen::Vector3d & grab_point);
127  bool grabConfIK_human(configPt &q, confPtr_t const humanPos, Eigen::Vector3d const & grab_point);
128 
129  bool computeHandOverTrajectory(confPtr_t q_start,confPtr_t q_end);
130  void clearTraj(confPtr_t conf=confPtr_t((Configuration*)0));
131  bool computeTrajectory(confPtr_t start_conf,confPtr_t nav_conf, std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > const& path2d, confPtr_t end_conf);
132  bool computePath2dToPath3dShortCut(std::vector<Eigen::Vector2d,Eigen::aligned_allocator<Eigen::Vector2d> > const& path2d, std::vector<Eigen::Vector3d,Eigen::aligned_allocator<Eigen::Vector3d> > &path3d );
133 
134 private:
135  Robot * _robot;
136  bool _is_human;
137 };
138 
139 
140 
142 public:
143  class Action{
144  private:
145  //Robot *agentA,*agentB;
146  //FrontierPtr frontier;
147  //std::vector<MultiAgentCell*> &pathA, &pathB;
148  //double &distA,&distB;
149  unsigned int _f;
151  static void checkI(unsigned int i){if(i>1){throw(std::invalid_argument("argument must be 0 or 1"));}}
152  public:
153  Action(unsigned int frontier_index,MultiHandOverSolution * solution);
154  Robot* robot(unsigned int i){checkI(i);return _s->agents[_f+i]->robot;}
155  MultiHandOverAgent * agent(unsigned int i){checkI(i);return _s->agents[_f+i];}
156  std::vector<MultiAgentCell*> & path(unsigned int i){ checkI(i); return _s->navigation_trajs[_f*2+i];}
157  void setPath(unsigned int i,std::vector<MultiAgentCell*> &path){ checkI(i); _s->navigation_trajs[_f*2+i]=path;}
159  MultiAgentCell* from(unsigned int i){return (i<2 && _s->navigation_trajs[_f*2+i].size() ? _s->navigation_trajs[_f*2+i][0] : 0);}
161  MultiAgentCell* to(unsigned int i){return (i<2 && _s->navigation_trajs[_f*2+i].size() ? _s->navigation_trajs[_f*2+i].back() : 0);}
162  double dist(unsigned int i){return (i<2 ? _s->nav_dists[_f*2+i]: -1 );}
163  void setDist(unsigned int i,double d){(i<2 ? _s->nav_dists[_f*2+i]=d: -1 );}
164  double startDate(unsigned int i){checkI(i); return _s->nav_start_dates[_f*2+i];}
165  void setStartDate(unsigned int i, double date_s){checkI(i); _s->nav_start_dates[_f*2+i]=date_s;}
166  double startDateHO(){return _s->ho_start_end_dates[_f].first;}
167  void setStartDateHO(double start_s){_s->ho_start_end_dates[_f].first=start_s;}
168  double endDateHO(){return _s->ho_start_end_dates[_f].second;}
169  void setEndDateHO(double end_s){_s->ho_start_end_dates[_f].second=end_s;}
170  double navTime(unsigned int i){checkI(i); return _s->nav_times[_f*2+i];}
171  void setNavTime(unsigned int i, double time_s){checkI(i); _s->nav_times[_f*2+i] = time_s;}
172  Configuration & initQ(unsigned int i){checkI(i); return _s->initial_confs[_f+i];}
173  FrontierPtr frontier(){return _s->frontiers[_f];}
174  MultiHandOverSolution* getSolution(void){return _s;}
175  confPtr_t objectPos();
176  confPtr_t agentConf(unsigned int i);
177  };
178  struct CostData{
179  CostData():dist(-1),time(-1),use_cost(-1),handover_cost(-1),handovers(0),marker_is_opt(0),agent_names(0){}
181  double dist;
182  double time;
183  double use_cost;
184  double handover_cost;
185  unsigned int handovers;
186  unsigned int go_to_target_nb;
187  bool marker_is_opt;
188  std::vector<std::string> agent_names;
189  };
190 
191  MultiHandOverSolution(void);
192  MultiHandOverSolution *cloneAsSon(void);
193  MultiHandOverSolution *clone(void);
194  unsigned int getId(void){return _id;}
195  bool addHandOverAction(FrontierPtr frontier);
196 
197  double getTotalDist();
198  double getTotalUseCost();
199 
200  double cost;
201  double time;
203  double hri_cost;
204  std::vector<Configuration> initial_confs,target_confs;
205  //trajectories traj; ///< the complete solution as trajectories for each agents
206  std::vector<MultiHandOverAgent*> agents;
207  std::vector<Action> actions;
208  std::vector<std::tr1::shared_ptr<FrontierCells> > frontiers;
209 
210  std::vector<double> avail_delay;
211  std::vector<double> nav_start_dates;
216  std::vector<std::pair<double,double> > ho_start_end_dates;
217  std::vector<double> handover_times;
218  std::vector<double> handover_hri_costs;
219  std::vector<std::vector<MultiAgentCell*> > navigation_trajs;
220  std::vector<double> nav_dists;
221  std::vector<double> nav_times;
223  std::vector<std::vector<MultiAgentCell*> > navigation_trajs_to_target;
224  std::vector<double> nav_dists_to_target;
225  std::vector<std::pair<double,double> > nav_start_end_times_to_target;
226  bool is_optimized;
227  friend std::ostream& operator<<(std::ostream& os, const MultiHandOverSolution& sol);
228  friend bool operator<(const MultiHandOverSolution &left,const MultiHandOverSolution &right);
229  friend bool operator>(const MultiHandOverSolution &left,const MultiHandOverSolution &right);
230  static bool less(MultiHandOverSolution const *left,MultiHandOverSolution const *right);
231  std::string print_long();
232 
233  //solution modification graph
234  std::vector<MultiHandOverSolution*> sons;
235  MultiHandOverSolution * parent;
236  MultiHandOverSolution * oldest_parent;
237 
238  Robot* object;
239 
240  static void printFamiliesTrees(std::vector<MultiHandOverSolution*> &solutions, std::ofstream &output);
241  static void resetID(void){MultiHandOverSolution::_current_id=0;}
242 private:
243  static unsigned int _current_id;
244  unsigned int _id;
245 };
246 
247 
248 class SubTask{
249 public:
250  typedef enum {UNDEF=0, HO_GIVE, HO_GET, NAV_WITH_OBJ, NAV_TO_HO, NAV_TO_TARGET, NAV_SYNC, NAV_OTHER,IDLE} TaskType_t;
251  typedef enum {SHO_NONE=0,
258  SHO_ENUM_SIZE} HandoverStepType_t;
259  typedef enum {IS_2D=0, HAS_FULL_TRAJ, COMPLETED, RUNNING, SIZE} MarkerList_t;
260  SubTask();
261  SubTask(MultiHandOverAgent* agent, TaskType_t type, double beginDate, double endDate, double cost=0, HandoverStepType_t hostepType = SHO_NONE);
262  virtual ~SubTask();
263 
264  void resetMarker();
265  bool getMarker(MarkerList_t m);
266  void setMarker(MarkerList_t m, bool b);
267 
268  TaskType_t type() const ;
269  HandoverStepType_t hoStepType() const;
270  bool isNav() const ;
271  bool isManip() const ;
272 
273  double beginDate();
274  double endDate();
275  double duration();
276  void extendToEndDate(double new_end_date);
277  void extendDuration(double new_duration);
278  void replan(double new_begin);
279  double cost();
280 
281  MultiHandOverAgent *agent();
282 
283  std::vector<confPtr_t> & waypoints();
284  std::vector<Eigen::Vector2d> & waypoints2d();
285  void addWaypoint(confPtr_t q);
286  void addWaypoint(Eigen::Vector2d v, double date=-numeric_limits<double>::infinity());
287  std::vector<double> & waypointDates();
288  API::Trajectory &traj();
289  void traj(API::Trajectory traj);
290  void spreadIdlePositionToNext();
291 
292  void addPrevious(SubTask* prev);
293  void addNext(SubTask* next);
294  std::vector<SubTask*> & getPrev(){return this->prev;}
295  std::vector<SubTask*> & getNext(){return this->next;}
296  void substitutePrev(SubTask *prev,SubTask *new_prev);
297  void substituteNext(SubTask *next,SubTask *new_next);
298 
299  unsigned int getId(){return this->_id;}
300  static bool compareLessBeginDate(SubTask &t1,SubTask &t2){return t1.beginDate() < t2.beginDate();}
301  static bool compareLessBeginDatePtr(SubTask *t1,SubTask *t2){return t1->beginDate() < t2->beginDate();}
302 
303  static std::string typeString(SubTask::TaskType_t t);
304 
305  //TODO for debug:
306  std::string comment;
307 private:
308  TaskType_t _type;
309  HandoverStepType_t _handoverStepType;
310  double _begin_date,_end_date;
311  double _duration;
312  double _cost;
313  MultiHandOverAgent *_agent;
314  std::vector<confPtr_t> _wp;
315  std::vector<Eigen::Vector2d> _2d_wp;
316  std::vector<double> _dates_wp;
317  API::Trajectory _traj;
318 
319  std::vector<SubTask*> prev;
320  std::vector<SubTask*> next;
321 
322  std::vector<bool> _markers;
323 
324  unsigned int _id;
325  static unsigned int _count_id;
326 };
327 
328 class Task{
329 public:
331  {
332  public:
333  state_iterator(Task* task);
334  bool advance();
335  std::map<MHO::MultiHandOverAgent*,Eigen::Vector2d> & state();
336  SubTask* getSubTask(MultiHandOverAgent* agent);
337  double date();
338  bool isEnd();
339 
340  private:
341  Task* _task;
342  bool _is_end_iterator;
343  HRICS::MultiAgentGrid* _grid;
344  std::map<MHO::MultiHandOverAgent*,Eigen::Vector2d> _state_current;
345  double _time;
346  std::map<MHO::SubTask*,pair<int, double> > _trak;
347  std::map<MHO::SubTask*,pair<int, double> > _next;
348  std::map<MHO::MultiHandOverAgent*,MHO::SubTask*> _sub_task;
349  };
350 
352  ~Task();
353  SubTask* getSubTask(int i);
354  std::vector<HRICS::MHO::MultiHandOverAgent*> const & getAgents();
355  std::vector<SubTask *> const & getSubTasks();
356  void addSubTask(SubTask* st, bool no_sort=false);
359  void eraseSubTask(SubTask* st);
361  void plotGanttChart();
366  void displayGraph();
367  void removeIdles();
370  void fillWithIdle(map<MultiHandOverAgent *, MultiAgentCell *> &state_begin);
371  state_iterator begin();
372 
373  void refineHandOvers();
374  void refineHandOver(SubTask *st1,SubTask *st2);
375 
376  void setObject(Robot* obj){_object=obj;}
377  Robot *getObject(){return _object;}
378 
379 private:
380  std::vector<SubTask*> _sub_tasks;
381  vector<MultiHandOverAgent*> _agents;
382  Robot* _object;
383 };
384 
388 struct SubTaskMHP{
389  //SubTaskMHP(SubTask *st);
390  std::string robotname;
391  std::vector<int> nexts;
392  int index;
393  double begin,end;
394  std::vector<confPtr_t> wp;
395  SubTask::TaskType_t type;
396 };
397 
400 {
401  MultiHandOverMhpHO(MultiHandOverSolution *sol,unsigned int step);
402  std::string g_name;
403  Eigen::Vector3d g_pose;
404  enum {ARM_LEFT,ARM_RIGHT,ARM_UNDEF} g_arm;
405  std::vector<double> g_arm_conf;
406  double g_torso;
407 
408  std::string r_name;
409  Eigen::Vector3d r_pose;
410  double r_torso;
411  std::vector<double> r_arm_conf;
412 
413  Eigen::Vector3d obj_pose;
414 
415  double r_start_time;
416  double g_start_time;
417 
418 };
419 
426 {
427 public:
432  double computeCost();
433  double humanRobotDistanceRelatedCost();
434 
435  //getters / setters
436  double getCost(void) const;
437  void setCost(double cost);
438  double getTime(void) const;
439  void setTime(double time_sec);
440 
441  Robot* robot(unsigned int i);
442  MultiHandOverAgent* agent(unsigned int i);
443  //FrontierPtr frontier(void);
444  MultiAgentCell *cell(unsigned int i);
445 
446  //methods to find a handover
447  static MultiHandOverHO handoverBetween2pos(MultiAgentCell* cellA,MultiAgentCell* cellB,unsigned int agentA, unsigned int agentB);
448  static void getOptimalCost(MultiHandOverAgent *a1, MultiHandOverAgent *a2,double &cost,double &duration,MultiHandOver* mho);
449 
450 private:
451  double cost;
452  double time;
453  MultiHandOverAgent *_a1,*_a2;
454  MultiAgentCell *_c1,*_c2;
455  double _d;
456  MultiHandOver* _mho;
457  //MultiHandOverSolution::Action *_action;
458 
459 };
460 
462 {
463 public:
464  HandOverFinder(MultiHandOver* mho,MultiAgentGrid *grid,unsigned int agent1,unsigned int agent2,
465  MultiAgentCell* cell1_O,MultiAgentCell* cell2_O,MultiAgentCell* cell1_T,MultiAgentCell* cell2_T);
466  FrontierPtr findFrom2Points();
467  //void setCostFunction(double (*func)(double,unsigned int)){_cost_function=func;}
468 
469 private:
470  MultiAgentGrid *_grid;
471  MultiHandOver *_mho;
472  unsigned int _agent1,_agent2;
473  MultiAgentCell *_cell1_ori,*_cell2_ori,*_cell1_dest,*_cell2_dest;
474 
475  //double (*_cost_function)(double ,unsigned int);
476 };
477 
483 public:
485  virtual ~MultiHandOverHeuristic(){}
496  virtual double compute(MultiAgentCell* c1,unsigned int a1,MultiAgentCell* c2,unsigned int a2);
497  std::vector<double> getTimes(){return _times;}
498 protected:
499  void doTheGraph();
500  mho::ReverseDisjkstra& getRevDijkstra(){return rev_dijk;}
501  MultiHandOver* getMho(){return _mho;}
502  MHO::AbstractSolutionTools* getSolutionTools(){return _tools;}
503  mho::Node* getAgentNode(unsigned int i){return _agents_nodes[i];}
504 private:
505  MultiHandOver *_mho;
506  mho::SimpleGraph _graph;
507  std::vector<mho::Node*> _agents_nodes;
509  //TODO remove related
510  std::vector<double> _times;
511  mho::ReverseDisjkstra rev_dijk;
512 };
513 
515 public:
517 
519  virtual double compute(MultiAgentCell *c1, unsigned int a1, MultiAgentCell *c2, unsigned int a2);
520 
521 protected:
539  virtual double findMinimalFrontier(MultiAgentCell* c1i,MultiAgentCell* c1g, unsigned int a1,
540  MultiAgentCell *c2i,MultiAgentCell* c2g, unsigned int a2);
541  Eigen::Vector2d findMinimalFrontier2pt(Eigen::Vector2d c1, double f1, Eigen::Vector2d c2, double f2);
542  Eigen::Vector2d findMinimalFrontier3pt(Eigen::Vector2d ci,Eigen::Vector2d cg, double f1, Eigen::Vector2d c2, double f2);
543  Eigen::Vector2d findMinimalFrontier4pt(Eigen::Vector2d c1i,Eigen::Vector2d c1g, double f1, Eigen::Vector2d c2i, Eigen::Vector2d c2g, double f2);
544 
545 };
546 
548  MOVE3D_STATIC_LOGGER;
549 public:
550  LazyWeightedAstarNode(MultiAgentCell* cell, unsigned int agent,MultiHandOverHeuristic *heuristic, ToolSet *tool_set);
552  virtual ~LazyWeightedAstarNode();
553  virtual LWANodeInterface *clone();
554 
555  std::vector<LWANodeInterface*> sons();
556 
557  virtual void g(double g);
558  virtual double computeEndDate();
560  virtual bool isAgentAlreadyUsed();
561  virtual double edgeCostEstimationFrom(LWANodeInterface *parent);
562  virtual double computeHeuristic(LWANodeInterface *goal);
563  virtual double computeTrueCost(LWANodeInterface *parent);
564  virtual bool isSameConf(LWANodeInterface *other);
565 
566  static LazyWeightedAstarNode *cast(LWANodeInterface* p){return dynamic_cast<LazyWeightedAstarNode*>(p);}
567 
568  MultiAgentCell *cell(){return _cell;}
569  void cell(MultiAgentCell* c){_cell=c;}
570  unsigned int agent(){return _agent;}
571  void agent(unsigned int a){_agent=a;}
572  void parent(LazyWeightedAstarNode* p);
573  LWANodeInterface* parent(){return mho::LWANodeBase::parent();}
574 
575 private:
576  MultiAgentCell *_cell;
577  unsigned int _agent;
578  MultiHandOverHeuristic *_heuristic_class;
579  MHO::ToolSet *_toolset;
580  std::vector<bool> _agents_in_parents;
581  double _time,_last_computed_time,_last_computed_cost;
582 
583 
584 };
585 
587 {
588 public:
589  DisplayLWAstarInGrid(MultiAgentGrid *grid, bool showtext, bool draw=true);
590  virtual ~DisplayLWAstarInGrid(){}
591  void onOpen(mho::LWANodeInterface* open);
592  void onClose(mho::LWANodeInterface* closed);
593  void onFound(mho::LWANodeInterface* goal);
594  void onEnd(std::vector<pair<unsigned int,double> > times);
595  void setDraw(bool b){_draw=b;}
596  std::vector<std::pair<unsigned int,double> > getTimes();
597 
598 private:
599  MultiAgentGrid *_grid;
600  bool _marker_is_first_call;
601  bool _showText,_draw;
602  std::vector<MultiAgentCell*> _cells;
603  double _max_draw_f;
604  double count_open,count_closed;
605  std::vector<std::pair<unsigned int,double> > _times;
606 };
607 
608 }
609 }
610 #endif // MULTIHANDOVERUTILS_HPP
std::string r_name
receiver agent name
Definition: MultiHandOverUtils.hpp:408
Definition: graphAlgorithms.h:39
double reach()
the reach distance of the arm of the agent. -inf if not set/known
Definition: MultiHandOverUtils.cpp:234
giver open gripper
Definition: MultiHandOverUtils.hpp:254
The MultiHandOverMhpHO struct defines data for a handover to be exported in MHP.
Definition: MultiHandOverUtils.hpp:399
receiver close gripper
Definition: MultiHandOverUtils.hpp:255
Eigen::Vector3d obj_pose
object 3D position (x,y,z)
Definition: MultiHandOverUtils.hpp:413
The SubTaskMHP struct is to pass results to MHP as simplified SubTask.
Definition: MultiHandOverUtils.hpp:388
void fillWithIdle(map< MultiHandOverAgent *, MultiAgentCell * > &state_begin)
create new IDLE sub tasks when needed manages previous/next relations
Definition: MultiHandOverUtils.cpp:1375
virtual double compute(MultiAgentCell *c1, unsigned int a1, MultiAgentCell *c2, unsigned int a2)
compute
Definition: MultiHandOverUtils.cpp:1832
Definition: HRICS_MultiHandOver.h:16
Definition: MultiHandOverUtils.hpp:143
Definition: SimpleGraph.h:19
MultiAgentCell * to(unsigned int i)
the cell the agent goes to for the next action, if any, 0 otherwise
Definition: MultiHandOverUtils.hpp:161
Eigen::Vector3d g_pose
giver 3d pose (x,y,theta)
Definition: MultiHandOverUtils.hpp:403
virtual double findMinimalFrontier(MultiAgentCell *c1i, MultiAgentCell *c1g, unsigned int a1, MultiAgentCell *c2i, MultiAgentCell *c2g, unsigned int a2)
findMinimalFrontier searches for the frontier between a1 and a2 that minimizes the distance agents ha...
Definition: MultiHandOverUtils.cpp:1994
The ConfigFileParser class parses a stream representing data as an XML file.
Definition: MultiHandOverUtils.hpp:83
bool grabConfCheck(configPt &q, const Eigen::Vector2d robot_pos, const Eigen::Vector3d &grab_point)
given a 2D position for the robot and a 3d position for the object, find a free grabing conf ...
Definition: MultiHandOverUtils.cpp:369
Definition: MultiHandOverUtils.hpp:586
The ToolSet class bundles other tool classes and provides utilities to configure them easily...
Definition: MultiHandOverAlgos.h:67
giver disengage its arm
Definition: MultiHandOverUtils.hpp:256
Plannar HRI Grid considering multiple agents systems for HRi operations.
Definition: HRICS_MultiAgentGrid.hpp:28
virtual bool isAgentAlreadyUsed()
returns true if the agent is used by the ancestors of this
Definition: MultiHandOverUtils.cpp:2170
double time
the estimation of the execution time of the plan
Definition: MultiHandOverUtils.hpp:201
receiver extends arm to reach object
Definition: MultiHandOverUtils.hpp:253
friend std::ostream & operator<<(std::ostream &os, const MultiHandOverSolution &sol)
a marker for debug
Definition: MultiHandOverUtils.cpp:726
void plotGanttChart()
use gnuplot to plot the gantt chart of the task (create new independent process/window) ...
Definition: MultiHandOverUtils.cpp:1270
std::vector< double > avail_delay
estimation of the time each agent have to start its plan
Definition: MultiHandOverUtils.hpp:210
This class holds a the robot represented by a kinematic chain.
Definition: robot.hpp:42
The MultiHandOverHO class describes a hand over, and implements method to compute costs and improve a...
Definition: MultiHandOverUtils.hpp:425
MultiAgentCell * from(unsigned int i)
the cell the agent come from (previous action position, if any, 0 otherwise)
Definition: MultiHandOverUtils.hpp:159
Definition: LazyWAstar.h:69
Definition: MultiHandOverUtils.hpp:547
double cost
the cost (estimated) of the solution
Definition: MultiHandOverUtils.hpp:200
Definition: MultiHandOverUtils.hpp:461
double shoulderHeight()
return the shoulder height
Definition: MultiHandOverUtils.cpp:242
std::vector< MultiHandOverAgent * > agents
list of agents used (in the order they have the object)
Definition: MultiHandOverUtils.hpp:206
giver extends arm
Definition: MultiHandOverUtils.hpp:252
This file implements macros to help with the logging, in a way similar to ROS, using log4cxx...
Definition: MultiHandOverAlgos.h:14
std::vector< std::vector< MultiAgentCell * > > navigation_trajs
the navigation trajectories.
Definition: MultiHandOverUtils.hpp:219
void displayGraph()
uses graphviz (dot) to display the (directed) graph representing the time constraints of the task nod...
Definition: MultiHandOverUtils.cpp:1314
virtual double compute(MultiAgentCell *c1, unsigned int a1, MultiAgentCell *c2, unsigned int a2)
compute
Definition: MultiHandOverUtils.cpp:1900
Definition: taskManagerInterface.hpp:43
Definition: MultiHandOverUtils.hpp:111
std::vector< double > nav_dists
costs for each deplacement made (2 nav costs for each handover, the first is the one of the agent hol...
Definition: MultiHandOverUtils.hpp:220
Definition: MultiHandOverUtils.hpp:92
double handover_comfort_dist
for human only, optimal arm extension distance to get an object (must be in [0..reach]) ...
Definition: MultiHandOverUtils.hpp:102
Definition: LazyWAstar.h:56
Definition: trajectory.hpp:40
std::vector< std::vector< MultiAgentCell * > > navigation_trajs_to_target
the navigation trajectories to reach final target positions.
Definition: MultiHandOverUtils.hpp:223
The MultiHandOverHeuristic class provides an heuristic based on euclidian distance and minimal cost b...
Definition: MultiHandOverUtils.hpp:482
std::string g_name
giver agent name
Definition: MultiHandOverUtils.hpp:402
std::vector< std::pair< double, double > > ho_start_end_dates
start and end dates of each hand over
Definition: MultiHandOverUtils.hpp:216
Plannar HRI Cell.
Definition: HRICS_MultiAgentGrid.hpp:462
Definition: MultiHandOverUtils.hpp:141
double g_torso
giver torso joint
Definition: MultiHandOverUtils.hpp:406
double safe_dist
for human only, the minimal distance to feel safe about surrounding robots
Definition: MultiHandOverUtils.hpp:101
std::vector< double > g_arm_conf
giver arm configuration
Definition: MultiHandOverUtils.hpp:405
std::vector< std::tr1::shared_ptr< FrontierCells > > frontiers
the places (frontiers) where the object is transferred
Definition: MultiHandOverUtils.hpp:208
std::vector< std::pair< double, double > > nav_start_end_times_to_target
nav times of the path to reach final target as begin and end dates in seconds
Definition: MultiHandOverUtils.hpp:225
not a HO task
Definition: MultiHandOverUtils.hpp:251
Classe représentant une Configuration d'un Robot.
Definition: configuration.hpp:25
enum HRICS::MHO::MultiHandOverMhpHO::@3 g_arm
giver arm
void eraseSubTask(SubTask *st)
erase a sub task from the list also delete the existing references to it in the other sub tasks of th...
Definition: MultiHandOverUtils.cpp:1464
Eigen::Vector3d r_pose
receiver 3d pose (x,y,theta)
Definition: MultiHandOverUtils.hpp:409
The AlgoLoggerInterface class defines dummy logging methods that will be used for textual log and dis...
Definition: MultiHandOverUtils.hpp:36
Definition: MultiHandOverUtils.hpp:328
Definition: MultiHandOverUtils.hpp:248
std::vector< double > handover_times
duration of each handover
Definition: MultiHandOverUtils.hpp:217
double computeCost()
compute cost and time duration of the handover
Definition: MultiHandOverUtils.cpp:1681
Definition: Node.h:14
Definition: MultiHandOverUtils.hpp:178
std::vector< double > nav_start_dates
estimations of the start date (seconds after the 1st nav begining) of each navigation step ...
Definition: MultiHandOverUtils.hpp:215
receiver disengage arm with the object
Definition: MultiHandOverUtils.hpp:257
std::vector< double > handover_hri_costs
HRI related costs of each handover.
Definition: MultiHandOverUtils.hpp:218
std::vector< double > nav_times
the duration of each navigation
Definition: MultiHandOverUtils.hpp:222
Definition: MultiHandOverUtils.hpp:330
Definition: LazyWAstar.h:25
double cumul_time_nav
estimation of cumulated navigation of times of all robots
Definition: MultiHandOverUtils.hpp:202
Definition: MultiHandOverUtils.hpp:514
HandoverStepType_t
Definition: MultiHandOverUtils.hpp:251