Unmanned aerial vehicle control path optimization method

文档序号:1951855 发布日期:2021-12-10 浏览:23次 中文

阅读说明:本技术 一种无人机控制路径优化方法 (Unmanned aerial vehicle control path optimization method ) 是由 樊宽刚 孙文 雷爽 谭文刚 于 2021-09-26 设计创作,主要内容包括:本申请提供了一种无人机控制路径优化方法,其中,无人机控制路径优化方法包括:根据实际飞行任务获取无人机飞行途中需经过的路径节点及数量,并对由这些路径节点构成的路径进行实数编码产生随机路径;计算实数编码后的随机路径的适应度值,根据遗传算法思想,利用适应度值选择目标路径;获取无人机按照目标路径飞行时的障碍环境数据;基于障碍环境数据通过VFH避障策略确定目标方向;根据目标路径和目标方向确定无人机的实际飞行路径。本申请基于遗传算法结合VFH避障策略的路径优化方法并将此方法应用于所提出的无人机系统,达到使此无人机系统能够按照该路径优化方法实现在室内外复杂环境下进行最优路径规划的技术效果。(The application provides an unmanned aerial vehicle control path optimization method, wherein the unmanned aerial vehicle control path optimization method comprises the following steps: acquiring path nodes and the number of the path nodes which need to pass by the unmanned aerial vehicle in the flying process according to the actual flying task, and carrying out real number coding on the path formed by the path nodes to generate a random path; calculating the fitness value of the random path after real number encoding, and selecting a target path by using the fitness value according to the thought of a genetic algorithm; acquiring obstacle environment data of the unmanned aerial vehicle flying according to a target path; determining a target direction through a VFH obstacle avoidance strategy based on obstacle environment data; and determining the actual flight path of the unmanned aerial vehicle according to the target path and the target direction. The method is based on a path optimization method combining a genetic algorithm with a VFH obstacle avoidance strategy and applied to the provided unmanned aerial vehicle system, and the technical effect that the unmanned aerial vehicle system can plan the optimal path in indoor and outdoor complex environments according to the path optimization method is achieved.)

1. An unmanned aerial vehicle control path optimization method is characterized by comprising the following steps:

acquiring path nodes and the number of the path nodes which need to pass by the unmanned aerial vehicle in the flying process, and randomly arranging the path nodes to generate a random path;

calculating the fitness value of the random path, and selecting a target path according to the fitness value;

acquiring obstacle environment data of the unmanned aerial vehicle flying according to the target path;

taking the actual flight position of the unmanned aerial vehicle as a central point, generating a movable window according to the obstacle environment data, dividing the movable window into a plurality of continuous two-dimensional grids, and acquiring an obstacle probability value of each two-dimensional grid;

determining a grid vector of the two-dimensional grid corresponding to the obstacle probability value according to the obstacle probability value; the grid vector comprises a grid vector value and a grid vector angle;

dividing the active window into regions, and calculating the regional obstacle density of the regions according to the grid vector values of the grid vectors in the regions;

determining a target area according to the area obstacle density;

determining a target direction according to the target area;

and flying according to the target path, and when encountering an obstacle, avoiding according to the target direction, so as to determine the actual flight path of the unmanned aerial vehicle.

2. The drone-controlled path optimization method of claim 1, wherein the calculating a fitness value for the random path, selecting a target path based on the fitness value, comprises:

determining sequence numbers of the path nodes constituting the random path;

carrying out real number coding on the random path according to the serial number;

calculating the reciprocal of the node distance and the value of the adjacent path in the random path after the real number coding, recording the reciprocal as a first sum value, and determining the first sum value as the fitness value of the random path;

selecting the random path with the minimum fitness value as a target random path;

judging whether the iteration times at the moment are equal to an iteration time threshold value or not;

and if the iteration times are equal to the iteration time threshold, determining the target random path as a target path.

3. The method of claim 2, wherein after determining whether the number of iterations at the time is equal to an iteration threshold, the method further comprises:

determining the random path as a first path, if the iteration times are not equal to an iteration time threshold, summing the fitness values of the first path to obtain a second sum, calculating a ratio of the fitness value of the first path to the second sum, and determining the ratio as the fitness probability of the first path;

according to the fitness probability, carrying out multiple rounds of selection on a random path in the first path by a roulette method, and generating a second path by single-point crossing and reverse mutation operations on the selected random path;

calculating the fitness value of the second path, selecting the target path according to the fitness value, adding one to the iteration times, taking the second path as the first path, judging whether the iteration times at the moment is equal to an iteration time threshold value, and ending the loop if the judgment condition is met.

4. The method of claim 3, wherein the performing multiple rounds of selection of the random path from the first path by roulette based on the fitness probability, and generating the second path by a single-point crossing and inverse mutation operation on the selected random path comprises:

constructing a fitness probability wheel disc according to the fitness probability of the first path, wherein the wheel disc interval is formed by accumulating the fitness probabilities of all random paths of the first path;

randomly generating a first random number, wherein the size of the first random number determines the selection of a random path in the second paths;

randomly generating a second random number, and judging whether the second random number is greater than a preset cross probability;

if the second random number is larger than the preset cross probability, pairwise pairing the random paths in the first path to form a path pair, and randomly selecting a cross point of the path pair;

randomly selecting one of the random paths in a path pair to be determined as a first parent path, determining the other random path in the path pair to be a second parent path, copying a first bit code of the first parent path to a previous bit code of the intersection point, and encoding a part of the copied first parent path as a first front part path; scanning from the first code of the second parent path, if the code in the second parent path does not appear in the code of the first front part path, adding the code to the first front part path until the second parent path is completely scanned, and determining the first front part path which is completely added as a first child path;

copying a first bit code of the second parent path to a previous bit code of the intersection point, and encoding a part of the copied second parent path as a second front part path; scanning from the first code of the first parent path, if the code in the first parent path does not appear in the codes of the second front part path, adding the codes to the second front part path until the first parent path is completely scanned, and determining the second front part path which is completely added as a second child path;

determining the first child path and the second child path as crossing paths;

randomly generating a third random number, and judging whether the third random number is greater than a preset variation probability;

if the third random number is larger than the preset variation probability, two reversal points of the cross path are randomly selected, coding positions corresponding to the two reversal points are interchanged, and the random path after reversal variation is determined to be the path in the second path.

5. The method of claim 4, wherein the randomly generating a second random number and determining whether the second random number is greater than a preset crossover probability further comprises:

and if the second random number is not greater than the preset cross probability, determining the first path as the cross path.

6. The method of claim 4, wherein randomly generating a third random number, and after determining whether the third random number is greater than a preset variation probability, further comprises:

and if the third random number is not greater than the preset variation probability, determining the cross path as a second path.

7. The drone control path optimization method of claim 1, wherein the determining the grid vector of the two-dimensional grid to which it corresponds according to the obstacle probability value comprises:

calculating a distance value from a center point of the two-dimensional grid to the position of the unmanned aerial vehicle, calculating a product of a first normal number and the distance value to be recorded as a first product, making a difference value between a second normal number and the first product, calculating a product of a square of the obstacle probability value corresponding to the two-dimensional grid and the difference value to be recorded as a second product, and determining the second product to be the grid vector value;

determining the grid vector angle according to the absolute position coordinate of the unmanned aerial vehicle and the absolute position coordinate of the two-dimensional grid through an arc tangent function;

and determining the grid vector of the two-dimensional grid corresponding to the grid vector value according to the grid vector value and the grid vector angle.

8. The drone control path optimization method of claim 1, wherein the active window is partitioned into regions, and the region obstacle density of a region is calculated from the grid vector values of the grid vectors within the region, comprising:

according to the angular resolution, carrying out regional division on the active window;

and summing the grid vector values of the grid vectors in each region to obtain a third sum value, and determining the third sum value as the obstacle density value of each region.

