1 #ifndef MULTIPATHPLANNER_H
2 #define MULTIPATHPLANNER_H
5 #include "HRI_costspace/HRICS_MultiHandOver.h"
6 #include "MultiHandOverUtils.hpp"
7 #include "utils/MultiHandOverAlgos.h"
8 #include "utils/multiHandOver/LazyWAstar.h"
14 MultiPathLWANode(std::vector<unsigned int> agents, std::vector<HRICS::MultiAgentCell*> positions,
16 MultiPathLWANode(std::vector<unsigned int> agents, std::vector<HRICS::MultiAgentCell*> positions,
18 std::deque<mho::LWANodeInterface*> *prev_paths, std::deque<mho::LWANodeInterface*>::iterator prev_path_current,
bool allow_delay=
false);
23 virtual std::vector<LWANodeInterface*> sons();
25 virtual double edgeCostEstimationFrom(LWANodeInterface *parent);
26 virtual double computeHeuristic(LWANodeInterface *goal);
27 virtual double computeTrueCost(LWANodeInterface *other);
28 virtual bool isSameConf(LWANodeInterface *other);
30 double getDurationMax(){
return _duration_max;}
36 int agent_index(
unsigned int i){
return (i<_agents_indices.size() ? _agents_indices[i] : -1);}
37 void agent_index(
unsigned int i,
unsigned int a){
if(i<_agents_indices.size()){ _agents_indices[i]=a;}}
38 typedef enum {NEVER,BEGIN,END} FreeWaiting_T;
39 void freeWainting(
unsigned int i,FreeWaiting_T when){
if(i<_agents_indices.size()) _wait_is_free[i]=when;}
40 FreeWaiting_T freeWainting(
unsigned int i){
return (i<_wait_is_free.size() ? _wait_is_free[i] : NEVER);}
41 void setAllowDelay(
bool b){_allow_delay=b;}
42 bool getAllowDelay(){
return _allow_delay;}
47 std::vector<unsigned int> _agents_indices;
48 std::vector<HRICS::MultiAgentCell*> _positions;
52 std::vector<FreeWaiting_T> _wait_is_free;
55 std::deque<mho::LWANodeInterface*> *_prev_path;
56 std::deque<mho::LWANodeInterface*>::iterator _prev_path_current;
65 _showText(show_text), _draw(draw), _grid(grid),
66 _open_c(0),_closed_c(0)
69 void setShowText(
bool b){this->_showText=b;}
75 virtual void onFail();
76 virtual void onAbort();
77 virtual void onEnd(std::vector<std::pair<unsigned int,double> > times);
82 vector<HRICS::MultiAgentCell*> _cells_for_draw;
95 bool compute(
double time_limit_ms=-1);
103 std::vector<HRICS::MultiAgentCell*>
findParking(
const std::deque<mho::LWANodeInterface *> &existing_path,
unsigned int agent_to_park);
105 std::deque<mho::LWANodeInterface*> getPath();
110 void setAgents(std::vector<unsigned int> agents_ids);
112 void setStart(std::vector<HRICS::MultiAgentCell*> cells);
120 void setGoal(std::vector<HRICS::MultiAgentCell*> cells);
131 void setHierarchy(
bool h){_hierachy=h;}
132 bool getHierarchy(){
return _hierachy;}
140 std::vector<unsigned int> _agents_indices;
142 std::vector<HRICS::MultiAgentCell*> _start_pos;
144 std::vector<HRICS::MultiAgentCell*> _goal_pos;
159 std::map<HRICS::MHO::MultiHandOverAgent*,HRICS::MultiAgentCell*> start_state);
161 std::vector<std::pair<HRICS::MHO::SubTask*,HRICS::MHO::SubTask*> > & getTasksInCollision(){
return _colliding_stk;}
165 std::map<HRICS::MHO::MultiHandOverAgent*,HRICS::MultiAgentCell*> _start_state;
167 std::vector<std::pair<HRICS::MHO::SubTask*,HRICS::MHO::SubTask*> > _colliding_stk;
170 #endif // MULTIPATHPLANNER_H
Definition: MultiPathPlanner.h:155
void setAgents(std::vector< unsigned int > agents_ids)
set the agents to use
Definition: MultiPathPlanner.cpp:33
void setGoal(std::vector< HRICS::MultiAgentCell * > cells)
set the goal cells.
Definition: MultiPathPlanner.cpp:39
void setStart(std::vector< HRICS::MultiAgentCell * > cells)
set the starting cells for all agents
Definition: MultiPathPlanner.cpp:46
Definition: MultiPathPlanner.h:60
Definition: LazyWAstar.h:136
Plannar HRI Grid considering multiple agents systems for HRi operations.
Definition: HRICS_MultiAgentGrid.hpp:28
Definition: LazyWAstar.h:69
Definition: LazyWAstar.h:56
void setGoalByID(unsigned int agent_id, HRICS::MultiAgentCell *goal)
set the goal position for the agent having ID agent_id
Definition: MultiPathPlanner.cpp:69
Definition: MultiPathPlanner.h:10
void setStartByID(unsigned int agent_id, HRICS::MultiAgentCell *start)
set the starting position for the agent having ID agent_id
Definition: MultiPathPlanner.cpp:63
Plannar HRI Cell.
Definition: HRICS_MultiAgentGrid.hpp:462
Definition: MultiPathPlanner.h:88
Definition: MultiHandOverUtils.hpp:328
std::vector< HRICS::MultiAgentCell * > findParking(const std::deque< mho::LWANodeInterface * > &existing_path, unsigned int agent_to_park)
findParking finds a cell where an agent is safe from collision with any other robot anywhere along th...
Definition: MultiPathPlanner.cpp:146
Definition: LazyWAstar.h:25