avoidance_resolution.cpp
Go to the documentation of this file.
1 /*
2  * Copyright (c) 2017, <copyright holder> <email>
3  * All rights reserved.
4  *
5  * Redistribution and use in source and binary forms, with or without
6  * modification, are permitted provided that the following conditions are met:
7  * * Redistributions of source code must retain the above copyright
8  * notice, this list of conditions and the following disclaimer.
9  * * Redistributions in binary form must reproduce the above copyright
10  * notice, this list of conditions and the following disclaimer in the
11  * documentation and/or other materials provided with the distribution.
12  * * Neither the name of the <organization> nor the
13  * names of its contributors may be used to endorse or promote products
14  * derived from this software without specific prior written permission.
15  *
16  * THIS SOFTWARE IS PROVIDED BY <copyright holder> <email> ''AS IS'' AND ANY
17  * EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
18  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
19  * DISCLAIMED. IN NO EVENT SHALL <copyright holder> <email> BE LIABLE FOR ANY
20  * DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
21  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
22  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND
23  * ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
24  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
25  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
26  *
27  */
28 
30 #include <iostream>
31 #define TIMEOVERLAP (1)
32 
33 namespace multi_robot_router
34 {
35 AvoidanceResolution::AvoidanceResolution(uint32_t _timeoverlap) : timeoverlap_(_timeoverlap)
36 {
37 }
38 
40 {
41 }
42 
43 void AvoidanceResolution::resetSession(const RouteCoordinatorWrapper *_route_querry, const PotentialCalculator *_pCalc, const uint32_t _robotDiameter)
44 {
45  route_querry_ = _route_querry;
46  pCalc_ = _pCalc;
47  robotDiameter_ = _robotDiameter;
48  generatedSubgraphs_.clear();
49  encounteredCollisions_.clear();
53 }
54 
55 void AvoidanceResolution::addCollision(const uint32_t robot)
56 {
57  if (encounteredCollisions_.size() <= robot)
58  encounteredCollisions_.resize(robot + 1, 0);
59 
60  encounteredCollisions_[robot]++;
61 }
62 
63 void AvoidanceResolution::saveCollision(const uint32_t _coll)
64 {
65  addCollision(_coll);
66 }
67 
68 const std::vector<uint32_t> &AvoidanceResolution::getRobotCollisions() const
69 {
71 }
72 
73 std::vector<std::reference_wrapper<Vertex>> AvoidanceResolution::resolve(Vertex &_current, Vertex &_next, int32_t _collision)
74 {
75  generatedSubgraphs_.emplace_back();
76  foundSolutions_.clear();
77 
78  //Triggered when a robot blocks a vertex
79  addCollision(_collision);
80 
81  //find the potential when the collision robots leaves the segment
82  float leavePotential = route_querry_->findPotentialUntilRobotOnSegment(_collision, _next.getSegment().getSegmentId());
83 
84  //There is no solution if the colliding robot never leaves the segment.
85  //Therefore, do nothing when leavePotential is smaller zero
86  if (leavePotential >= 0)
87  {
88  avoidGoal(_current, _next, _collision, leavePotential);
89  trackBack(_current, _next, _collision, leavePotential);
90  }
91 
93  return foundSolutions_;
94 }
95 
96 void AvoidanceResolution::trackBack(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
97 {
98  //Free the next Vertex for new expansion
99  _next.potential = -1;
100  _next.collision = -1;
101 
102  //Return if potential is blocked forever
103  if (_freePotential < 0)
104  return;
105 
106  //If backtracking is not possible (we are on the start vertex) try to wait there
107  //Additionally Backtracking beond wait Segments is not allowed to be able to solve
108  //multi robot scenarios (avoiding n robots in a row)
109  //Anyway backtracking beond wait Segments makes no sense, we will only find allready
110  //found solutions...
111  if (_current.predecessor_ == NULL || _current.isWaitSegment)
112  {
113  int32_t collision = -1;
114 
115  if (route_querry_->checkSegment(_current, 0, _freePotential + 2 * timeoverlap_, robotDiameter_, collision))
116  {
117  _next.potential = -1;
118  _next.collision = -1;
119  //_next.successor_ = NULL; //Tell expander to expand the vertex normally
120 
121  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_current));
122  Vertex &current_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
123  current_n.potential = _freePotential + 2 * timeoverlap_;
124  current_n.collision = _collision;
125  current_n.successor_ = &_next; //Tell expander to only expand to next
126 
127  foundSolutions_.push_back(current_n);
128  }
129  else
130  {
131  if (_collision != collision)
132  addCollision(collision);
133 
134  float leavePotential = route_querry_->findPotentialUntilRobotOnSegment(collision, _current.getSegment().getSegmentId());
135  if (_current.predecessor_ == NULL)
136  avoidStart(_current, _next, collision, leavePotential);
137  else if (_current.isWaitSegment)
138  moveSegment(*_current.predecessor_, _current, collision, leavePotential);
139  }
140  }
141  else //we are somewhere on the path
142  {
143  int32_t collision = -1;
144  bool vertexFree = route_querry_->checkSegment(*_current.predecessor_, _current.predecessor_->potential - timeoverlap_, _freePotential + 2 * timeoverlap_, robotDiameter_, collision);
145 
146  if (vertexFree || collision != -1)
147  {
148  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_current));
149  Vertex &next_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
150  next_n.potential = -1;
151  next_n.collision = -1;
152 
153  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(*(_current.predecessor_)));
154  Vertex &current_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
155  current_n.potential = _freePotential + 2 * timeoverlap_;
156  current_n.collision = _collision;
157 
158  //Set References
159  current_n.successor_ = &next_n; //Tell expander to only expand to "new next" (with new Potential)
160  next_n.predecessor_ = &current_n;
161  next_n.successor_ = &_next; //Tell expander to only expand to next (we are not allowed to leave the backtracked path)
162 
163  if (vertexFree)
164  {
165  foundSolutions_.push_back(current_n);
166  }
167  else if (collision != -1)
168  {
169  if (collision != -1 && collision != _collision)
170  addCollision(collision);
171 
172  float leavePotential = route_querry_->findPotentialUntilRobotOnSegment(collision, current_n.getSegment().getSegmentId());
173  trackBack(current_n, next_n, collision, leavePotential);
174  avoid(current_n, next_n, collision, leavePotential);
175 
176  //Continue Resolving (Avoid Segment, Avoid Crossing, ...)
177  }
178  }
179  }
180 }
181 
182 void AvoidanceResolution::avoid(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
183 {
184  if (_current.predecessor_ == NULL)
185  return;
186 
187  //Return if potential is blocked forever
188  if (_freePotential < 0)
189  return;
190 
191  //We need to find if _next is a successor or a predecessor of current and use this crossing for avoidance
192  bool crossingFound = false;
193  std::vector<std::reference_wrapper<Vertex>> crossing;
194 
195  if (_current.crossingPredecessor)
196  {
197  crossing = _current.getPlanningPredecessors();
198 
199  for (const Vertex &v : crossing)
200  {
201  if (v.getSegment().getSegmentId() == _next.getSegment().getSegmentId())
202  {
203  crossingFound = true;
204  break;
205  }
206  }
207  }
208 
209  if (!crossingFound && _current.crossingSuccessor)
210  {
211  crossing = _current.getPlanningSuccessors();
212 
213  for (const Vertex &v : crossing)
214  {
215  if (v.getSegment().getSegmentId() == _next.getSegment().getSegmentId())
216  {
217  crossingFound = true;
218  break;
219  }
220  }
221  }
222 
223  if (crossingFound)
224  {
225  for (const Vertex &waitSeg : crossing)
226  {
227  if (waitSeg.getSegment().getSegmentId() != _next.getSegment().getSegmentId())
228  {
229  int32_t collision = -1;
230  bool vertexFree = route_querry_->checkSegment(waitSeg, _current.predecessor_->potential + pCalc_->CalculatePotential(_current) - timeoverlap_, std::max<float>(_freePotential, _current.potential + pCalc_->CalculatePotential(waitSeg)) + timeoverlap_, robotDiameter_, collision);
231 
232  if (vertexFree || collision != -1)
233  {
234  //Copy the current Vertex and set smallest possible potential (everithing else stays the same)
235  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_current));
236  Vertex &current_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
237  current_n.potential = current_n.predecessor_->potential + pCalc_->CalculatePotential(current_n);
238 
239  //Copy the wait vertex insert it in the path and assign the right potential
240  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(waitSeg));
241  Vertex &wait_seg_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
242  wait_seg_n.potential = std::max<float>(_freePotential, current_n.potential + pCalc_->CalculatePotential(wait_seg_n)); //Set the potential as max of the next segment is free, and the minimum Vertex potential the robot can achive
243  wait_seg_n.collision = -1;
244  wait_seg_n.isWaitSegment = true;
245 
246  wait_seg_n.successor_ = &_next;
247  wait_seg_n.predecessor_ = &current_n;
248 
249  current_n.successor_ = &wait_seg_n;
250  //Reset _next to be ready for expansion (should be allready done in trackback, but safety first :D)
251  _next.potential = -1;
252  _next.collision = -1;
253 
254  if (vertexFree)
255  {
256  foundSolutions_.push_back(wait_seg_n);
257  }
258  else if (collision != -1)
259  {
260  if (collision != _collision)
261  addCollision(collision);
262 
263  float leavePotential = route_querry_->findPotentialUntilRobotOnSegment(collision, wait_seg_n.getSegment().getSegmentId());
264  moveSegment(current_n, wait_seg_n, collision, leavePotential);
265  }
266  }
267  }
268  }
269  }
270 }
271 
272 void AvoidanceResolution::moveSegment(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential) //Quick fix depth (Better depth queue with best first)
273 {
274  //Return if potential is blocked forever
275  if (_freePotential < 0)
276  return;
277 
278  std::queue<queueElement> empty;
279  std::swap(queue_, empty);
280 
281  queueElement newEle;
282  newEle.next = &_next;
283  newEle.current = &_current;
284  newEle.potential = _freePotential;
285  newEle.collision = _collision;
286 
287  queue_.push(newEle);
288 
289  while (!queue_.empty())
290  {
291 
292  queueElement q = queue_.front();
293  queue_.pop();
294 
295  //We need to find the neighborhood where _current is not present
296  std::vector<std::reference_wrapper<Vertex>> crossing;
297  crossing = q.next->getPlanningPredecessors();
298 
299  for (const Vertex &v : crossing)
300  {
301  if (v.getSegment().getSegmentId() == q.current->getSegment().getSegmentId())
302  {
303  crossing = q.next->getPlanningSuccessors();
304  break;
305  }
306  }
307 
308  int32_t collision = -1;
309 
310  //Check if we have enough time to move through the segment
312  {
313  for (const Vertex &waitSeg : crossing)
314  {
315  if (expandSegment(waitSeg, *(q.current), *(q.next), q.collision, q.potential))
316  return;
317  }
318  }
319  else if (collision != -1)
320  {
321  if (collision != q.collision)
322  addCollision(collision);
323  }
324  }
325 }
326 
327 bool AvoidanceResolution::expandSegment(const Vertex &cSeg, Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
328 {
329  //Return if potential is blocked forever
330  if (_freePotential < 0)
331  return false;
332 
333  int32_t collision;
334  float moveFwdTime = _current.potential + pCalc_->CalculatePotential(_next) + timeoverlap_;
335  float waitTime = std::max<float>(moveFwdTime + pCalc_->CalculatePotential(cSeg) + timeoverlap_, _freePotential + 2 * timeoverlap_);
336  bool vertexIsFree = route_querry_->checkSegment(cSeg, moveFwdTime - timeoverlap_, waitTime, robotDiameter_, collision);
337 
338  if (vertexIsFree || collision != -1)
339  {
340  //We need one Vertex for moving forward (next), one for waiting (waitSeg) and one for moving backward (next).
341  //(We have to copy all three Vertex because every Vertex in the crossing is considered (backtracking...))
342 
343  //Copy Vertex used for moving away
344  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_next));
345  Vertex &move_fwd_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
346  move_fwd_n.potential = moveFwdTime;
347  move_fwd_n.isWaitSegment = false;
348  move_fwd_n.collision = -1;
349 
350  //Copy the Vertex for waiting
351  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(cSeg));
352  Vertex &wait_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
353  wait_n.potential = waitTime;
354  wait_n.isWaitSegment = true;
355  wait_n.collision = -1;
356 
357  //Copy Vertex used for moving back
358  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_next));
359  Vertex &move_bwd_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
360  move_bwd_n.potential = -1;
361  move_bwd_n.isWaitSegment = false;
362  move_bwd_n.collision = -1;
363 
364  move_fwd_n.successor_ = &wait_n;
365  //pred allready set (curr)
366 
367  wait_n.successor_ = &move_bwd_n;
368  wait_n.predecessor_ = &move_fwd_n;
369 
370  move_bwd_n.predecessor_ = &wait_n;
371  move_bwd_n.successor_ = _next.successor_;
372 
373  if (vertexIsFree)
374  {
375  foundSolutions_.push_back(wait_n);
376  return true;
377  }
378  else if (collision != -1)
379  {
380  if (collision != _collision)
381  addCollision(collision);
382 
383  float leavePotential = route_querry_->findPotentialUntilRobotOnSegment(collision, wait_n.getSegment().getSegmentId());
384  queueElement qe;
385  qe.current = &move_fwd_n;
386  qe.next = &wait_n;
387  qe.collision = collision;
388  qe.potential = leavePotential;
389  queue_.push(qe);
390  //addSegment(move_fwd_n, wait_n, collision, leavePotential);
391  return false;
392  }
393  }
394 
395  return false;
396 }
397 
398 void AvoidanceResolution::avoidStart(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
399 {
400  //If we are not on Start we cant use this strategy :D
401  //If we have allready used the avoid strategy we will not use it again
402  //(caused due to multiple backtracking attemps)
403  if (_current.predecessor_ != NULL)
404  return;
405 
406  //Return if potential is blocked forever
407  if (_freePotential < 0)
408  return;
409 
410  //Select the side of the vertex which not contains _next to move avoid from the colliding robot
411  bool foundPredecessorVertex = false;
412  std::vector<std::reference_wrapper<Vertex>> crossing = _current.getPlanningPredecessors();
413 
414  for (const Vertex &v : crossing)
415  {
416  if (v.getSegment().getSegmentId() == _next.getSegment().getSegmentId())
417  {
418  crossing = _current.getPlanningSuccessors();
419  foundPredecessorVertex = true;
420  break;
421  }
422  }
423 
424  //Take care to only use avoid start once (else computation time issue if there are multiple backtracking attemps)
425  if ((!foundPredecessorVertex && !avoidStartPredecessorDone_) || (foundPredecessorVertex && !avoidStartSuccessorDone_))
426  {
427  if (!foundPredecessorVertex)
429  else
431 
432  for (const Vertex &waitSeg : crossing)
433  {
434  int32_t collision = -1;
435  float waitTime = std::max<float>(_freePotential + 2 * timeoverlap_, pCalc_->CalculatePotential(_current) + pCalc_->CalculatePotential(waitSeg) + timeoverlap_);
436  bool vertexIsFree = route_querry_->checkSegment(waitSeg, pCalc_->CalculatePotential(_current) - timeoverlap_, waitTime, robotDiameter_, collision);
437 
438  if (vertexIsFree || collision != -1)
439  {
440  //We need one Vertex for moving forward (current), one for waiting (waitSeg) and one for moving backward (current).
441  //(We have to copy all three Vertex because every Vertex in the crossing is considered (backtracking...))
442 
443  //Copy Vertex used for moving away
444  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_current));
445  Vertex &move_fwd_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
446  move_fwd_n.potential = pCalc_->CalculatePotential(move_fwd_n);
447  move_fwd_n.isWaitSegment = false;
448  move_fwd_n.collision = -1;
449 
450  //Copy the Vertex for waiting
451  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(waitSeg));
452  Vertex &wait_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
453  wait_n.potential = waitTime;
454  wait_n.isWaitSegment = true;
455  wait_n.collision = -1;
456 
457  //Copy Vertex used for moving back
458  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_current));
459  Vertex &move_bwd_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
460  move_bwd_n.potential = -1;
461  move_bwd_n.isWaitSegment = false;
462  move_bwd_n.collision = -1;
463 
464  move_fwd_n.successor_ = &wait_n;
465  move_fwd_n.predecessor_ = NULL; //We are on start
466 
467  wait_n.successor_ = &move_bwd_n;
468  wait_n.predecessor_ = &move_fwd_n;
469 
470  move_bwd_n.predecessor_ = &wait_n;
471  move_bwd_n.successor_ = _next.successor_;
472 
473  if (vertexIsFree)
474  {
475  foundSolutions_.push_back(wait_n);
476  }
477  else if (collision != -1)
478  {
479  if (collision != _collision)
480  addCollision(collision);
481 
482  float leavePotential = route_querry_->findPotentialUntilRobotOnSegment(collision, wait_n.getSegment().getSegmentId());
483  moveSegment(move_fwd_n, wait_n, robotDiameter_, leavePotential);
484  }
485  }
486  }
487  }
488 }
489 
490 void AvoidanceResolution::avoidGoal(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
491 {
492  //_next is goal Segment
493  //_current tells us the direction
494 
495  //Return if potential is blocked forever
496  if (_freePotential < 0)
497  return;
498 
499  //If we are not on Goal we cant use this strategy :D
500  if (_next.getSegment().getSegmentId() != route_querry_->getEnd())
501  return;
502 
503  //Select the side of the vertex which not contains _current to move avoid from the colliding robot
504  std::vector<std::reference_wrapper<Vertex>> crossing = _next.getPlanningPredecessors();
505 
506  for (const Vertex &v : crossing)
507  {
508  if (v.getSegment().getSegmentId() == _current.getSegment().getSegmentId())
509  {
510  crossing = _current.getPlanningSuccessors();
511  break;
512  }
513  }
514 
515  //Check if we can move through goal
516  int32_t collision = -1;
517 
518  if (route_querry_->checkSegment(_next, _current.potential - timeoverlap_, _current.potential + pCalc_->CalculatePotential(_next), robotDiameter_, collision, true))
519  {
520  for (const Vertex &waitSeg : crossing)
521  {
522  int32_t collision = -1;
523  float waitTime = std::max<float>(_freePotential + 2 * timeoverlap_, _current.potential + pCalc_->CalculatePotential(_next) + pCalc_->CalculatePotential(waitSeg) + 2 * timeoverlap_);
524  bool vertexIsFree = route_querry_->checkSegment(waitSeg, _current.potential + pCalc_->CalculatePotential(_next) - timeoverlap_, waitTime, robotDiameter_, collision);
525 
526  if (vertexIsFree || collision != -1)
527  {
528  //We need one Vertex for moving forward (current), one for waiting (waitSeg) and one for moving backward (current).
529  //(We have to copy all three Vertex because every Vertex in the crossing is considered (backtracking...))
530 
531  //Copy Vertex used for moving away
532  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_next));
533  Vertex &move_fwd_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
534  move_fwd_n.potential = _current.potential + pCalc_->CalculatePotential(move_fwd_n);
535  move_fwd_n.isWaitSegment = false;
536  move_fwd_n.collision = -1;
537 
538  //Copy the Vertex for waiting
539  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(waitSeg));
540  Vertex &wait_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
541  wait_n.potential = waitTime;
542  wait_n.isWaitSegment = true;
543  wait_n.collision = -1;
544 
545  //Copy Vertex used for moving back
546  generatedSubgraphs_[resolutionAttemp_].emplace_back(std::make_unique<Vertex>(_next));
547  Vertex &move_bwd_n = *(generatedSubgraphs_[resolutionAttemp_].back().get());
548  move_bwd_n.potential = -1;
549  move_bwd_n.isWaitSegment = false;
550  move_bwd_n.collision = -1;
551 
552  move_fwd_n.successor_ = &wait_n;
553  move_fwd_n.predecessor_ = &_current;
554 
555  wait_n.successor_ = &move_bwd_n;
556  wait_n.predecessor_ = &move_fwd_n;
557 
558  move_bwd_n.predecessor_ = &wait_n;
559  move_bwd_n.successor_ = NULL; //We are on the goal vertex
560 
561  if (vertexIsFree)
562  {
563  foundSolutions_.push_back(wait_n);
564  }
565  else if (collision != -1)
566  {
567  if (collision != _collision)
568  addCollision(collision);
569 
570  float leavePotential = route_querry_->findPotentialUntilRobotOnSegment(collision, wait_n.getSegment().getSegmentId());
571  moveSegment(move_fwd_n, wait_n, robotDiameter_, leavePotential);
572  }
573  }
574  }
575  }
576  else if (collision != -1)
577  {
578  if (collision != _collision)
579  addCollision(collision);
580  }
581 }
582 } // namespace multi_robot_router
uint32_t getSegmentId() const
Definition: srr_utils.cpp:60
const std::vector< uint32_t > & getRobotCollisions() const
returns amount of robot collisions found in each resolve try after resetSession
std::vector< std::reference_wrapper< Vertex > > foundSolutions_
#define TIMEOVERLAP
void resetSession(const RouteCoordinatorWrapper *_route_querry, const PotentialCalculator *_pCalc, const uint32_t _robot_radius)
resets the session (setting the new route querry and potential calculator)
const std::vector< std::reference_wrapper< Vertex > > & getPlanningPredecessors() const
Definition: srr_utils.cpp:93
bool checkSegment(const Vertex &_next, const uint32_t _startTime, const int32_t _endTime, const uint32_t _diameterPixel, int32_t &_collisionRobot, bool _ignoreGoal=false) const
calls checkSegment of the routeCoordinator using robot
const std::vector< std::reference_wrapper< Vertex > > & getPlanningSuccessors() const
Definition: srr_utils.cpp:98
void avoidStart(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
float CalculatePotential(const Vertex &_vertex) const
calculates the potential for a vertex
const uint32_t getEnd() const
calls getEnd of the routeCoordinator using robot
const RouteCoordinatorWrapper * route_querry_
void saveCollision(const uint32_t _coll)
increases the collision count of one robot
int32_t findPotentialUntilRobotOnSegment(const uint32_t _robot, const uint32_t _segId) const
calls findPotentialUntilRobotOnSegment of the routeCoordinator using robot
void avoidGoal(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
bool expandSegment(const Vertex &cSeg, Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
void moveSegment(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
const Segment & getSegment() const
Definition: srr_utils.cpp:88
std::vector< std::vector< std::unique_ptr< Vertex > > > generatedSubgraphs_
std::vector< std::reference_wrapper< Vertex > > resolve(Vertex &_current, Vertex &_next, int32_t _collision)
resolves a found collision between two robots.
void avoid(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)
std::queue< Index > q
void trackBack(Vertex &_current, Vertex &_next, const int32_t _collision, const float _freePotential)


tuw_multi_robot_router
Author(s): Benjamin Binder
autogenerated on Mon Jun 10 2019 15:42:48