9. The drone controlled path optimization method of claim 1, wherein the determining a target area from the area obstacle density comprises:

selecting the area with the obstacle density smaller than an obstacle density threshold value as a candidate area; the candidate regions include at least one of the regions;

selecting the candidate region including the largest number of consecutive regions to be determined as the target region.

10. The drone control path optimization method of claim 1, wherein the determining a target direction from the target area includes:

and calculating the sum of the grid vector angles of the grid vectors at the two ends of the target area, recording the sum as a fourth sum, and determining half of the fourth sum as the target direction.

Technical Field

The application relates to the technical field of unmanned aerial vehicles, in particular to an unmanned aerial vehicle control path optimization method.

Background

In recent years, path planning becomes a research hotspot of numerous scholars at home and abroad, the performance of the path planning depends on the quality of a planning algorithm to a great extent, and how to rapidly and accurately plan an efficient path in various scenes and enable the efficient path to have the capability of coping with dynamic changes of the scenes is a problem to be solved by the path planning algorithm. According to the difference of the degree of grasp of the environmental information, scientists divide the path planning into global path planning based on the prior complete information and local path planning based on the sensor information. From the viewpoint of whether the acquired obstacle information is static or dynamic, the global path planning belongs to static planning (also called offline planning), and the local path planning belongs to dynamic planning (also called online planning). The global path planning requires the execution component to master all environment information and plan the path according to all the information of the environment map; the local path planning only needs to acquire environmental information in real time by a sensor carried on an execution component, know the environmental map information, determine the position of the local map and the distribution condition of local obstacles around the local map, and further select the optimal path from the current position node to a certain sub-target node. Path planning has wide application in many fields of actual production and life, such as: the method comprises the following steps of planning the path of a vehicle under a complex traffic condition, solving an NP-hard problem (a nondeterministic polynomial problem) in common combined optimization problems, a Traveling Salesman Problem (TSP), planning the optimal route of an unmanned aerial vehicle, planning the configuration of the Vehicle (VRP) in logistics management, planning the urban road based on a GIS (geographic information system or spatial information system) and the like.

With the progress of science and technology, the solutions to the path planning problem are endless, and the application ranges of the various methods are different according to their own advantages and disadvantages. Through research on path planning algorithms commonly used in various fields, scholars discover sequence and algorithm basic principles according to various algorithms, and the path planning algorithms are roughly divided into three types: traditional algorithms, graphical methods, intelligent biomimetics algorithms. The traditional path planning algorithm comprises the following steps: a simulated annealing algorithm, an artificial potential field algorithm, a simulated logic algorithm, a tabu search algorithm, and the like. However, the traditional algorithm often has a problem of difficult modeling when solving the practical problem, and for this reason, a graphical method is proposed to solve the problem of modeling, and the commonly used graphical method includes: c-space method, grid method, free space method, voronoi diagram method (tesson polygon), and the like. However, the graphical method generally has the defect of searching capability, and a special searching algorithm is often required to be combined. And also when dealing with path planning problems in the case of complex environmental information. Natural inspirations tend to work well. The intelligent bionics algorithm is an algorithm discovered by people through researching the excellent capability and the generation principle of a biological system in nature, and the algorithms commonly used in path planning comprise: ant colony algorithm, immune algorithm, particle swarm algorithm, fish colony algorithm, genetic algorithm and the like.

With the rapid development of artificial intelligence, unmanned aerial vehicles are widely applied to civil fields such as farm irrigation, environmental monitoring, search and rescue and military fields such as reconnaissance detection, interference communication and ground attack, how to efficiently use the unmanned aerial vehicles depends on how to reasonably plan paths of the unmanned aerial vehicles, and the path planning cannot leave various path intelligent algorithms.

Disclosure of Invention

In view of this, an object of the present application is to provide at least a method for optimizing a control path of an unmanned aerial vehicle, which solves the technical problem in the prior art that an unmanned aerial vehicle is not suitable for dynamic planning in a complex environment by using a path optimization method based on a genetic algorithm and combined with a VFH obstacle avoidance strategy, and achieves a technical effect that the unmanned aerial vehicle platform can realize path optimization in indoor and outdoor complex environments. Compared with the traditional path optimizing method, the unmanned aerial vehicle control path optimizing method is higher in applicability and more reasonable in searched optimal path.

The application mainly comprises the following aspects:

in a first aspect, an embodiment of the present application provides an unmanned aerial vehicle control path optimization method, where the method includes: acquiring path nodes and the number of the unmanned aerial vehicles according to the actual flight task, and randomly arranging the path nodes to determine a random path; calculating the fitness value of the random path, and selecting a target path by using the fitness value according to the thought of a genetic algorithm; acquiring obstacle environment data of the unmanned aerial vehicle flying according to a target path; taking the position of the unmanned aerial vehicle as a central point, generating a movable window according to obstacle environment data, dividing the movable window into a plurality of continuous two-dimensional grids, and acquiring an obstacle probability value of each two-dimensional grid; determining a grid vector of a corresponding two-dimensional grid according to the obstacle probability value; the grid vector comprises a grid vector value and a grid vector angle; dividing the active window into areas, and calculating the regional obstacle density of the areas according to the grid vector value of the grid vector in the areas; determining a target area according to the area obstacle density; determining a target direction according to the target area; flying according to the target path, when encountering obstacles, avoiding according to the target direction, and further determining the actual flying path of the unmanned aerial vehicle.

Optionally, calculating a fitness value of the random path, and selecting a target path by using the fitness value according to the idea of a genetic algorithm, including: determining the serial numbers of path nodes forming a random path; real number coding is carried out on the random path according to the serial number; calculating the reciprocal of the distance sum value of adjacent path nodes of the random path after real number coding, recording the reciprocal as a first sum value, and determining the first sum value as the fitness value of the random path; selecting a random path with the minimum fitness value as a target random path; judging whether the iteration number reaches an iteration number threshold value or not; and if the iteration times reach the iteration time threshold, determining the target random path as the target path.

Optionally, after determining whether the iteration number at this time reaches the iteration number threshold, the method further includes: determining a random path as a first path, if the iteration times are not equal to the iteration time threshold, summing the fitness values of the first path to obtain a second sum, calculating the ratio of the fitness value of the first path to the second sum, and determining the ratio as the fitness probability of the first path; according to the probability of the fitness value, performing multiple rounds of selection on a random path in the first path by a roulette method, and performing single-point crossing and reverse variation on the random path after the multiple rounds of selection to obtain a second path; and adding one to the iteration times, determining the second path as the first path, and calculating the fitness value of the first path.

Optionally, the first path is selected by roulette, single-point crossed, and inverted to generate a second path, including: randomly generating a first random number, and selecting a random path in the first path as a random path in the second path by using the random number; randomly generating a second random number, and judging whether the second random number is greater than a preset cross probability; if the second random number is larger than the preset cross probability, pairing random paths in the first path pairwise to form a path pair, and randomly selecting a cross point of the path pair; one random path in the random path pair is selected to be determined as a first parent path, the other random path in the path pair is determined as a second parent path, a first bit code of the first parent path is copied to a previous bit code of an intersection point, and a part of the copied first parent path is coded to be used as a first front part path; scanning is started from the first code of the second parent path, if the code in the second parent path does not appear in the code of the first front part path, the code is added to the first front part path until the second parent path is completely scanned, and the first front part path which is completely added is determined as a first child path; copying a first bit code of the second parent route to a previous bit code of the intersection point, and taking a part of the copied second parent route as a second front part route; scanning is started from the first code of the first parent path, if the code in the first parent path does not appear in the code of the second front part path, the code is added to the second front part path until the second parent path is completely scanned, and the second front part path which is completely added is determined as a second child path; determining the first descendant path and the second descendant path as cross paths; randomly generating a third random number, and judging whether the third random number is greater than a preset variation probability; if the third random number is larger than the preset variation probability, two reversal points of the crossed path are randomly selected, the coding positions corresponding to the two reversal points are exchanged, and the random path after reversal variation is used as a path in the second path.

