Multi-AGV scheduling device and fusion method of global planning and local planning thereof
Technical Field
The invention belongs to the field of AGV, and particularly relates to a multi-AGV scheduling device and a fusion method of global planning and local planning thereof.
Background
The global planning of multiple AGVs refers to the driving paths, states and the like of other AGVs when the current AGV plans the path, and considers global indexes such as path balance, total task completion time and the like. Common global planning methods include a single-item graph method, a traffic method and the like.
The one-way graph method simplifies the driving model of the AGV by specifying a single driving direction of a route, the possible driving path in the map is single, the conflict is only possible to occur at the intersection, and the design of a conflict avoiding strategy is convenient. However, since the allowed passing directions of all the paths are defined, the problem of detour is easily caused, and the path cost of task execution is high.
The traffic law is mainly used for the problem of crossing resource allocation, and collision is caused by a plurality of objects occupying one route simultaneously. Thus, each collision can be avoided by taking appropriate measures for all the intersections in the relevant environment. By enumerating overlapping routes: along the routes and intersections in opposite directions, the same direction, traffic rules are constructed that accommodate all of these overlapping routes to avoid collisions. Common treatment methods are: intersection waiting, path reselection, etc. Although the traffic law can effectively solve the conflict and reduce the accident rate, the traffic law is more strategy processing when the conflict is about to occur, and when the number of the AGVs is large and the traffic jam is serious, the system is easy to be paralyzed.
The global planning algorithm considers global optimality, can reduce the processing time of tasks to a certain extent, and avoids the problems of deadlock, collision and the like of the system. However, the time complexity of the global planning algorithm increases exponentially with the increase of the AGVs, the response time is long, the real-time performance is low, and the dynamic scenes of the AGVs are difficult to process.
The Dijkstra algorithm expands adjacent nodes outwards in a divergent mode with a starting point as a center, takes the cumulative cost of a search path as a heuristic method, and preferentially expands the node with the minimum cumulative cost of the path. The algorithm A is an algorithm which can be obtained by combining a admissible heuristic method with a branch and bound method and an expansion list tool, estimates the lower bound of the residual path cost of the expansion node while considering the accumulated path cost, avoids the search from going towards the opposite direction, and avoids the repeated expansion by accessing the expansion list.
The local planning of AGV only considers the path planning of current AGV, and the time complexity can not rise along with AGV quantity, keeps in can calculating the within range, and response time is short, and the real-time is high, can very benefit the dynamic scene of dealing with AGV moreover. However, since the AGVs only consider local optimality in path planning, when the number of AGVs increases, problems such as deadlock and collision frequently occur.
Disclosure of Invention
The invention provides a multi-AGV scheduling device and a fusion method of global planning and local planning thereof, which are used for solving the problems and can flexibly deal with different scenes.
The invention is realized by the following technical scheme:
a multi-AGV scheduling device comprises an application layer, an AGVTroop framework, an ROS layer and a plurality of AGVs, wherein the application layer provides an interface for developers to use the AGVTroop framework;
the AGVTroop framework completes task allocation and path planning according to the issued tasks, the map information and the AGV information;
the ROS layer builds a communication frame, controls bottom layer equipment and combines a software package provided by the ROS and laser information of the AGV to realize positioning of the AGV.
Further, the communication framework realizes communication between the AGVCluster and the AGV;
the bottom equipment is an actual AGV.
A method for fusing global planning and local planning of multiple AGV scheduling devices comprises the following specific steps:
step 1: reading information of the global planner based on the improved A-algorithm, namely time window information;
step 2: the local planner carries out local path planning by referring to the global route according to the local information and outputs a speed instruction to the time window information;
and 3, step 3: judging whether the local planning time exceeds a threshold value, if so, returning to the global planner in the step 1, and if not, performing the step 4;
and 4, step 4: and (4) judging whether the track with the highest score is less than 0, if so, returning to the global planner in the step (1), and if so, outputting a speed instruction.
Further, the reference index in the global planner includes all task completion time and path balance;
the reference indicators within the local planner include a deviation from a global route value, a directional cost, and an obstacle cost.
Further, the global planning method in the global planner in step 1 specifically includes the following steps:
step Q1: receiving a task to be executed, if the task to be executed is empty, ending the process, and if the task to be executed is not empty, entering a step Q2;
and step Q2: constructing a direction time window and an occupied time window for each node of each grid map;
and step Q3: calling an improved A-algorithm to perform global planning by using the directional time window and the occupied time window constructed in the step Q2;
and step Q4: updating the direction time window and the occupied time window of the nodes on the path by using the global planning of the step Q3;
step Q5: judging whether a node direction conflict exists according to the step Q4, if so, performing the steps Q6 and Q7, and if not, performing the step Q8;
step Q6: calculating the waiting time cost;
step Q7: replanning the path;
step Q8: judging whether the occupied time window conflict of the nodes exists according to the step Q4, if so, performing a step Q6, and if not, performing a step Q9;
step Q9: issuing the path to a corresponding AGV;
step Q10: judging whether the waiting time cost is greater than the re-planning time or not according to the step Q6 and the step Q7, if so, performing a step Q11, and if not, performing a step Q12;
step Q11: updating the global path and issuing the path to the corresponding AGV;
step Q12: waiting in place and issuing the path to the corresponding AGV.
Further, the local planning method specifically includes the following steps:
step J1: acquiring a global planning route;
step J2: reading laser radar data based on the global planning route of the step J1 to obtain local information;
step J3: sampling a plurality of sets of velocities in a velocity space (v, w) based on the local information of step J2;
step J4: simulating the track of the multi-group sampling speed in the step J3 within 0.01s-0.10 s;
step J5: scoring the trajectory of step J4;
step J6: judging whether the score in the step J5 is larger than a threshold value, namely whether a feasible path exists, if so, entering a step J7, and if not, entering a step J8;
step J7: executing according to the track with the highest score;
step J8: correcting a direction time window, an occupied time window and a use frequency of a node on a track;
step J9: and D, dynamically adjusting the globally planned route based on the information corrected in the step J8.
The invention has the beneficial effects that:
in order to ensure the global optimality of the AGV planning, improve the real-time performance of the system and the capability of processing dynamic scenes, the invention adopts a method of fusing global planning and local planning. Firstly, a route with global optimality is planned according to global indexes based on an improved A-x algorithm, and a local planner dynamically adjusts the global route according to local information and designated strategies and indexes.
In order to enable the framework to flexibly cope with different scenes, the system provides an extensible platform to support different optimization rules as plug-ins. The system supports various optimization models, developers can customize performance indexes of new task scheduling or path gauges, and the newly added indexes are used as plug-ins. And the AGVTroop framework needs to realize self-optimization, and adjusts the allocation scheduling strategy and the path planning of the AGV according to the newly added index. And selects the best weighted combination for these performance indicators by replaying the historical data.
The invention provides a fine-grained interface, supports action-level scheduling, enables developers to program in a task-oriented manner, only needs to define and distribute tasks and task groups, does not need to care about how to execute the tasks, and simplifies the AGV application development.
Drawings
FIG. 1 is a schematic diagram of the overall architecture of the present invention.
Fig. 2 is a schematic diagram of the application layer of the present invention.
FIG. 3 is a schematic diagram of an AGVTroop layer of the present invention.
FIG. 4 is a schematic representation of the ROS layer of the present invention.
Fig. 5 is a flow chart of the fusion of global planning and local planning of the present invention.
FIG. 6 is a flow chart of the global path planning of the present invention.
Fig. 7 is a flow chart of the local path planning of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be described clearly and completely with reference to the accompanying drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be obtained by a person skilled in the art without making any creative effort based on the embodiments in the present invention, belong to the protection scope of the present invention.
A multi-AGV scheduling device comprises an application layer, an AGVTroop framework, an ROS layer and a plurality of AGVs, wherein the application layer provides an interface for developers to use the AGVTroop framework; developers only need to release tasks according to application scenes, and do not need to care about how the tasks are executed and give the tasks to AGV for execution;
the AGVTroop framework completes task allocation and path planning according to the issued tasks, the map information and the AGV information;
the ROS layer builds a communication frame, controls bottom layer equipment and combines a software package provided by the ROS and laser information of the AGV to realize positioning of the AGV.
Further, the communication framework realizes communication between the AGVCluster and the AGV;
the bottom layer equipment is an actual AGV; and relative to the AGVCluster, the AGVCluster schedules towards the virtual AGV, and the ROS finishes the binding of the virtual AGV and the actual AGV and controls the bottom-layer equipment.
A method for fusing global planning and local planning of multiple AGV scheduling devices comprises the following specific steps:
step 1: reading information of the global planner based on the improved A-algorithm, namely time window information;
step 2: the local planner carries out local path planning by referring to the global route according to the local information and outputs a speed instruction to the time window information;
and 3, step 3: judging whether the local planning time exceeds a threshold value, if so, returning to the global planner in the step 1, and if not, performing the step 4;
and 4, step 4: and (4) judging whether the track with the highest score is less than 0, if so, returning to the global planner in the step (1), and if so, outputting a speed instruction.
Further, the reference indexes in the global planner include all task completion times and path balance;
the reference indicators within the local planner include deviation from a global route value, directional costs, and obstacle costs.
Further, the global planning method in the global planner in step 1 specifically includes the following steps:
step Q1: receiving a task to be executed, if the task to be executed is empty, ending the process, and if the task to be executed is not empty, entering a step Q2;
step Q2: constructing a direction time window and an occupied time window for each node of each grid map;
and step Q3: calling an improved A-algorithm to perform global planning by using the directional time window and the occupied time window constructed in the step Q2;
step Q4: updating the direction time window and the occupied time window of the nodes on the path by using the global planning of the step Q3;
and step Q5: judging whether the node direction conflict exists according to the step Q4, if so, performing the steps Q6 and Q7, and if not, performing the step Q8;
step Q6: calculating the waiting time cost;
step Q7: replanning the path;
step Q8: judging whether the occupied time window conflict of the nodes exists according to the step Q4, if so, performing a step Q6, and if not, performing a step Q9;
step Q9: issuing the path to a corresponding AGV;
step Q10: judging whether the waiting time cost is greater than the re-planning time or not according to the step Q6 and the step Q7, if so, performing a step Q11, and if not, performing a step Q12;
step Q11: updating the global path and issuing the path to the corresponding AGV;
step Q12: waiting in place and issuing the path to the corresponding AGV.
Further, the local planning method specifically includes the following steps:
step J1: acquiring a global planning route;
step J2: reading laser radar data based on the global planning route of the step J1 to obtain local information;
step J3: sampling a plurality of sets of velocities in a velocity space (v, w) based on the local information of step J2;
step J4: simulating the track of the multi-group sampling speed in the step J3 within a certain short time (the default value is 0.05 s);
step J5: scoring the trajectory of step J4;
step J6: judging whether the score in the step J5 is larger than a threshold value, namely whether a feasible path exists, if so, entering a step J7, and if not, entering a step J8;
step J7: executing according to the track with the highest score;
step J8: correcting a direction time window, an occupied time window and a use frequency of a node on a track;
step J9: and dynamically adjusting the globally planned route based on the information corrected in the step J8.
Further, the improved a-x algorithm is specifically that global information is added when a path computation node n is searched, and a computation formula f (n) is:
f(n)=g(n)+h(n)+α*Math.min(time_threshold,cur_time-last_time)+β*frequency[n]+δ*steering_correction
wherein g (n) is the cost from the starting node to node n; h (n): an estimated cost of the best path from node n to the target node; time _ threshold is the maximum time threshold; cur _ time: the time node n is currently in use; last _ time: point n last time usage; frequency [ n ]: the frequency of use of the node n; step _ correction: correcting steering; alpha, beta and delta are respectively time weight, frequency weight and steering weight;
the path planning of the invention adopts a mode of integrating global planning and local planning, a route with global optimality can be planned according to a series of global indexes (all task completion time, path balance and the like) based on an improved A-x algorithm, and a local planner can dynamically adjust the global route according to local information. (the reference index comprises deviation values from the global route, directional cost, obstacle cost and other adjustment strategies comprise route adjustment, quiet waiting, re-planning and the like).
The invention provides a fine-grained interface, supports action-level scheduling, enables developers to program in a task-oriented manner, only needs to define and distribute tasks, task groups and tasks, does not need to care about how to execute the tasks, and simplifies the AGV application development. The ROS provides various types of hardware abstractions and drivers, so that the system can be programmed facing the virtual AGV according to the difference of the bottom AGV.
In order to make the framework flexibly cope with different scenes, the system provides an extensible platform to support different optimization rules as plug-ins. The system supports various optimization models, developers can customize performance indexes of new task scheduling or path gauges, and the newly added indexes are used as plug-ins. And the AGVTroop framework needs to realize self-optimization, and adjusts the allocation scheduling strategy and the path planning of the AGV according to the newly added index. And selects the best weighted combination for these performance indicators.
And the global path planning adopts an A-algorithm for improving the multi-AGV path planning based on the time window, and a direction time window and an occupied time window are constructed for each node of the grid map. And calculating a global path based on an A-algorithm, and calculating an occupied time window and a direction time window of each node on the path according to the hardware information of the AGV. The algorithm A needs to plan a path according to time window information, three factors (1) are considered to be accessible, and according to the current time window information, a certain node cannot exist on the constructed path to cause the direction or occupied time to have conflict. (2) The collision is avoided, the occupied frequency of the nodes in the arrival time is considered during path planning, the imbalance of the paths (namely, a certain channel has a plurality of AGV accesses, and other channels are idle) is avoided as much as possible (3), the change of the traveling direction is avoided as much as possible during path planning, the energy consumption of the AGV can be increased seriously due to frequent turning, the abrasion of hardware is aggravated, and the AGV conflict is easily caused. And finally, issuing the global route to a local planner for adjustment. (4) Time cost, the time required to complete all tasks.
Local path planning is mainly used for dynamically adjusting a globally planned route. Global planning, while taking into account global optima, does not handle dynamic scenarios well (e.g., new obstacles not on the map, hardware failures, and dynamic objects such as people). The local path planning fine-tunes the global route according to the local information scanned by the lidar. The local path planning adopts DWA dynamic window algorithm. Sampling a plurality of groups of speeds in a speed space (v, w) (the speeds can be controlled within a certain range according to the self limit of the trolley and the environmental limit when the speeds are sampled), simulating the tracks of the trolley within a certain time at the speeds, evaluating the tracks after obtaining a plurality of groups of tracks, and selecting the speed group corresponding to the optimal track to drive the robot to move. The scoring function is the cost weighted sum of the following.
(1) And (4) oscillating cost, namely switching the walking direction for multiple times in a short time if the walking direction is oscillated.
(2) Obstacle cost, distance to an obstacle on a trajectory.
(3) Path cost, and global path deviation value.
(4) The goal cost, the direction is not to travel towards the goal.
(5) And (4) carrying out penalty on backward paths by reverse cost.