multi_robot_router.h
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 
29 #ifndef MRR_H
30 #define MRR_H
31 
40 
41 //TODO replan
42 namespace multi_robot_router
43 {
48 {
49  public:
55  MultiRobotRouter(const uint32_t _nr_robots, const std::vector<uint32_t> &_robotDiameter);
60  MultiRobotRouter(const uint32_t _nr_robots);
65  virtual void setRobotNr(const uint32_t _nr_robots);
70  virtual void setRobotDiameter(const std::vector<uint32_t> &_diameter);
80  virtual bool getRoutingTable(const std::vector<Segment> &_graph, const std::vector<uint32_t> &_startSegments, const std::vector<uint32_t> &_goalSegments, std::vector<std::vector<Checkpoint>> &_routingTable, const float &_timeLimit);
85  virtual const uint32_t getPriorityScheduleAttempts() const;
90  virtual const uint32_t getSpeedScheduleAttempts() const;
99  virtual void setPriorityRescheduling(const bool _status);
103  virtual void setSpeedRescheduling(const bool _status);
104 
105  private:
106  void resetAttempt(const std::vector<Segment> &_graph);
107  // attemps to find a routing table according to a given priority and speed schedule
108  bool planPaths(const std::vector<uint32_t> &_priorityList, const std::vector<float> &_speedList, const std::vector<uint32_t> &_startSegments, const std::vector<uint32_t> &_goalSegments, const uint32_t _firstSchedule, std::vector<std::vector<RouteVertex>> &_routeCandidates, uint32_t &_robot);
109 
114  bool useSpeedRescheduler_ = true;
116 
117  uint32_t nr_robots_;
118  uint32_t min_diameter_;
119  std::vector<uint32_t> robotDiameter_;
120  std::vector<std::vector<uint32_t>> robotCollisions_;
126 };
127 } // namespace multi_robot_router
128 #endif
standard multi robot router without multi threading (Works best in practice)
virtual const uint32_t getPriorityScheduleAttempts() const
returns the number of attemps to reschedul the priorities taken
bool planPaths(const std::vector< uint32_t > &_priorityList, const std::vector< float > &_speedList, const std::vector< uint32_t > &_startSegments, const std::vector< uint32_t > &_goalSegments, const uint32_t _firstSchedule, std::vector< std::vector< RouteVertex >> &_routeCandidates, uint32_t &_robot)
MultiRobotRouter(const uint32_t _nr_robots, const std::vector< uint32_t > &_robotDiameter)
constructor
virtual void setSpeedRescheduling(const bool _status)
enables or disables speed rescheduling
virtual void setCollisionResolver(const SegmentExpander::CollisionResolverType cRes)
sets the CollisionResolverType used to resolve occured robot collisions
SegmentExpander::CollisionResolverType cResType_
std::vector< std::vector< uint32_t > > robotCollisions_
virtual void setRobotDiameter(const std::vector< uint32_t > &_diameter)
sets the robot diameter for every robot
void resetAttempt(const std::vector< Segment > &_graph)
virtual bool getRoutingTable(const std::vector< Segment > &_graph, const std::vector< uint32_t > &_startSegments, const std::vector< uint32_t > &_goalSegments, std::vector< std::vector< Checkpoint >> &_routingTable, const float &_timeLimit)
computes the routing table according to the given start and goal _goalSegments
virtual void setPriorityRescheduling(const bool _status)
enables or disables priority rescheduling
virtual const uint32_t getSpeedScheduleAttempts() const
returns the number of attemps to limit the maximum speed of a robot taken
virtual void setRobotNr(const uint32_t _nr_robots)
sets the number of robots used


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