Optionally, after randomly generating a second random number and determining whether the second random number is greater than a preset crossover probability, the method further includes: and if the second random number is not greater than the preset cross probability, determining the first path as a cross path.

Optionally, randomly generating a third random number, and after determining whether the third random number is greater than a preset variation probability, the method further includes: and if the third random number is not greater than the preset variation probability, determining the cross path as a second path.

Optionally, determining a grid vector of a two-dimensional grid corresponding to the obstacle probability value according to the obstacle probability value includes: calculating a distance value from a center point of the two-dimensional grid to the position of the unmanned aerial vehicle, calculating a product of a first normal number and the distance value as a first product, making a difference value between a second normal number and the first product, calculating a product of the square of an obstacle probability value corresponding to the two-dimensional grid and the difference value as a second product, and determining the second product as a grid vector value; determining a grid vector angle through an arc tangent function according to the absolute position coordinate of the unmanned aerial vehicle and the absolute position coordinate of the two-dimensional grid; and determining the grid vector of the corresponding two-dimensional grid according to the grid vector value and the grid vector angle.

Optionally, the dividing the active window into regions, and calculating a regional obstacle density of the region according to a grid vector value of a grid vector in the region, includes: according to the angular resolution, carrying out regional division on the active window; and summing the grid vector values of the grid vectors in each region to obtain a third sum value, and determining the third sum value as the obstacle density value of each region.

Optionally, determining the target area according to the area obstacle density includes: selecting a region with a regional obstacle density smaller than an obstacle density threshold value as a candidate region; the candidate regions include at least one region; the candidate area including the largest number of consecutive areas is selected to be determined as the target area.

Optionally, determining the target direction according to the target area includes: and calculating the sum of the grid vector angles of the grid vectors at the two ends of the target area, recording the sum as a fourth sum, and determining half of the fourth sum as the target direction.

In a second aspect, an embodiment of the present application further provides an electronic device, including: the unmanned aerial vehicle control path optimization system comprises a processor, a memory and a bus, wherein the memory stores machine-readable instructions executable by the processor, when the electronic device runs, the processor and the memory communicate through the bus, and when the machine-readable instructions are run by the processor, the steps of the unmanned aerial vehicle control path optimization method in the first aspect or any one of the possible implementation manners of the first aspect are executed.

In a third aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the unmanned aerial vehicle control path optimization method in any one of the foregoing possible embodiments are executed.

According to the method for optimizing the control path of the unmanned aerial vehicle, the path nodes and the number of the unmanned aerial vehicle are obtained, and the path nodes are randomly arranged to be determined as random paths; calculating the fitness value of the random path, and selecting a target path by using the fitness value according to the thought of a genetic algorithm; acquiring obstacle environment data of the unmanned aerial vehicle flying according to a target path; taking the position of the unmanned aerial vehicle as a central point, generating a movable window according to obstacle environment data, dividing the movable window into a plurality of continuous two-dimensional grids, and acquiring an obstacle probability value of each two-dimensional grid; determining a grid vector of a corresponding two-dimensional grid according to the obstacle probability value; the grid vector comprises a grid vector value and a grid vector angle; dividing the active window into areas, and calculating the regional obstacle density of the areas according to the grid vector value of the grid vector in the areas; selecting a region with a regional obstacle density smaller than an obstacle density threshold value as a candidate region; determining a target direction according to the grid vectors of the candidate regions; flying according to the target path, when encountering obstacles, avoiding according to the target direction, and further determining the actual flying path of the unmanned aerial vehicle. By means of the path optimization method based on the genetic algorithm and combined with the VFH obstacle avoidance strategy and the mode of applying the method to the proposed unmanned aerial vehicle platform, the technical problem that the unmanned aerial vehicle is not suitable for dynamic planning under the condition of facing complex environment in the prior art is solved, and the technical effect that the unmanned aerial vehicle platform can achieve path optimization under indoor and outdoor complex environment is achieved.

In order to make the aforementioned objects, features and advantages of the present application more comprehensible, preferred embodiments accompanied with figures are described in detail below.

Drawings

In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings that are required to be used in the embodiments will be briefly described below, it should be understood that the following drawings only illustrate some embodiments of the present application and therefore should not be considered as limiting the scope, and for those skilled in the art, other related drawings can be obtained from the drawings without inventive effort.

Fig. 1 shows a flowchart of a method for optimizing a control path of an unmanned aerial vehicle according to an embodiment of the present application.

Fig. 2 is a flowchart illustrating another method for optimizing an unmanned aerial vehicle control path according to an embodiment of the present disclosure.

Fig. 3 shows a single-point cross diagram provided by an embodiment of the present application.

Fig. 4 shows a schematic diagram of the inverse variation provided by the embodiments of the present application.

Fig. 5 shows a schematic diagram of an active window provided in an embodiment of the present application.

Fig. 6 shows a schematic structural diagram of an unmanned aerial vehicle system provided in an embodiment of the present application.

Fig. 7 shows a schematic diagram of outdoor path planning provided by an embodiment of the present application.

Fig. 8 shows a schematic diagram of indoor path planning provided by an embodiment of the present application.

Fig. 9 shows a schematic structural diagram of an unmanned aerial vehicle control path optimizing apparatus provided in an embodiment of the present application.

Fig. 10 shows a schematic structural diagram of an electronic device provided in an embodiment of the present application.

Detailed Description

To make the purpose, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it should be understood that the drawings in the present application are for illustrative and descriptive purposes only and are not used to limit the scope of protection of the present application. Additionally, it should be understood that the schematic drawings are not necessarily drawn to scale. The flowcharts used in this application illustrate operations implemented according to some embodiments of the present application. It should be understood that the operations of the flow diagrams may be performed out of order, and that steps without logical context may be performed in reverse order or concurrently. One skilled in the art, under the guidance of this application, may add one or more other operations to, or remove one or more operations from, the flowchart. In addition, the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. The components of the embodiments of the present application, generally described and illustrated in the figures herein, can be arranged and designed in a wide variety of different configurations. Thus, the following detailed description of the embodiments of the present application, presented in the accompanying drawings, is not intended to limit the scope of the claimed application, but is merely representative of selected embodiments of the application. All other embodiments, which can be derived by a person skilled in the art from the embodiments of the present application without making any creative effort, shall fall within the protection scope of the present application.

In the prior art, when a complex environment is faced, the searched path is often not guaranteed to be the optimal path, and the unmanned aerial vehicle under the control of the prior art is not suitable for dynamic planning. Based on this, according to the method for optimizing the control path of the unmanned aerial vehicle provided by the embodiment of the application, by means of the path optimization method based on the genetic algorithm and combined with the VFH obstacle avoidance strategy and applying the method to the proposed unmanned aerial vehicle platform, the technical problem that the unmanned aerial vehicle is not suitable for dynamic planning in the presence of a complex environment in the prior art is solved, and the technical effect that the unmanned aerial vehicle platform can realize the path optimization in the indoor and outdoor complex environment is achieved, and the method is specifically as follows:

referring to fig. 1, fig. 1 is a flowchart of an unmanned aerial vehicle control path optimization method according to an embodiment of the present disclosure. As shown in fig. 1, the method for optimizing an unmanned aerial vehicle control path provided in an embodiment of the present application includes the following steps:

s101, acquiring path nodes and the number of the path nodes which need to pass by the unmanned aerial vehicle in the flying process, and randomly arranging the path nodes to generate a random path.

