multi_robot_router_threaded_srr.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_THREADED_SRR_H
30 #define MRR_THREADED_SRR_H
31 
40 
41 namespace multi_robot_router
42 {
44 {
45  public:
51  MultiRobotRouterThreadedSrr(const uint32_t _nr_robots, const std::vector<uint32_t> &_robotDiameter, const uint32_t _threads);
56  MultiRobotRouterThreadedSrr(const uint32_t _nr_robots, const uint32_t _threads);
61  virtual void setRobotNr(const uint32_t _nr_robots);
66  virtual void setThreads(const uint32_t _threads);
71  virtual void setRobotDiameter(const std::vector<uint32_t> &_diameter);
81  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);
86  virtual const uint32_t getPriorityScheduleAttempts() const;
91  virtual const uint32_t getSpeedScheduleAttempts() const;
100  virtual void setPriorityRescheduling(const bool _status);
104  virtual void setSpeedRescheduling(const bool _status);
105 
106  private:
107  void resetAttempt(const std::vector<Segment> &_graph);
108  // attemps to find a routing table according to a given priority and speed schedule
109  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);
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_;
125  uint32_t threads_ = 10;
126  std::vector<SingleRobotRouter> srr;
127 };
128 } // namespace multi_robot_router
129 #endif
MultiRobotRouterThreadedSrr(const uint32_t _nr_robots, const std::vector< uint32_t > &_robotDiameter, const uint32_t _threads)
constructor
standard multi robot router without multi threading (Works best in practice)
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)
virtual void setRobotDiameter(const std::vector< uint32_t > &_diameter)
sets the robot diameter for every robot
virtual void setThreads(const uint32_t _threads)
sets the number of threads
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 setCollisionResolver(const SegmentExpander::CollisionResolverType cRes)
sets the CollisionResolverType used to resolve occured robot collisions
virtual void setRobotNr(const uint32_t _nr_robots)
sets the number of robots used
virtual const uint32_t getPriorityScheduleAttempts() const
returns the number of attemps to reschedul the priorities taken
virtual void setSpeedRescheduling(const bool _status)
enables or disables speed rescheduling
virtual const uint32_t getSpeedScheduleAttempts() const
returns the number of attemps to limit the maximum speed of a robot taken
void resetAttempt(const std::vector< Segment > &_graph)
virtual void setPriorityRescheduling(const bool _status)
enables or disables priority rescheduling


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