Summary of the invention
In order to solve the problems in the existing technology, the present invention therefore, using A* algorithm combination modified embedded-atom method,The advantages of two methods algorithm can be made full use of, provides a kind of water quality sampling cruise ship path planning optimal method, this methodPath planning problem under component environment unknown situation is efficiently solved, equipment cost is reduced, furthermore algorithm search is high-efficient, spendsTime cost is few.
A kind of water quality sampling cruise ship path planning optimal method provided by the invention, specifically comprises the following steps:
Step 1: with the image of unmanned plane camera acquisition lake surface, image procossing is carried out using Grid Method, obtains lake surface twoCoordinate diagram is tieed up, zone of ignorance blank clear space domain representation carries out selection and the portion of path point in lake surface two-dimensional coordinate figureAdministration;
Step 2: in the two-dimensional coordinate figure of lake surface, the global optimum road from starting point to target point is obtained using A* algorithmDiameter;
Step 3: to obtained global optimum path from starting point to target point retrieval, judge whether current path point is targetPoint, if so, turning step 7;If not target point, further judge whether current path point is zone of ignorance, if it is not,Turn step 4;Otherwise turn step 5.
Step 4 stores current path point, and marches to next path point, updates current path point, returns to step 3.
Step 5 detects zone of ignorance environment using laser range finder if current path point is zone of ignorance,Local optimum path is obtained using modified embedded-atom method, turns step 6;Else if being unable to get local optimum path, then existZone of ignorance cartographic information is updated in two-dimensional coordinate figure, returns to step 2.
Step 6: same area path in the local optimum path replacement A* algorithm that Artificial Potential Field Method is obtained returns to the 4thStep;
Step 7 integrates the path point in global optimum path.
The integration refers to:
From the off, the path point after retrieving, judges whether starting point and the line of this path point pass through barrier, i.e.,Whether with barrier intersection point is had, if next path point is retrieved in continuation backward without intersection point;If there is intersection point, with current searching routeThe previous path point of point is anchor point, connection source and anchor point, and is that new starting point continuation is retrieved backward with anchor point, is gone forward side by sideRow barrier intersection point judgement, until retrieving to target point.
Described is as follows the step of obtaining local optimum path using modified embedded-atom method:
Step 5.1: the lake surface information obtained using laser range finder is carried out image procossing and is converted into two-dimensional coordinate gridFigure, setting improve Artificial Potential Field algorithm relevant parameter, including investigative range r, gravitation gain coefficient k, repulsion gain coefficient m,The number of iterations j, barrier influence distance d, step-length p;
Step 5.2: cartographic information in completion investigative range, whether the local path target point after determining map rejuvenation is barrierHinder object: if YES, then returning to step 2;If NO, then it calculates current path point position X and influences apart from interior barrierRepulsion FrepWith the gravitation F of target pointatt;
Repulsion F of the barrier to current path point position XrepCalculation formula is as follows:
Wherein
UrepIt (X) is improvement repulsion potential field function, XoPosition of a certain barrier in two-dimensional coordinate is represented, m repairs for repulsionPositive divisor index, Xg are position of the target point in two-dimensional coordinate, Frep1、Frep2Respectively repulsion is decomposed works as in barrier directionThe component in target point direction is directed toward in preceding path point direction, current path point.As current path point position X and Obstacle Position Xo'sDistance | X-Xo | when being greater than barrier influences distance d, barrier generates current path point without active force.With cruise ship and meshThe distance of punctuate is closer, and the repulsion being subject to is smaller, solves the problems, such as the goal nonreachable of traditional artificial potential field method.
Frep1、Frep2Specific formula is as follows:
It is obtained by formula, as the value of n is bigger, the repulsion that obtained current path point is directed toward target point direction is bigger,Effect is more obvious, but calculation amount is also gradually increased, and is increased algorithm time cost, is learnt by many experiments in two-dimensional coordinateMiddle selection n=2 both can guarantee the accuracy of result while reduce calculation amount, shorten Riming time of algorithm;
Step 5.3: calculating target point to the gravitation of current path point, calculate in influence apart from interior barrier to current roadThe repulsion of diameter point obtains the resultant force of gravitation and repulsion suffered by the current path point;
Step 5.4: it calculates the resultant force of current path point and determines whether resultant force is 0, it is random using orientation if it is 0A method is taken, next path point is found;If not being 0, according to resultant direction traveling one step suffered by current path pointDistance;
Step 5.5: judging if YES, then to adopt in path is advanced with the presence or absence of problem is shaken repeatedly in certain two pointWith randomized is oriented in step 5.4, if NO, then the resultant direction traveling one step being subject to according to current path point away fromFrom;
Step 5.6: determining whether to reach 2000 upper limits of the number of iterations, still can not reach target point, if YES, thenReturn to step 2;If NO, then it reaches target point and records travel path point in Artificial Potential Field Method later;
The present invention has the advantages that
(1) image procossing is carried out to target lake environment image, lake surface image is converted to two-dimensional grid image coordinate, savedAbout cruise ship time for cooking up optimal path.
(2) present invention is able to solve the path planning problem under circumstances not known, allows image capture device precision not high, canTo carry out fuzzy acquisition to environment, equipment cost has been saved, it is higher to the adaptability of environment.
(3) the invention proposes modified embedded-atom method, the ship that cruises is less prone to problem in the searching process of path, improvesThe stability of path planning algorithm, so that the effect of path planning is also more stable.
(4) to the integration of optimal path point, the total angle of rotation degree of cruise foot on the way is shortened, cruise shipping agency is reducedThe total distance sailed, thus for save water quality sampling cruise ship electric quantity consumption play the role of it is very big so that cruise ship continuation of the journeyAbility improves.
Specific embodiment
The present invention is described in detail with reference to the accompanying drawing.
The present invention provides a kind of water quality sampling cruise ship path planning optimal method, is combined and is improved manually using A* algorithmPotential field method finds optimal path.Process as shown in Figure 1, water quality sampling cruise ship paths planning method provided by the invention, specificallyInclude the following steps:
Step 1: acquiring lake surface image with unmanned plane camera, image procossing obtains lake surface two-dimensional coordinate figure.
Since the limitation of unmanned plane camera device precision can not acquire detailed lake surface image, there are partial region image lettersBreath is not zone of ignorance entirely, carries out image procossing using Grid Method and obtains lake surface two-dimensional coordinate figure, zone of ignorance blank is without barrierHinder region to indicate, the selection and deployment of path point are carried out in lake surface two-dimensional coordinate figure;
Step 2: the global optimum path from starting point to target point is obtained using A* algorithm on lake surface two-dimensional coordinate figure,As shown in Fig. 2, specifically comprising the following steps:
(2.1) according to the lake surface two-dimensional coordinate figure of acquisition, the relevant parameter of A* algorithm is set, OPEN list is starting point, is depositedStorage was searched for but still unbeaten non-obstacle object point, CLOSE list be obstructed paths point and the path point passed by,Optimal_path is that empty array is used for optimal storage path point;
(2.2) from current path point to 8 direction neighbour's lattice extensions around, path reachable around current path point is foundPoint excludes in CLOSE list obstructed paths point and the path point passed by, calculates separately other path point valuation functionsf(X);
The valuation functions formula is as follows:
F (X)=h (X)+g (X)
Wherein h (X) is distance of the starting point to current path point X, and g (X) is distance of the current path point X to target point, away fromIt is specific as follows from the Euclidean distance calculation formula that calculation formula is two-dimensional space:
(X1,Y1)、(X2,Y2) it is different coordinates, d is coordinate (X1,Y1) and (X2,Y2) the distance between two points.
(2.3) valuation functions f (X) the smallest path point as next path point and is stored in Optimal_path arrayIn;If its valuation functions is updated in the existing OPEN list of remaining path point, conversely, being then directly stored in OPEN list;
(2.4) when reaching next path point, current path point is updated, this path point is stored in CLOSE list, determines thisWhether path point is target point, is then to terminate, obtains global optimum path;It is no, then return step (2.2).
Step 3: judging whether current path point is mesh to obtained global optimum path from starting point to target point retrievalPunctuate, if so, going to step seven;If not target point, further judge whether current path point is zone of ignorance, if notIt is to go to step four;Otherwise five are gone to step.
Step 4 stores current path point, and marches to next path point, updates current path point, return step three.
Step 5 detects zone of ignorance environment using laser range finder if current path point is zone of ignorance,Local optimum path is obtained using modified embedded-atom method, goes to step six;Else if be unable to get local optimum path, then,Update zone of ignorance cartographic information in two-dimensional coordinate figure, return step two.
When the ship that cruises is travelled according to global optimum's path point by way of zone of ignorance, using laser range finder to zone of ignoranceEnvironment is detected, using modified embedded-atom method, using current path point as local path starting point, laser range finder detection rangeGlobal path point is local path target point at 2/3, plans local optimal path;If final path, basis cannot be obtainedDetection result updates zone of ignorance cartographic information, return step two.
Described obtains local optimum path, process as shown in Figure 3 using modified embedded-atom method, the specific steps are as follows:
(5.1) the lake surface information obtained using laser range finder is carried out image procossing and is converted into two-dimensional coordinate grid map, ifSurely the relevant parameter of Artificial Potential Field algorithm is improved, including investigative range is 5 lattice *, 5 lattice, gravitation gain coefficient k is 14, repulsion gainCoefficient m is 4.2, the number of iterations j is 2000, barrier influence distance d is 2.5, step-length l is 0.5;
(5.2) completion zone of ignorance cartographic information, whether the local path target point after determining map rejuvenation is barrier:It is, then return step two;It is no, then it calculates current path point X and influences the repulsion F apart from interior barrierrepWith the gravitation of target pointFatt;
Repulsion F of the barrier to current path point XrepCalculation formula is as follows:
Wherein
Frep1、Frep2Respectively repulsion, which is decomposed, is directed toward current path point direction, current path point direction target point in barrierThe component in direction, m are repulsion modifying factor index, and Xg is position of the target point in two-dimensional coordinate.UrepIt (X) is improvement repulsionPotential field function, XoPosition of a certain barrier in two-dimensional coordinate is represented, when current path point is at a distance from barrier | X-Xo| it is bigWhen barrier influences distance d, barrier generates current path point without active force.As distance objective point is closer, repulsion is got overIt is small, solve the problems, such as goal nonreachable.
It is obtained by above-mentioned two formula:
It is obtained by formula, as the value of n is bigger, obtained repulsion is bigger, and effect is more obvious, and same calculation amount increases,N=2 is selected both to can guarantee the accuracy of result while having reduced calculation amount in two-dimensional coordinate.
Gravitation F of the target point to current path pointattCalculation formula is as follows:
Fatt=-grad [Uatt(X)]=k (Xg-X)
Wherein:
UattFor gravitational potential field function, current path point is proportional to target point and current path point to suffered gravitationSquare of distance, proportionality coefficient k.
(5.3) target point is calculated to the gravitation of current path point, and calculates influence apart from interior barrier to current path pointRepulsion, and then obtain the resultant force of the gravitation and repulsion;
(5.4) determine whether resultant force is 0: being, then a method is taken using orientation at random;It is no, then according to suffered by current path pointThe resultant direction traveling one step distance arrived;
(5.5) judge to shake problem repeatedly with the presence or absence of certain two point in path is advanced, as current path point X (i) withPath point X (i-2) is identical, i be path point serial number, then it is assumed that the two path points are shaken, at this point, then using orientation withMachine takes a method, finds next path point, updates current path point, no, then is advanced according to the resultant direction that current path point is subject toOne step distance updates current path point;
(5.6) determine whether current path point is target point, if it is, record travel path point, obtains local optimumPath terminates;Otherwise determine whether to reach 2000 upper limits of the number of iterations, if it is, return step (5.3), otherwise basisThe resultant direction traveling one step distance that current path point is subject to updates current path point.
Step 6: same area path in the local optimum path replacement A* algorithm that Artificial Potential Field Method is obtained, returns to stepRapid four.
Step 7: N number of path point in global optimum path is integrated, specifically:
From starting point x1Along the global optimum path searching route point { x backward of planningk| k=2,3, N } and, traversal is adjacentNearly barrier node, if x1、x2Line and barrier without intersection point, then continue to retrieve backward, until x1With xmThe line of (m≤N)Across barrier, x is takenm-1As anchor point, with x1With xm-1As endpoint, by x1With xm-1Line replacement same endpoints between roadDiameter, and with xm-1As new starting point, continue searching route point backward, until reaching target point.
The orientation that the present invention uses in step (5.4), step (5.5) takes a method at random, the specific steps are as follows:
Step A: it is the line L of current path point X and target point;
Step B: the straight line across X and vertical L is done, and takes two o'clock a, b apart from X unit step-length on straight line;
Step C: the point X on line L apart from X unit step-length is taken1It does across X1And the straight line of vertical L, and take on straight line away fromFrom X1Two o'clock c, d of one step;
Step D: in a, b, c, d, X1Appoint to take in 5 points and is a little used as next path point.