Specifically, the number of the path nodes and the number of the path nodes of the unmanned aerial vehicle can be manually set through a computer, and the raspberry-sending onboard computer obtains the path nodes and the path node data of the unmanned aerial vehicle and selects a target path according to a genetic algorithm. And randomly arranging the path nodes, and determining the path nodes after random arrangement as a random path, wherein the random path comprises all path nodes, and each path node only appears once.

And S102, calculating the fitness value of the random path, and selecting a target path according to the fitness value.

Specifically, according to the sequence of the path nodes in the random path, calculating the reciprocal of the distance sum value of the adjacent path nodes in the random path, recording the reciprocal as a first sum value, and determining the first sum value as the fitness value of the random path. And selecting the random path with the minimum fitness value as the target path.

S103, obtaining obstacle environment data when the unmanned aerial vehicle flies according to the target path.

Specifically, when the unmanned aerial vehicle flies according to the target path, the laser radar sensor and the depth sensing camera acquire obstacle environment data in the flying process, the obstacle environment data are sent to an aircraft control system of the unmanned aerial vehicle, and the aircraft control system sends the obstacle environment data to the raspberry dispatching onboard computer. And acquiring obstacle environment data by the raspberry host machine-mounted computer and executing a subsequent obstacle avoidance algorithm.

S104, taking the actual flying position of the unmanned aerial vehicle as a central point, generating a movable window according to obstacle environment data, dividing the movable window into a plurality of continuous two-dimensional grids, and acquiring an obstacle probability value of each two-dimensional grid.

Specifically, the position of the unmanned aerial vehicle is used as a central point (VCP), the position of the unmanned aerial vehicle is determined outdoors according to longitude and latitude, and the position of the unmanned aerial vehicle is determined indoors according to a coordinate system with artificial rules. According to the method, twice of the farthest distance which can be measured by the laser radar sensor and the depth sensing camera is used as the side length s of the active window, the active window with the side length s is divided into a plurality of continuous two-dimensional grids, the size of the two-dimensional grids can be set through a computer, and the obstacle probability value can be updated due to a probability equation related to the characteristics of the laser radar sensor and the depth sensing camera.

S105, determining a grid vector of the corresponding two-dimensional grid according to the obstacle probability value; the grid vector includes a grid vector value and a grid vector angle.

Specifically, the grid vector of the corresponding two-dimensional grid is determined according to the obstacle probability value of the two-dimensional grid. The grid vector includes a grid vector value and a grid vector angle.

And S106, carrying out region division on the active window, and calculating the regional obstacle density of the region according to the grid vector value of the grid vector in the region.

Specifically, after calculating the grid vectors of the two-dimensional grid, it may be considered that only grid vectors are in the active window, after the active window is divided into regions according to the angular resolution, it may be considered that only grid vectors are in the regions, grid vector values of all grid vectors in the regions are summed, and the summed value is determined as the regional obstacle density of the region.

And S107, determining a target area according to the area obstacle density.

Specifically, selecting a region with a regional obstacle density smaller than an obstacle density threshold as a candidate region; the candidate regions include at least one region; the candidate area including the largest number of consecutive areas is selected to be determined as the target area. That is, the target area is the largest continuous area.

And S108, determining the target direction according to the target area.

Specifically, the sum of the grid vector angles of the grid vectors at both ends of the target area is calculated and recorded as a fourth sum, and half of the fourth sum is determined as the target direction. Wherein, the target direction can be the target direction angle, and unmanned aerial vehicle flies according to the target direction angle.

S109, flying according to the target path, and when encountering obstacles, avoiding according to the target direction, so as to determine the actual flight path of the unmanned aerial vehicle.

Specifically, unmanned aerial vehicle is at the in-process of flying according to the target route, when meetting the obstacle, the raspberry group receives obstacle environment data and gets target direction angle through keeping away barrier algorithm, and unmanned aerial vehicle flies according to target direction angle and avoids, and then confirms unmanned aerial vehicle's actual flight route.

In specific implementation, please refer to fig. 2, and fig. 2 is a flowchart of another method for optimizing an unmanned aerial vehicle control path according to an embodiment of the present application. As shown in fig. 2, the method for optimizing an unmanned aerial vehicle control path provided in an embodiment of the present application includes the following steps:

s201, determining path nodes and quantity, and carrying out real number coding on individuals formed by the path nodes to generate a population (each individual in the population represents a path).

Specifically, the path nodes and the number of the path nodes of the unmanned aerial vehicle are obtained, and the path nodes are randomly arranged to be determined as random paths. The path nodes and the number of the path nodes can be set in the computer by human beings. A random path is a path that consists of all path nodes arranged randomly, where a path node can only appear once in the random path. According to the method, an optimal route is planned through a genetic algorithm, when the genetic algorithm is applied to the optimal route planning of the unmanned aerial vehicle, a corresponding problem parameter set is formed by route nodes needing to pass through in the task planning of the unmanned aerial vehicle, a coding mode corresponding to the parameter set is real number coding, namely, 1-N real number random arrangement is carried out on N route nodes needing to pass through to generate a population, and each individual in the population represents one route.

That is, N path nodes are randomly arranged to form a random path, a plurality of random paths form a population, each random path is each individual in the population, and if M random paths are formed, the number of individuals in the population is M. The real number encoding of the path formed by the path nodes may be to determine serial numbers of the path nodes forming the random path, and perform real number encoding on the random path according to the serial numbers, that is, encode the random path according to the occurrence sequence of the N path nodes in the random path.

For example, if there are eight path nodes, the path nodes are numbered, and the eight path nodes are randomly arranged to obtain the order of the nodes in the path, that is, path node 2, path node 1, path node 3, path node 8, path node 7, path node 5, path node 6, and path node 4, that is, after the random path is subjected to real number coding, the random path may be represented by code 21387564.

S202, initializing population parameters (setting population number, individual gene number, iteration number threshold, preset cross probability and preset variation probability).

Specifically, population parameter initialization in the genetic algorithm includes the following initialization parameters: the population number M, the chromosome (individual) gene number (namely the node number N), the iteration number threshold C, the preset cross probability Pc and the preset variation probability Pdetermination.

S203, calculating the fitness value of each individual in the population according to the fitness function (because the distance between any two nodes is known, the reciprocal of the total distance corresponding to the individual is selected as the fitness function).

Specifically, calculating the fitness value of each individual in the population according to the fitness function refers to: a reasonable fitness function is constructed to judge the quality of a population, in the optimal path planning of the unmanned aerial vehicle, under the condition that the distance between any two defaulted nodes is known, the total distance of each chromosome (namely, a random path after random arrangement of N nodes, or an individual) is calculated, the reciprocal of the total distance of a random full arrangement is used as the fitness function, namely, the shorter the distance is, the higher the fitness function value is, and the requirement of a designed unmanned aerial vehicle system platform on the selection of the optimal path is met. The calculation method of the fitness function comprises the steps of calculating the reciprocal of the distance sum value of adjacent path nodes of the random path after real number coding, recording the reciprocal as a first sum value, and determining the first sum value as the fitness value of the random path. Since the distance between any two nodes is known, the reciprocal of the total distance corresponding to an individual is selected as the fitness function.

And S204, evaluating the population (calculating the fitness value of the optimal individual).

Specifically, the evaluation population in the genetic algorithm includes: parameters for bit string decoding, calculating objective function values, mapping function values to adaptation values, adaptation value adjustment. Evaluating a population in this application refers to calculating fitness values for optimal individuals. The optimal individual means that the individual with the minimum fitness value is the optimal individual, that is, the random path corresponding to the minimum first sum value is the optimal path. And selecting the random path with the minimum fitness value as the target random path.

And S205, judging whether the iteration times are equal to the iteration time threshold value or not.

