route_coordinator.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 ROUTE_COORDINATOR_H
30 #define ROUTE_COORDINATOR_H
31 
33 #include <memory>
34 #include <vector>
36 
37 namespace multi_robot_router
38 {
40 {
41  public:
47  virtual void reset(const std::vector<Segment> &_graph, const uint32_t _nrRobots) = 0;
59  virtual bool addRoute(const std::vector<RouteVertex> &_path, const uint32_t _diameterPixel, const uint32_t _robotId) = 0;
65  virtual bool checkSegment(const Vertex &_next, const uint32_t _startTime, const int32_t _endTime, const uint32_t _diameterPixel, int32_t &_collisionRobot, const uint32_t _robotId, bool _ignoreGoal = false) const = 0;
71  virtual bool setGoalSegments(const std::vector<uint32_t> &_goalSegments) = 0;
77  virtual bool setStartSegments(const std::vector<uint32_t> &_startSegments) = 0;
84  virtual bool isGoal(const Vertex &_seg, const uint32_t _robotId) const = 0;
88  virtual const uint32_t getStart(const uint32_t _robotId) const = 0;
92  virtual const uint32_t getEnd(const uint32_t _robotId) const = 0;
100  virtual std::vector<std::pair<uint32_t, float>> getListOfRobotsHigherPrioritizedRobots(const uint32_t _robot, const uint32_t _segId, const int32_t _potential) const = 0;
105  virtual void removeRobot(const uint32_t _robot) = 0;
112  virtual int32_t findSegNr(const uint32_t _robot, const uint32_t _potential) const = 0;
119  virtual int32_t findPotentialUntilRobotOnSegment(const uint32_t _robot, const uint32_t _segId) const = 0;
120 };
121 
123 {
124  public:
129  RouteCoordinatorWrapper(const uint32_t _robot, const RouteCoordinator &_routeCoordinater);
133  bool checkSegment(const Vertex &_next, const uint32_t _startTime, const int32_t _endTime, const uint32_t _diameterPixel, int32_t &_collisionRobot, bool _ignoreGoal = false) const;
137  bool isGoal(const Vertex &_seg) const;
141  const uint32_t getStart() const;
145  const uint32_t getEnd() const;
149  std::vector<std::pair<uint32_t, float>> getListOfRobotsHigherPrioritizedRobots(const uint32_t _robot, const uint32_t _segId, const int32_t _potential) const;
153  int32_t findSegNr(const uint32_t _robot, const uint32_t _potential) const;
157  int32_t findPotentialUntilRobotOnSegment(const uint32_t _robot, const uint32_t _segId) const;
158 
159  private:
160  uint32_t robot_;
162 };
163 } // namespace multi_robot_router
164 #endif // PATH_QUERRY_H
virtual int32_t findSegNr(const uint32_t _robot, const uint32_t _potential) const =0
returns the segment id at which the robot is at timepoint _potential
virtual void removeRobot(const uint32_t _robot)=0
removes a Robot from the Routing Table
virtual bool setGoalSegments(const std::vector< uint32_t > &_goalSegments)=0
updates the goal segments of the planning attempt
virtual bool addRoute(const std::vector< RouteVertex > &_path, const uint32_t _diameterPixel, const uint32_t _robotId)=0
checks if a robot can enter a segment at a specific time
virtual bool setStartSegments(const std::vector< uint32_t > &_startSegments)=0
updates the start segments of the planning attempt
virtual int32_t findPotentialUntilRobotOnSegment(const uint32_t _robot, const uint32_t _segId) const =0
returns the time point, when a robot leaves a vertex
virtual const uint32_t getStart(const uint32_t _robotId) const =0
returns the start of a robot
virtual const uint32_t getEnd(const uint32_t _robotId) const =0
returns the Goal of a robot
virtual void reset(const std::vector< Segment > &_graph, const uint32_t _nrRobots)=0
resets the planning session of multiple robots
virtual std::vector< std::pair< uint32_t, float > > getListOfRobotsHigherPrioritizedRobots(const uint32_t _robot, const uint32_t _segId, const int32_t _potential) const =0
returns all robots which pass the segment before the given robot and a given time ...
virtual bool isGoal(const Vertex &_seg, const uint32_t _robotId) const =0
returns if a Vertex is the goal vertex for a robot
virtual bool checkSegment(const Vertex &_next, const uint32_t _startTime, const int32_t _endTime, const uint32_t _diameterPixel, int32_t &_collisionRobot, const uint32_t _robotId, bool _ignoreGoal=false) const =0
updates the goal segments of the planning attempt


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