Specifically, when the fitness value of the optimal chromosome (optimal route) in the population reaches a given threshold value, or the fitness of the optimal chromosome and the population fitness do not rise any more, or the iteration number reaches a preset algebra, the genetic algorithm is terminated, and the termination condition adopted by the system platform is that a reasonable maximum iteration number is preset. And judging whether the iteration number is equal to an iteration number threshold value or not, and if the iteration number is equal to the iteration number threshold value, determining the target random path as the target path.

And S206, carrying out genetic manipulation (selection, crossing and mutation).

And S207, selecting a plurality of winning individuals by using a roulette method according to the individual fitness in the population.

Specifically, the random path is used as a first path, if the iteration times are not equal to the iteration time threshold, the fitness values of the first path are summed to obtain a second sum, the ratio of the fitness value of the first path to the second sum is calculated, and the ratio is determined as the fitness probability of the first path; and according to the probability of the fitness value, carrying out multiple rounds of selection on the first path by a roulette method to obtain a plurality of winning random paths.

In particular, genetic calculationThe key link in the method lies in genetic manipulation, and the effect of the genetic manipulation depends on three basic genetic manipulations of selection, crossing and mutation. The selection operation is established on the basis of population chromosome fitness evaluation, and aims to directly transmit chromosomes with high fitness to the next generation or generate new chromosomes through pairing and crossing and then transmit the new chromosomes to the next generation, so that chromosomes with low fitness are eliminated, and the overall fitness of the population is improved. Common options are: roulette, tournament. The application adopts a roulette method, and the principle of the roulette method is as follows: let the number of the population be M, and the fitness value of the individual xi in the population be fξThen, the probability that ξ is selected is used as the fitness probability, and the fitness probability is calculated by, for example, the following formula:

in the formula (1), PξRefers to the fitness probability of the ξ -th individual (the ξ -th random path), fξRefers to the fitness value of the ξ -th individual, i.e., the fitness value of the ξ -th random path, with M referring to the total number of individuals in the population. As is apparent from formula (1), the fitness probability reflects the proportion of the fitness value of the ξ individual in the sum of the individual fitness values of the entire population. The higher the fitness value of an individual, the higher its probability of fitness, the higher the probability of being selected, and vice versa. After calculating the selection probability of each individual in the population, to select mating individuals, multiple rounds of selection are required, each round yielding one [0,1]The random number is used as a selection pointer to determine the selected individual. After selecting individuals, mating pairs are randomly formed for later crossover operations.

And S208, randomly selecting two winning individuals to carry out single-point crossing to generate new filial generation individuals.

Specifically, crossover operation is the core of the whole genetic algorithm, and crossover refers to the operation of replacing and recombining partial gene structures of two parent individuals to generate a new child individual. The commonly used interleaving methods are: single-point crossing, multi-point crossing, even crossing and the like, and the system adopts a single-point crossing mode. The single-point crossing method is only applicable to real number coding, and the principle is that a cross point is selected by a parent, the first half part of genes of an offspring are copied from the initial position of one parent gene to the genes contained in the cross point, then scanning is started from the initial position of the other parent gene, and if a certain gene is not in the offspring, the gene is added. The cross operation enables the genetic algorithm to have better global search capability, and the probability of obtaining the optimal solution by the genetic algorithm is greatly improved.

For example, referring to fig. 3, fig. 3 shows a single-point cross diagram provided in the embodiment of the present application. Randomly generating a second random number, and pairing random paths in the first path pairwise to form a path pair when the second random number is greater than a preset cross probability, wherein the path pair is a random path coded by 21387564 and a random path coded by 26573184; the intersection of the pair of randomly selected paths is 2138 '7564 and 2657' 3184, the random path coded 21387564 is randomly selected as the first parent path, and the random path coded 26573184 is the second parent path. The first bit of the first parent route of the copy code 21387564 is coded to the previous bit of the cross point, the copied part is coded as 2138, and the route coded as 2138 is used as the first front part route of the cross route; then, the scanning is started from the first code 2 of the second parent path coded as 26573184, since the code 2 exists in the code 2138 of the first front part path, the code is not added to the code of the first front part path, and the second code 6 scanned to the second parent path does not exist in the code of the first front part path, and the code 6 is added to the first front part path, at this time, the code of the first front part path is 21386. And determining the first front part path of which all additions are completed as a first child path until the encoding of the second parent path is completely scanned. That is, the code of the first front partial path in which all additions are completed at this time is 21386574, and the code of 21386574 is taken as the first child path.

Illustratively, the first bit of the second parent path encoded by the duplicate code 26573184 is encoded to the previous bit of the intersection, and the duplicate portion is encoded as 2657, and the path encoded as 2657 is taken as the second front portion path; and then scanning is started from the first code 2 of the first parent path coded as 21387564, because the code 2 exists in the code 2657 of the front partial path, the code 2 is not added into the code of the second front partial path, and the second code 1 scanned to the first parent path does not exist in the code of the second front partial path, the code 1 is added into the second front partial path, the code of the second front partial path is 26571 at this time, and the second front partial path with all added codes is determined as the second child path until all the codes of the first parent path are scanned completely. That is, the code of the second front partial path in which all additions are completed at this time is 21386574, and the code of 21386574 is taken as the second child path.

Specifically, the first child path and the second child path are determined as the crossing path. And if the second random number is not greater than the preset cross probability, determining the random path in the first path as a cross path. Illustratively, if the second random number is not greater than the preset crossover probability, determining a random path of the first paths coded as 21387564 and a random path of the first paths coded as 26573184 as a crossover path.

S209, carrying out reverse mutation operation on the genes of the offspring individuals.

Specifically, the mutation operation is to change the gene values of some gene positions of some individuals in the population, and the significance of the genetic algorithm for introducing the mutation operation is as follows: firstly, the algorithm has local random search capability, namely when the algorithm approaches to an optimal solution through cross operation, the algorithm result can be accelerated to approach to an optimal value through mutation operation; second, the diversity of the population genes is maintained to prevent local convergence. The common variation modes include basic variation and inverse variation, and the application adopts the inverse variation mode. The principle of reverse variation is to randomly select two reverse points from an individual in a population and then exchange genes between the two reverse points.

Referring to fig. 4, fig. 4 is a schematic diagram illustrating an inversion variation provided by an embodiment of the present application. Specifically, a third random number is randomly generated, whether the third random number is greater than a preset variation probability is judged, if the third random number is greater than the preset variation probability, two reversal points of a cross path are randomly selected, coding positions corresponding to the two reversal points are interchanged, and the random path after reversal variation is used as a path in a second path; and if the third random number is not greater than the preset variation probability, determining the cross path as the path in the third path. Illustratively, a third random number is randomly generated, when the third random number is greater than the preset variation probability, if the code of the cross path is 21387564, two reversal points of the cross path are randomly selected to be a second code bit and a seventh code bit, and the code positions corresponding to the two reversal points are interchanged, the interchanged path is coded to be 26387514, and the path coded to be 26387514 is determined to be the path in the second path. If the third random number is greater than the preset variation probability, determining the cross path coded as 21387564 as the path in the second path.

And S210, generating a new generation of population.

Specifically, the second path is determined as a new generation of population, and the fitness value of each individual in the population is calculated according to the fitness function. That is, the iteration number is increased by one, the second path is determined as the first path, and the fitness value of the first path is calculated.

S211, outputting an optimal route corresponding to the optimal individual, and determining a flying point of the unmanned aerial vehicle (the flying point is one of the known nodes) according to the actual task requirement.

Specifically, the optimal route among a plurality of path nodes with known positions can be planned through the genetic algorithm, and when a plurality of path node tasks are planned actually, the unmanned aerial vehicle can fly according to the route planned by the algorithm only by determining the starting point of the tasks. However, the algorithm cannot avoid the possible emergencies such as obstacles in the optimal route, based on the situations, the unmanned aerial vehicle system platform adopts the VFH obstacle avoidance algorithm to plan the local route of the unmanned aerial vehicle on the basis of using the genetic algorithm to plan the global route, the algorithm can be used for driving the motion direction of the unmanned aerial vehicle to avoid the unmanned aerial vehicle from touching the obstacles, and meanwhile, the algorithm is close to the target, so that the unmanned aerial vehicle can realize the obstacle avoidance function in short.

S212, programming the raspberry pie according to the genetic algorithm thought, simulating by using a simulation platform, and establishing communication by directly connecting with the flight control after the simulation is correct.

And S213, the raspberry group sends the node information of the optimal path to the unmanned aerial vehicle for flight control, and the flight control unmanned aerial vehicle flies according to the optimal path.

S214, when the unmanned aerial vehicle flies according to the optimal path, the laser radar and the depth real-sensing camera scan roadblocks around the unmanned aerial vehicle, and send environment data to the flight control unit.

Specifically, when the unmanned aerial vehicle flies according to a target path, obstacle environment data scanned by the laser radar sensor and the depth sensing camera are acquired, and the obstacle environment data are sent to an aircraft control system (namely, flight control).

S215, obtaining environment data received by flight control through the raspberry group, and carrying out real-time obstacle avoidance through a VFH algorithm based on an actual active window of the unmanned aerial vehicle.

Specifically, the aircraft control system sends the obstacle environment data to the raspberry sending onboard computer, and the raspberry sending onboard computer carries out real-time obstacle avoidance through a VFH algorithm based on the obstacle environment data. The full name of VFH is Vector Field Histogram, i.e. Vector Field Histogram. The idea of the method is to describe the drone as a point in a two-dimensional planar world and then use a histogram to describe the obstacles around the drone. The method comprises two stages, wherein the first stage converts the histogram grid around the unmanned aerial vehicle into a polar coordinate vector, and the second stage selects a proper direction to drive the unmanned aerial vehicle to move forward according to the polar coordinates acting around the unmanned aerial vehicle.

And S216, dividing the unmanned aerial vehicle active window into a plurality of continuous two-dimensional grids, and updating CV values of the two-dimensional grids through probability equations related to the characteristics of the sensors (the CV values indicate the probability value that the two-dimensional grids have obstacles).

Referring to fig. 5, fig. 5 is a schematic diagram illustrating an active window provided in an embodiment of the present application. Specifically, the two-dimensional grid CV value refers to an obstacle probability value with the position of the drone as the centerPoints (VCP), (x)0,y0) Generating a movable window according to the absolute position coordinates of a central point (VCP) of the unmanned aerial vehicle at the moment, dividing the movable window into a plurality of continuous two-dimensional grids, and acquiring the obstacle probability value of each two-dimensional grid. The sensing range of the unmanned aerial vehicle to the external environment at any moment is limited and depends on the effective measuring range of the used sensor. And defining the maximum range which can be sensed by the unmanned aerial vehicle at a certain moment as an active window. It is actually with unmanned aerial vehicle as the centre of a circle, and the scope of surveying of used sensor is the circular region of radius. But in the present application, to facilitate the use of the algorithm, it is reduced to a square region with side length s. Where s is twice the maximum distance that can be measured by the sensor.

S217, vectorizing the two-dimensional grid.

Specifically, determining a grid vector of a corresponding two-dimensional grid according to the obstacle probability value; the grid vector includes a grid vector value and a grid vector angle. The grid vector value calculation method comprises the steps of calculating a distance value from a center point of the two-dimensional grid to the position of the unmanned aerial vehicle, calculating a product of a first normal number and the distance value to be recorded as a first product, making a difference value between a second normal number and the first product, calculating a product of the square of an obstacle probability value corresponding to the two-dimensional grid and the difference value to be recorded as a second product, and determining the second product to be the grid vector value. That is, the grid vector value and the grid angle are both the vector magnitude and the vector angle from the center point of its corresponding two-dimensional grid to the drone position (VCP).

Specifically, the grid vector value is calculated by the following formula:

mi,j=(ci,j *)2×(a-b×di,j) (2)

in the formula (2), mi,jThe grid vector values of the grid vectors of the ith abscissa and the jth ordinate are shown, and a and b are normal numbers; c. Ci,j *Is the CV value (i.e., obstacle probability value) of the i-th abscissa and the j-th ordinate of the two-dimensional grid within the activity window; di,jIs the i th of the abscissa and the j th of the ordinate to the drone (i.e. the central point of the active window, or, V)CP) distance value. Specifically, a grid vector angle is determined through an arc tangent function according to the absolute position coordinate of the unmanned aerial vehicle and the absolute position coordinate of the two-dimensional grid; the grid vector angle is calculated by the following formula:

in the formula (3), βi,jRefers to the grid vector angle, x, of the ith two-dimensional grid on the abscissa and the jth two-dimensional grid on the ordinate0,y0Is the absolute position coordinate, x, of the central point (VCP) of the drone at that momenti,yjIs the absolute position coordinates of the two-dimensional grid (i.e., the absolute position coordinates of the center point of the two-dimensional grid). Specifically, the grid vector of the corresponding two-dimensional grid is determined according to the grid vector value and the grid vector angle.

S218, partitioning the active window and calculating the obstacle density of each region.

Specifically, the active window is divided into regions, and the regional obstacle density of the regions is calculated based on the grid vector values of the grid vectors in the regions, and the regional obstacle density is calculated by dividing the active window into regions based on the angular resolution, and if the angular resolution α is selected, the total number of the regions n obtained by the division is 360 °/α, and α is 5 ° in the present application, that is, 72 regions. And summing the grid vector values of the grid vectors in each region to obtain a third sum value, and determining the third sum value as the obstacle density value of each region. Calculating the regional obstacle density value by the following formula:

hk=∑u,vmu,v (4)

in the formula (4), k refers to a region index, that is, k in the present application takes on values of 0,1,2, …, 71, hkRefers to the k-th regional obstacle density value, mu,vRefers to the grid vector value of a certain grid vector in the kth region. Then, hkThe sum of the grid vector values of all grid vectors of the kth region is found.

S219, whether the obstacle density is less than the threshold value.

Specifically, whether the obstacle density of the area is smaller than an obstacle density threshold value is judged.

S220, taking the area as a candidate area.

Specifically, the continuous area with the largest number of obstacle densities smaller than the obstacle density threshold is selected as the candidate area. A certain obstacle density threshold τ is preset, and a region where the obstacle density is lower than the obstacle density threshold is referred to as a "candidate region". When there is a continuation of Smax(in the experiment Smax18) candidate regions are said to be "wide valleys" when they exist; otherwise referred to as "lanes".

And S221, determining the motion direction.

Specifically, the sum of the grid vector angles of the grid vectors at the two ends of the candidate region is calculated and recorded as a fourth sum, and half of the fourth sum is determined as the target direction. The target direction is calculated by the following formula:

in the formula (5), θ denotes a target direction, βlGrid vector angle, β, referring to the left-most grid vector of the candidate regionrRefers to the raster vector angle of the raster vector at the rightmost end of the candidate region.

S222, the raspberry group sends the direction information to flight control, and the flight control unmanned aerial vehicle flies according to the movement direction to achieve obstacle avoidance.

And S223, after the obstacle avoidance action is finished, the unmanned aerial vehicle still flies and avoids the obstacle according to the planned optimal route until the planning task is finished.

Specifically, the unmanned aerial vehicle flies according to a target path, and when an obstacle is encountered, the unmanned aerial vehicle dodges according to a target direction, so that the actual flight path of the unmanned aerial vehicle is determined.

Referring to fig. 6, fig. 6 shows a schematic structural diagram of an unmanned aerial vehicle system provided in an embodiment of the present application. As shown in fig. 6, the drone system 10 includes: the system comprises a detection module 101, an obstacle avoidance module 102, a control module 103, a positioning module 104, an aircraft control system 105, a communication module 106, an execution module 107 and a power supply module 108. The drone system 10 performs the drone control path optimization method described above. The detection module 101 is composed of a barometer, an electronic compass and an inertial measurement unit. The function of the barometer is to determine the altitude of the unmanned aerial vehicle in flight by measuring the atmospheric pressure change, the electronic compass is used for assisting the aircraft in determining the azimuth and surveying the terrain, and the inertial measurement unit is an electronic device which combines an accelerometer and a gyroscope (and sometimes a magnetometer) to measure and report the specific force, angular velocity and the surrounding magnetic field of the unmanned aerial vehicle; the obstacle avoidance module 102 is composed of a laser radar and a depth sensing camera. Wherein the lidar measures the detected distance between itself and an object by irradiating the object with a pulse laser and measuring the return time of the reflected pulse with a sensor, and is capable of imaging the object using ultraviolet rays, visible light, or near infrared light. The depth real-sensing camera can also measure the distance from an object to the camera, and compared with a traditional camera, the depth camera is functionally added with a depth measurement, so that the surrounding environment and the change can be sensed more conveniently and accurately. The two devices provide important environmental data for the unmanned aerial vehicle to realize the obstacle avoidance function; the control module 103 mainly consists of an airborne computer, which is a special computer specially designed and manufactured for aerospace, also called an aviation computer, and has the functions of measuring, processing, transmitting, displaying and controlling various instructions and operations received by the aircraft in the flight process; the positioning module 104 is mainly divided into outdoor positioning and indoor positioning, the outdoor positioning adopts a double-navigation module consisting of a Beidou navigation system independently researched and developed by scientific research personnel in China and an American GPS (global positioning system), and aims to improve the positioning precision and the anti-interference capability of the unmanned aerial vehicle outdoors, and the indoor positioning adopts an infrared positioning device combined with a binocular vision camera and an ultrasonic positioning device, so that the unmanned aerial vehicle can still accurately determine the self direction and complete a pre-planned task under various indoor environments with weak positioning signals and strong interference signals; the aircraft control system 105 is a control system capable of stabilizing the flight attitude of the unmanned aerial vehicle and controlling the unmanned aerial vehicle to fly autonomously or semi-autonomously, is a core system of the whole flight process of the unmanned aerial vehicle, such as take-off, air flight, task execution, return recovery and the like, is called as the brain of the unmanned aerial vehicle, and is the most critical module in the unmanned aerial vehicle; the communication module 106 includes a data transmission module and a graph transmission module. The data transmission module is designed with low power consumption, and has the function of transmitting the acquired data information to the ground command center in time through the MAVLINK protocol, and the image transmission module is used for realizing real-time remote video monitoring by using the unmanned aerial vehicle, so that the ground control center can make a next decision for the current environment; the execution module 107 is composed of 4 motors with the same model number, and is used for executing action instructions provided by the airplane control system 105, so that the posture, the speed and the direction of the unmanned aerial vehicle are changed, and an important foundation is laid for completing a preset task; the power module 108 is divided into two parts, namely control power supply and power supply, and is used for providing energy guarantee for normal work of each module of the unmanned aerial vehicle system platform.

TABLE 1

Table 1 is the unmanned aerial vehicle system hardware type and quantity table.

Specifically, hardware related to the unmanned aerial vehicle in table 1 is assembled according to an unmanned aerial vehicle assembly course and official installation courses of various module components, details such as positive and negative electrode wiring, interface positions, installation positions and the like of each component are repeatedly carefully checked in the assembly process, and the assembled unmanned aerial vehicle can be debugged after the situation that the details are correct is confirmed.

Specifically, the debugging method of the unmanned aerial vehicle comprises the following steps: firstly, installing a mission planner ground station on a personal notebook computer (PC) (a computer used by a system platform is: think of thinpad T14 Gen 1, a memory 24G and a hard disk 1T), secondly, connecting the unmanned aerial vehicle flight control with a USB interface at the PC end by using a data line, after burning APM firmware of a stable version for the unmanned aerial vehicle flight control, finally, connecting the unmanned aerial vehicle flight control by setting a correct port and baud rate at the ground station, and at the moment, enabling components corresponding to each module of the unmanned aerial vehicle and setting parameters can be adjusted and modified by the ground station software. Fig. 7 is a schematic diagram of a real object of an applied unmanned aerial vehicle system platform.

Specifically, the method for establishing the simulation platform comprises the following steps: the problem that the unmanned aerial vehicle can normally fly through the operation mode with strong manual operability such as a remote control or a data transmission platform is solved, the autonomy of the unmanned aerial vehicle is not strong enough, the system platform installs a Dronekit through a 4B onboard computer arranged on the raspberry (the Dronekit is a Python library used for controlling the unmanned aerial vehicle, the Dronekit provides an API used for controlling the unmanned aerial vehicle, the code of the Dronekit is independent of flight control), and the raspberry is sent to be communicated with a flight control panel through a serial port direct connection mode, and the purpose of controlling the unmanned aerial vehicle by the code is achieved. In order to avoid danger caused by the fact that the unmanned aerial vehicle is out of control, the simulation platform is used for verifying the correctness of the compiled codes, an Ubuntu16.04 system platform provided with an ArduPilot simulation development environment and a three-dimensional simulation platform gazebo is set up for the unmanned aerial vehicle system, and the raspberry compiling program can be verified through the simulation platform on a notebook computer.

Specifically, the simulation test and actual flight verification method comprises the following steps: the invention mainly utilizes a genetic algorithm and a VFH obstacle avoidance algorithm to realize the selection of the optimal path of the unmanned aerial vehicle under the condition of facing various indoor and outdoor complex obstacles. The parameters of the genetic algorithm used by the designed path optimization mode are as follows: 1. the population size is as follows: 20-80 parts; 2. number of termination iterations of the genetic algorithm: 100 to 1000; 3. cross probability: 0.1 to 0.99; 4. the mutation probability: 0.0001 to 0.1. In addition, in the path optimization method, the angular resolution α of the VFH obstacle avoidance algorithm is 5 °.

Referring to fig. 7, fig. 7 is a schematic diagram illustrating an outdoor path planning provided in an embodiment of the present application. Under outdoor condition, this system utilizes GPS and big dipper bimodulus orientation module ATK1218-BD to carry out outdoor location, compares other single orientation module, and the positioning accuracy of this application has comparatively obvious promotion, and the real-time orientation accuracy of the outdoor orientation module of this application can reach 1 to 3 meters, and the difference of millimeter can be discerned even to non-real-time location, and positioning error can reduce to centimetre level, and this satisfies outdoor planning task demand completely.

Specifically, the specific steps of the outdoor planning of the unmanned aerial vehicle system platform are as follows: step one, compiling python codes based on a genetic algorithm and a VFH (virtual fault indicator) obstacle avoidance algorithm by using Dronekit installed in a raspberry pi 4B, repeatedly using a three-dimensional simulation platform for verification, and changing a connection address compiled in the python codes of a simulation test from a raspberry pi (Internet protocol) address to a connection port of an actual raspberry pi and unmanned aerial vehicle flight control under the condition of ensuring that the compiled codes are correct; setting corresponding parameters in a parameter table in ground station software to enable an outdoor positioning module to be normally started, starting other modules of the unmanned aerial vehicle system platform except the positioning module, and placing the unmanned aerial vehicle to a flying starting point after each module of the unmanned aerial vehicle is normally started; connecting the PC and the raspberry pie to the same local area network (the selection of the local area network depends on the distance range of the actual planning task); and step four, the Ubuntu16.04 terminal of the PC is connected with the raspberry pie by utilizing a ssh command, the terminal enters a directory where the test code is located, and the written python code is executed by inputting a command, so that the unmanned aerial vehicle can complete actual flight tasks of unlocking, taking off, executing an optimal path, avoiding obstacles until reaching a terminal point, landing and locking according to the logic of the code. This is the outdoor path planning process in a path optimization manner.

Referring to fig. 8, fig. 8 is a schematic diagram illustrating an indoor path planning provided by an embodiment of the present application. Different from the outdoors, because the GPS and the Beidou signals received by the unmanned aerial vehicle system platform are weak indoors, the outdoor positioning module cannot be normally started for positioning, the infrared device, the binocular vision camera and the ultrasonic positioning device are started to realize indoor positioning, the positioning error is centimeter level, and the starting and operation processes of other modules are basically consistent with the outdoor path planning.

Specifically, the innovation of the invention is to provide a path optimization mode based on a genetic algorithm and combined with a VFH obstacle avoidance strategy, and apply the method to the proposed unmanned aerial vehicle platform, so that the unmanned aerial vehicle platform can realize path optimization under indoor and outdoor complex environments according to the path optimization mode. Compared with the traditional path optimizing mode, the path optimizing mode has stronger applicability and more reasonable searched optimal route.

Specifically, the invention has at least the following advantages: compared with other traditional algorithms, the algorithm has the advantages that the unmanned aerial vehicle can effectively avoid traps of local optimal values in the path searching process due to the unique searching mode, and guarantee is provided for searching for global optimal values. Secondly, when the genetic algorithm idea is adopted to search for the optimal path, compared with the traditional heuristic search and the traditional enumeration search, the method has the advantages of better convergence, higher calculation precision, shorter calculation time and higher robustness. And thirdly, the genetic algorithm can be combined with other algorithms, such as particle swarm algorithm, ant colony algorithm, immune algorithm and other path planning algorithms, or obstacle avoidance algorithms such as visual graph method, artificial potential field method and VFH are utilized to better realize the optimal path selection of the unmanned aerial vehicle under various complex conditions. And fourthly, a VFH obstacle avoidance algorithm is adopted, and compared with other common obstacle avoidance algorithms such as a visual graph method and an artificial potential field method, the algorithm has lower precision requirements on some hardware equipment such as a sensor and the like, and has flexibility and autonomy. And when the unmanned aerial vehicle faces a narrow path or the distance between adjacent obstacles is too close, a feasible optimal path can be found better, and the situation that the optimal path is missed in the searching process of the unmanned aerial vehicle is avoided. And fifthly, the outdoor positioning system of the platform adopts a double-navigation module which is formed by a Beidou navigation module independently researched and developed in China and a GPS module in the United states, has higher positioning precision and stronger anti-interference capability compared with a GPS single-navigation module adopted by most unmanned aerial vehicle research institutions, and lays a foundation for the unmanned aerial vehicle to carry out accurate outdoor path planning. Sixth, what the indoor positioning system of this platform adopted is that binocular vision camera collocation infrared device and ultrasonic positioning module synthesize and realize indoor location, have improved indoor positioning accuracy greatly, provide the guarantee for unmanned aerial vehicle realizes indoor path planning. And seventhly, the unmanned aerial vehicle system platform can also meet dynamic local planning on the basis of meeting the static global planning, and provides favorable conditions for solving the optimal path under various complex environmental conditions.

Referring to fig. 9, fig. 9 is a schematic structural diagram illustrating an unmanned aerial vehicle control path optimizing apparatus according to an embodiment of the present application. As shown in fig. 9, the drone control path optimization device 20 includes: a first obtaining module 201, a first calculating module 202, a second obtaining module 203, a third obtaining module 204, a first determining module 205, a second calculating module 206, a second determining module 207, a third determining module 208 and a fourth determining module 209. A first obtaining module 201, configured to obtain path nodes and number of the unmanned aerial vehicles, and randomly arrange the path nodes to generate random paths; a first calculating module 202, configured to calculate a fitness value of the random path, and select a target path according to the fitness value; the second obtaining module 203 is configured to obtain obstacle environment data of the unmanned aerial vehicle when the unmanned aerial vehicle flies according to the target path; a third obtaining module 204, configured to use an actual flight position of the unmanned aerial vehicle as a central point, generate a moving window according to the obstacle environment data, divide the moving window into a plurality of continuous two-dimensional grids, and obtain an obstacle probability value of each two-dimensional grid; a first determining module 205, configured to determine a grid vector of a two-dimensional grid corresponding to the obstacle probability value according to the obstacle probability value; the grid vector comprises a grid vector value and a grid vector angle; a second calculating module 206, configured to perform region division on the active window, and calculate a regional obstacle density of the region according to a grid vector value of a grid vector in the region; a second determining module 207, configured to determine a target area according to the area obstacle density; a third determining module 208, configured to determine a target direction according to the target area; and a fourth determining module 209, configured to fly according to the target path, and when encountering an obstacle, avoid according to the target direction, and further determine an actual flight path of the unmanned aerial vehicle. Therefore, the implementation of the device can be referred to the implementation of the unmanned aerial vehicle control path optimization method, and repeated details are omitted.

Based on the same application concept, referring to fig. 10, fig. 10 is a schematic structural diagram of an electronic device 30 provided in the embodiment of the present application, including: a processor 301, a memory 302 and a bus 303, the memory 302 storing machine-readable instructions executable by the processor 301, the processor 301 and the memory 302 communicating via the bus 303 when the electronic device 30 is operating, the machine-readable instructions being executable by the processor 301 to perform the steps of the method for optimizing a path for a drone control as in any one of the above embodiments.

Based on the same application concept, embodiments of the present application further provide a computer-readable storage medium, where a computer program is stored on the computer-readable storage medium, and when the computer program is executed by a processor, the steps of the method for optimizing the path under unmanned aerial vehicle control provided by the above embodiments are performed. Specifically, the storage medium can be a general storage medium, such as a mobile disk, a hard disk and the like, when a computer program on the storage medium is run, the unmanned aerial vehicle control path optimization method can be executed, the technical problem that the unmanned aerial vehicle is not suitable for dynamic planning under the condition of facing a complex environment in the prior art is solved by a path optimization method based on a genetic algorithm and combined with a VFH obstacle avoidance strategy, and the method is applied to the proposed unmanned aerial vehicle platform, so that the technical effect that the unmanned aerial vehicle platform can realize path optimization under indoor and outdoor complex environments is achieved.

It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the system and the apparatus described above may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again. In the several embodiments provided in the present application, it should be understood that the disclosed system, apparatus and method may be implemented in other ways. The above-described embodiments of the apparatus are merely illustrative, and for example, a division of a unit is merely a division of one logic function, and there may be other divisions when actually implemented, and for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted, or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection of devices or units through some communication interfaces, and may be in an electrical, mechanical or other form.

Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment. In addition, functional units in the embodiments of the present application may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit. The functions, if implemented in the form of software functional units and sold or used as a stand-alone product, may be stored in a non-volatile computer-readable storage medium executable by a processor. Based on such understanding, the technical solutions of the present application may be essentially implemented or are part of the technical solutions or parts of the technical solutions contributing to the prior art, and the computer software product is stored in a storage medium and includes several instructions for enabling a computer device (which may be a personal computer, a server, or a network device) to execute all or part of the steps of the methods of the embodiments of the present application. And the aforementioned storage medium includes: various media capable of storing program codes, such as a usb disk, a removable hard disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a magnetic disk, or an optical disk. The above description is only for the specific embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily conceive of the changes or substitutions within the technical scope of the present application, and shall be covered by the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

26页详细技术资料下载
上一篇:一种医用注射器针头装配设备
下一篇:一种多传感器融合的无人机复杂天候飞行控制方法

网友询问留言

已有0条留言

还没有人留言评论。精彩留言会获得点赞!

精彩留言,会给你点赞!

技术分类