Water surface path planning method based on genetic algorithm

By applying a genetic algorithm-based method in water robot path planning, combined with deep learning and sliding mode ideas, the problems of low efficiency and poor adaptability of path planning in the existing technology are solved, and efficient and safe path planning in complex water environments are achieved.

CN120066028AInactive Publication Date: 2025-05-30ZHEJIANG UNIV OF SCI & TECH

Patent Information

Application Number
CN202510195284.2
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-02-21
Publication Date
2025-05-30
Estimated Expiration
Not applicable · inactive patent

AI Technical Summary

Technical Problem

Existing water robots have problems with low efficiency and poor adaptability in path planning, especially in dynamic water environments, which are difficult to plan reasonable operation paths.

Method used

The water surface path planning method based on genetic algorithm is adopted, combined with the deep learning YOLOv8 object detection model and sliding mode idea, the initial path is generated and the crossing and variation probability is dynamically adjusted through the fitness function optimization, and finally the path smoothing is used using the Bezier curve.

Benefits of technology

It realizes accurate and stable path planning for robots in complex water environments, improves the efficiency and adaptability of path planning, and ensures the economic and safety of paths.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN120066028A_ABST
    Figure CN120066028A_ABST
Patent Text Reader

Abstract

The invention discloses a water surface path planning method based on a genetic algorithm. The water surface path planning method specifically comprises the following steps of 1, obtaining position information of a robot and collecting image data in real time; 2, performing target detection on the acquired image data based on a deep learning YOLOv8 target detection model; according to the target detection result, based on a sliding mode thought, determining a target number and performing number judgment, and according to a number judgment result, performing coordinate transformation on the target detection result; 3, outputting a global planning path by adopting a genetic algorithm according to a result obtained by robot position and coordinate conversion; and 4, in the process that the robot advances according to the global planning path, an improved dynamic window algorithm is adopted to carry out local path planning adjustment, and the local path planning adjustment comprises establishment of a robot kinematics model, robot speed sampling and selection of an optimal track by using an evaluation function. According to the invention, accurate and stable path planning of the robot in a complex water area environment can be realized, and the efficiency and adaptability of path planning are improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention belongs to the field of robot path planning technology, and specifically relates to a water surface path planning method based on genetic algorithm. Background Art

[0002] In today's increasingly severe environmental situation, water disasters such as algal blooms and red tides frequently break out, posing a serious threat to the ecological environment, water resource utilization and human health. The core cause of these water disasters is eutrophication of water bodies, and the excessive concentration of elements such as nitrogen and phosphorus leads to excessive proliferation of microalgae. Traditional algae cleaning mainly relies on manual methods, with professionals driving ships to perform fixed-point and regular operations. However, this traditional operation mode has obvious disadvantages. With the continuous advancement of science and technology, water algae cleaning robots have emerged and gradually entered the public eye. However, compared with the vigorous development of intelligent technologies such as driverless cars, the development of water robots in the field of path planning is relatively lagging. In particular, the current research on water robots for algae cleaning is still in its infancy. When the algae cleaning water robot detects the algae target, how to plan a reasonable operation path, efficiently reach and fully cover the cleaning area has become a key problem that needs to be solved. The Chinese invention with the authorization announcement number CN110347151B involves a robot path planning method integrating Bezier optimization genetic algorithm. The method first uses Bezier curves to optimize the initial solution of the genetic algorithm and the path generated during the crossover and mutation process to eliminate the peak turning points and reduce redundant nodes, thereby improving the path smoothness; then the fitness function with increased safety distance and adaptive penalty factor is used to dynamically adjust the path obtained by the genetic algorithm to improve the quality of the planned path. However, the path planning strategy of this method is single and its adaptability and efficiency in dynamic water environments still need to be further improved. Summary of the invention

[0003] The purpose of the present invention is to provide a water surface path planning method based on genetic algorithm. The present invention can realize accurate and stable path planning of the robot in a complex water environment, and improve the efficiency and adaptability of path planning.

[0004] The technical solution of the present invention is a water surface path planning method based on genetic algorithm, which specifically comprises the following steps:

[0005] Step 1: Obtain robot position information and collect image data in real time;

[0006] Step 2: Perform target detection on the collected image data based on the YOLOv8 target detection model based on deep learning; according to the target detection results, determine the number of targets based on the sliding mode idea and perform quantity judgment, and transform the target detection results according to the quantity judgment results;

[0007] Step 3: Generate an initial path using the genetic algorithm based on the robot's position and the result of coordinate transformation; comprehensively consider the economy and safety of the path, calculate the individual fitness value of each initial path through the fitness function; use elitist selection to retain the initial paths with high individual fitness values, and select the remaining initial paths through the roulette wheel strategy to increase the diversity of the path population; dynamically adjust the adaptive crossover probability and adaptive mutation probability of the genetic algorithm to optimize the initial path search process and obtain the optimal path; use Bezier curves to smooth the optimal path and output the global planned path;

[0008] Step 4: During the process of the robot moving along the global planned path, in response to dynamic environmental changes, adjust the local path planning in real time to ensure that the robot safely completes the moving task.

[0009] In the above-mentioned water surface path planning method based on the genetic algorithm, in Step 2, the sliding mode idea is used to handle the relationship between the target overlap degree and the distance between targets;

[0010] The process of handling the target overlap degree is to define a sliding mode surface s o =O - O th , where O is the actually detected target overlap degree, and O th is the set reasonable overlap degree threshold; when s o =0, it means being in the ideal sliding mode, that is, the target overlap degree is in a reasonable state; if O > O th , it means the overlap degree is too high, and there is a situation where multiple targets are misjudged as one, and target segmentation is performed; if O < O th , then the overlap degree is normal;

[0011] The process of handling the distance relationship between targets is to define a sliding mode surface s D =D - D th , where D is the actual distance between targets, and D th is the reasonable distance threshold set according to the target distribution characteristics. When the detected distance between targets deviates from D th , dynamic adjustment is performed according to the deviation situation to ensure being in the desired operating state of the distance between targets.

[0012] In the above-mentioned water surface path planning method based on the genetic algorithm, in Step 3, the process of the genetic algorithm generating the initial path is as follows: First, set the key parameters of the genetic algorithm, including the population size, the maximum number of iterations, the crossover probability, the mutation probability, and the adaptive parameter, and randomly generate an initial path population according to the population size where the i-th initial path S i =[s s ,s i1 ,s i2 ,···se (i = 1, 2, ··· n), s ij (j = 1, 2, ··· k) is the path point passed by the initial path S i s s and s e are the starting point and the ending point of the initial path respectively.

[0013] In the above-mentioned water surface path planning method based on the genetic algorithm, the formula for calculating the individual fitness value of each initial path by the fitness function is:

[0014] f S = af 1 (S) + bf 2 (S);

[0015] Among them, f S represents the individual fitness value of the initial path, a and b are weight coefficients, f 1 (S) and f 2 (S) represent the economy and safety of the initial path respectively;

[0016] The formula for calculating the economy of the initial path is:

[0017]

[0018] Among them, len(S i ) is the length of the initial path;

[0019] The formula for calculating the safety of the initial path is:

[0020]

[0021] dan(S i ) = 1 / d i ;

[0022] Among them, dan(S i ) is the reciprocal value of the distance between the robot and the obstacle during driving; d i represents the shortest distance between the robot and the obstacle during driving.

[0023] In the above-mentioned water surface path planning method based on the genetic algorithm, the process of elite selection is to select the top N initial paths in descending order according to the calculated individual fitness values of the initial paths and add them to the new path population; 1 The process of using the roulette wheel strategy to select the remaining initial paths is as follows:

[0024] The process of using the roulette wheel strategy to select the remaining initial paths is:

[0025] (1) From the Nth 1The probability of the selected path is calculated starting from the +1 initial path in sequence:

[0026]

[0027] Among them, is the individual fitness value of the initial path S i .

[0028] (2) Calculate the cumulative probability value q i :

[0029]

[0030] (3) Generate a random number r ∈ [0, 1];

[0031] (4) If select the N 1 +1th path; otherwise, select S j that satisfies q j-1 <r ≤ q j ;

[0032] (5) Repeat the processes of (3) and (4) until the number of selected populations N 2 is reached, and add the initial path corresponding to this individual fitness value to the new path population.

[0033] In the above-mentioned water surface path planning method based on genetic algorithm, the formula of the adaptive crossover probability P c is:

[0034]

[0035] Among them, f max represents the maximum fitness of the current path population, f avg represents the average individual fitness value of the current path population, f is the larger individual fitness value of the two paths to be crossed, k 1 and k 2 are respectively constants between 0 and 1;

[0036] The formula of the adaptive mutation probability P e is as follows:

[0037]

[0038] Among them, f' represents the fitness of the mutation operation path; k 3 and k 4 are respectively constants between 0 and 1.

[0039] In the above-mentioned water surface path planning method based on genetic algorithm, the nth order curve formula of the Bezier curve is as follows:

[0040]

[0041] Wherein, P(t) is the motion control point of the Bessel curve, and P i is the position point, P(0) and P(1) are the starting point and the ending point respectively, and B i,n (t) is the Bernstein basis function, is the binomial coefficient, also known as the combination number, representing the combination number of taking i elements from n different elements, where n is a non-zero positive integer, the value range of i is from 0 to n, and t is the interpolation on the Bessel curve, with the value range between [0, 1].

[0042] In the aforementioned water surface path planning method based on the genetic algorithm, in step four, the local path planning process includes establishing a kinematic model of the robot, then sampling the robot speed space (v, ω), and then simulating the trajectory within time t in this speed space (v, ω) based on the kinematic model of the robot, calculating the evaluation function of the simulated trajectory, and finally selecting the trajectory with the optimal evaluation function value to obtain the local optimal path, so as to improve the accuracy and efficiency of path planning.

[0043] In the aforementioned water surface path planning method based on the genetic algorithm, the establishment of the kinematic model of the robot is

[0044] x t+Δt = x t + v x Δt cosθ t - v y Δt sinθ t ;

[0045] y t+Δt = y t + v x Δt sinθ t + v y Δt cosθ t ;

[0046] θ t+Δt = θ t + ω t Δt;

[0047] Wherein, x t+Δt is the abscissa of the robot at time t + Δt, y t+Δt is the ordinate of the robot at time t + Δt, x t is the abscissa of the robot at time t, y t is the ordinate of the robot at time t, v x and v y are the linear velocities of the robot along the x and y axes at time t in the chassis coordinate system, and θ tis the angle between the robot and the x-axis at time t, ω t is the angular velocity of the robot at time t, θ t+Δt is the angle between the robot and the x-axis at time t+Δt.

[0048] In the above-mentioned water surface path planning method based on genetic algorithm, the process of sampling the robot speed is to sample the speed space of the mobile robot within the window area. There are infinitely many sets of speed pairs (v, ω) in the speed space. Set the boundary limit conditions:

[0049] v m ={(v, ω)|v∈[v min , v max ∧ ω∈[ω min , ω max};

[0050] In the formula, v m is the limit range of the maximum speed and minimum speed of the robot, v max and v min are the maximum linear speed and minimum linear speed that the robot can reach respectively, ω max and ω min are the maximum angular speed and minimum angular speed that the robot angular velocity can reach respectively;

[0051] Further, the constrained speed space v d is:

[0052]

[0053] In the formula, v c is the current linear speed of the robot, is the maximum acceleration, and Δt is the time interval; is the maximum deceleration; ω c is the current angular velocity of the robot, is the maximum angular acceleration; is the maximum angular deceleration;

[0054] Set the speed space with maximum acceleration limit:

[0055]

[0056] In the formula, dist(v, ω) represents the path length between the robot and the nearest obstacle;

[0057] During one Δt of the forward cycle of the water robot, the effective speed set interval v is:

[0058] v = v m ∩v d ∩v a ;

[0059] The formula of the evaluation function is as follows:

[0060] G(v, ω) = σ(α·head(v, ω) + β·dist(v, ω) + γ·vel(v, ω) + δpre(v, ω));

[0061] Among them, α, β, γ, and δ are the weight factors of each item; σ represents normalization; head(v, ω) is the azimuth evaluation function, which represents the azimuth deviation between the robot's traveling direction and the end point of the global planning path when moving to the end point of the local planning path at the current sampling speed; dist(v, ω) is the safety factor evaluation function, which represents the path length between the robot and the nearest obstacle; vel(v, ω) is the current speed magnitude evaluation function; pre(v, ω) is the target path distance evaluation sub-function, and the formula is as follows:

[0062]

[0063] Among them, (x te , y te ) are the coordinates of the end point of the predicted trajectory, and (x g , y g ) are the coordinates of the target point of the predicted trajectory.

[0064] Compared with the prior art, the present invention has the following beneficial effects:

[0065] The present invention adopts a strategy that combines global path planning and local path planning. The global path planning is based on an improved genetic algorithm, which generates an optimal global path by combining task requirements and environmental constraints. The local path planning adjusts the local path in real time according to the dynamic environmental changes, enabling the robot to plan a reasonable overall path in a complex and dynamic water environment and flexibly respond to local changes, with good flexibility and adaptability. In addition, by constructing a fitness function that includes economy and safety, taking into account the path length and the distance between the robot and obstacles, the planned path is both economical and safe. In practical applications, it can effectively reduce the driving distance of the robot, while reducing the risk of collision with obstacles and improving the operation efficiency and safety. The present invention combines elitist selection and roulette wheel selection strategies, retains paths with high individual fitness values to transmit excellent genes, and uses roulette wheel selection for the remaining paths to increase diversity, avoiding the algorithm falling into local optimal solutions, which helps to find the global optimal path in a complex water surface environment and ensures that the path planning of the robot is more scientific and reasonable. The present invention dynamically adjusts the adaptive crossover and mutation probabilities according to the evolutionary state of the path population, increasing the mutation probability in the initial stage to expand the search range and explore more potential paths, and reducing the probability in the later stage to accelerate the convergence speed and avoid the destruction of excellent genes. While ensuring the comprehensiveness of the search, it improves the convergence efficiency of the genetic algorithm and finds the optimal path faster. The present invention smooths the planned path using Bezier curves, reducing sharp inflection points in the path, making the path more compliant with the kinematic and dynamic constraints of the robot. This can not only reduce the energy consumption of the robot during driving, but also improve its motion stability, extend the service life of the robot, and ensure the continuity and efficiency of operations. The present invention improves the evaluation function by adding a target path distance evaluation sub-function and incorporating the global path into the evaluation system. When the robot performs local path planning, it can quickly move towards the target point, and at the same time, comprehensively consider factors such as the distance from obstacles, speed, and direction deviation, evaluate the trajectory from multiple dimensions, and select a better local path, improving the accuracy and efficiency of path planning. BRIEF DESCRIPTION OF THE DRAWINGS

[0066] Figure 1 is the flowchart of the method of the present invention;

[0067] Figure 2 is the internal and external module framework of the robot of the present invention;

[0068] Figure 3 is the main working program diagram of the robot of the present invention;

[0069] Figure 4 is the flowchart of the improved genetic algorithm of the present invention;

[0070] Figure 5 is the flowchart of the DWA local path planning of the present invention. DETAILED DESCRIPTION OF THE INVENTION

[0071] The present invention will be further described below in conjunction with the accompanying drawings and embodiments, but it shall not be used as a basis for limiting the present invention.

[0072] Embodiment

[0073] A water surface path planning method based on genetic algorithm, as Figure 1 shown, specifically includes the following steps:

[0074] Step 1: Obtain the robot position information and collect image data in real time;

[0075] In this embodiment, as Figure 2 shown, the water robot has an unmanned driving system and an external communication system. The unmanned driving system includes 4 systems: a perception system, a decision-making and planning system, a wireless communication system, and a control and execution system. These modules work together to achieve the autonomous driving of the robot. At the same time, it also relies on the external communication systems of the water robot - the mobile communication system, the PC communication system, and the cloud communication system to obtain information such as high-precision maps and water surface environment perception, providing support for the decision-making and path planning of the robot.

[0076] Unmanned driving module:

[0077] Perception system: The perception system uses a variety of advanced sensors to obtain the water surface and surrounding environment information in real time, providing data support for subsequent decision-making and control. The camera module adopts an improved YOLOv8 target detection model to achieve efficient recognition of water surface algae; while the lidar module and sonar module can be used for functions such as mapping and ranging on water / underwater; Navigation and positioning module: Combining GPS and IMU (Inertial Measurement Unit) to achieve precise positioning and state estimation of the robot; Ultrasonic module: Support the function of biological algae removal to reduce environmental pollution.

[0078] Decision-making and planning system: This system receives the data sent from the perception system and the data processed by the communication modules such as 5G / WiFi of the external communication system through the wireless communication system, including the detected algae position data, surrounding obstacle data, high-precision map, task instructions, etc. According to the data received from the perception system and the external communication system, formulate the behavior strategy and path planning of the robot. Global path planning: Based on the improved genetic algorithm, combined with task requirements and environmental constraints, generate the optimal global path. Local path planning: For dynamic environmental changes, adopt an improved dynamic window algorithm to adjust the local path in real time to ensure that the robot completes the task in a safe and efficient manner. Behavior decision-making module: Integrate the external environment and task instructions to formulate high-level behavior strategies, such as obstacle avoidance, biological algae removal, target tracking, etc.

[0079] Wireless communication system: Through high-speed transmission modules such as 5G / WiFi, it realizes data interaction between the robot and the external system. It not only supports real-time update of high-precision maps and environmental perception results, but also can receive external task instructions and feedback the robot's status.

[0080] Control and execution system: This system converts the high-level decisions and path planning results of the decision-making and planning system into specific robot actions. By controlling the output magnitude of the robot's motor module, it realizes the control of the robot's speed, steering, acceleration, etc. This system is not only responsible for path tracking, but also needs to adjust the robot's motion state in real time to ensure the safety and stability of driving.

[0081] External communication system: The external communication system is the core of the interaction between the water robot and the external environment. It includes a cloud communication system, a PC communication system, and a mobile communication system: Cloud communication system: Provides high computing power support for the robot, processes complex tasks (such as high-precision map generation and environmental data, etc.), and issues optimized task instructions. PC communication system: Provides the functions of task instruction issuance and real-time monitoring, facilitating remote operation and data analysis. Mobile communication system: Through portable terminals (such as smart phones or tablets), it realizes flexible control and status viewing of the robot.

[0082] Through the environmental information collection of the perception system, the strategy formulation of the decision-making and planning system, the data interaction of the wireless communication system, the precise action implementation of the control and execution system, and the efficient support of the external communication system, the water robot realizes highly intelligent and safe autonomous driving. This design of internal and external module collaboration provides a reliable and efficient solution for water path planning, promoting the development of intelligent water robot technology.

[0083] Figure 3 Shows the logical flow of the main program of the water robot's work. This program realizes the full-process control of the robot from startup to task completion, and has the dual capabilities of autonomy and remote operation. The main program has a clear logic and includes modules such as task reception, power detection, work mode switching, and task execution, ensuring the efficient operation of the robot in a complex water environment.

[0084] 1. Startup phase.

[0085] Robot startup: The robot sends its own status and position information to the external communication platform (such as the PC side, mobile side, or cloud data platform) through the wireless communication system. These information include the robot's current coordinates, operating status, and perception data. Task issuance: The external communication system issues high-precision maps, processed environmental data results, and specific work tasks according to the robot's current position, environmental conditions, and task requirements.

[0086] 2. Task reception phase.

[0087] Task instruction judgment: The robot detects whether it has received an external task instruction. If an instruction is received, the robot starts to execute the relevant work process according to the task content. Conversely, if no instruction is received, the robot remains in a standby state, periodically sends its own status, and waits for a task to be issued.

[0088] 3. Battery power monitoring stage.

[0089] Battery power threshold judgment: The robot monitors the battery power of its own battery in real time to ensure the continuity and safety of task execution. If the power is lower than the threshold, the robot stops the current task and charges and stores electricity by adjusting the solar panel. After the robot is fully charged, it automatically returns to the task execution process. If the power is higher than the threshold, the robot continues to execute the task without interruption.

[0090] 4. Task completion judgment.

[0091] Task completion check: The robot determines whether the work is completed according to the task instruction and the current status. If the robot's task is completed, the current process ends and it returns to the standby state. If the robot's task is not completed, it enters the task mode selection process.

[0092] 5. Task mode selection and execution.

[0093] The robot selects the following two working modes according to the task requirements or the operator's instructions: Remote control mode Task description: The robot enters a mode that is controlled in real time by the operator. Workflow: After receiving the remote control instruction, it performs precise movement, task operation, or specific path cruising according to the instruction. Automatic algae removal mode: Task description: The robot autonomously patrols the water area, uses the sensing system to detect the distribution of algae, and performs biological removal.

[0094] In this example, after the water robot is started, it samples its own status (such as position, speed) through the on-board sensors, and at the same time, it collects the image data of the surrounding water surface environment in real time, and sends the collected environmental image data to the PC side or the cloud data platform. The data platform preprocesses the transmitted image data, removes noise, and enhances the image features.

[0095] Step 2: Use the YOLOv8 object detection model based on deep learning to perform object detection on the collected image data; according to the object detection results, determine the number of objects based on the sliding mode idea and perform a quantity judgment, and perform coordinate transformation on the object detection results according to the quantity judgment results;

[0096] In this embodiment, the YOLOv8 object detection model based on deep learning is used to detect image data. The YOLOv8 object detection model has high detection speed, excellent accuracy, and strong generalization ability. If no algae target is detected, the robot will continue to perform water surface environment perception and data collection until algae are detected. If algae are detected, it will enter the algae quantity judgment and decision-making. If the judgment result is in line, coordinate transformation will be carried out.

[0097] In this embodiment, the algae quantity judgment and decision-making uses the sliding mode idea to determine the quantity of the detected algae. The sliding mode idea can accurately count the algae quantity under complex environments and data fluctuations, improving the stability and accuracy of counting. Whether the algae quantity exceeds the threshold: Compare the determined algae quantity with a preset threshold. If the algae quantity does not exceed the threshold, it means that the algae quantity is below the warning line, and the robot does not need to perform ultrasonic algae removal and continues to sail according to the work task to search for algae; if it exceeds the threshold, it means that the algae quantity is above the warning line, and the robot needs to perform ultrasonic algae removal. Then, the detection result (the pixel coordinates of the algae in the image) will be coordinate-transformed into the position in the world coordinate system for subsequent path planning.

[0098] The sliding mode idea is used to handle the target overlap degree and the distance relationship between targets; the process of handling the target overlap degree is to define the sliding mode surface s related to the target overlap degree o = O - O th , where O is the actually detected target overlap degree, and O th is the set reasonable overlap degree threshold; when s o = 0, it means being in the ideal sliding mode, that is, the target overlap degree is in a reasonable state; if O > O th , it means that the overlap degree is too high, and there is a situation where multiple targets are misjudged as one, and target segmentation is performed; if O < O th , then the overlap degree is normal. In this way, the influence of the uncertainty brought by target overlap on the counting accuracy is eliminated by using the sliding mode idea. The process of handling the distance relationship between targets is to define the sliding mode surface s D = D - D th , where D is the actual distance between targets, and D th is the reasonable distance threshold set according to the target distribution characteristics. When the distance between the detected targets deviates from D thWhen there is a deviation, dynamic adjustment is performed. For example, when the distance is too small, the targets that may be merged need to be rejudged to determine whether they are multiple targets; when the distance is too large, there may be missed detections, and it is necessary to further search the surrounding area. This dynamic adjustment process is similar to the feedback adjustment in sliding mode control, where the system adjusts according to the deviation of the state from the sliding surface to ensure that the operating state is at the desired distance between the targets. Therefore, the algal quantity increases only when both conditions are met. Finally, the algal quantity statistical result is used for threshold judgment.

[0099] Step 3: Based on the robot position and the result obtained from coordinate transformation, use the genetic algorithm to generate an initial path; comprehensively consider the economy and safety of the path, and calculate the individual fitness value of each initial path through a fitness function; use elitist selection to retain the initial paths with high individual fitness values, and select the remaining initial paths through the roulette wheel strategy to increase the diversity of the path population; dynamically adjust the adaptive crossover probability and adaptive mutation probability of the genetic algorithm to optimize the initial path search process and obtain the optimal path; use the Bezier curve to smooth the optimal path and output the global planned path.

[0100] In this embodiment, in the problem of water surface route planning, the chromosome is represented as a series of arranged path points, and these path points form the chromosome as genes. The common coding methods of the genetic algorithm include real number coding and binary coding. In this paper, the real number coding method is used for path planning.

[0101] As Figure 4 shown, the process of generating the initial path by the genetic algorithm is as follows: First, set the key parameters of the genetic algorithm, including the population size, the maximum number of iterations, the crossover probability, the mutation probability, and the adaptive parameter. Randomly generate an initial path population according to the population size. Among them, the i-th initial path S i =[s s , s i1 , s i2 , ··· s e (i = 1, 2, ··· n), s ij (j = 1, 2, ··· k) is the path point passed by the initial path S i , s s and s e are the starting point and the ending point of the initial path respectively. At the same time, set the current population generation number K = 1. Each path (chromosome) represents a possible solution, providing a basis for subsequent iterative operations.

[0102] In the genetic algorithm, the fitness function is crucial for obtaining the optimal solution in practical applications. The design of the fitness function determines whether the optimal solution can be achieved. The quality of an individual is evaluated based on the magnitude of its fitness value, and subsequent selection operations are carried out accordingly. For the path planning of an aquatic robot, to construct a path that is both safe and economical, the following two evaluation indicators in the function must be considered: safety, which is the evaluation of the distance between the robot and obstacles; and economy, which is the evaluation of the path length. The individual fitness value is used to measure the quality of the path and provides a basis for subsequent selection operations.

[0103] The formula for calculating the individual fitness value of each initial path by the fitness function is as follows:

[0104] f S =af 1 (S)+bf 2 (S);

[0105] Where f S represents the individual fitness value of the initial path, a and b are weight coefficients, f 1 (S) and f 2 (S) represent the economy and safety of the initial path respectively;

[0106] The formula for calculating the economy of the initial path is:

[0107]

[0108] Where len(S i ) is the length of the initial path;

[0109] The formula for calculating the safety of the initial path is:

[0110]

[0111] dan(S i )=1 / d i ;

[0112] Where dan(S i ) is the reciprocal of the distance between the robot and obstacles during driving; d i represents the shortest distance between the robot and obstacles during driving.

[0113] The problem of water surface path planning is that the calculation amount is large and it is easy to fall into local optimal solutions. To ensure that the genetic algorithm can converge to the global optimal solution, in this embodiment, the elite selection and roulette wheel strategies are combined. The elite selection directly copies several initial paths with the highest individual fitness values to the new generation of population to ensure the transmission of excellent genes. The roulette wheel selection randomly selects the remaining individuals to enter the new generation of population according to the proportion of the individual fitness values of the paths, increasing the diversity of the population. The process of the elite selection is to select the first N initial paths in descending order according to the calculated individual fitness values of the initial paths 1 initial paths and add them to the new path population;

[0114] The process of the roulette wheel strategy for selecting the remaining initial paths is as follows:

[0115] (1) Starting from the (N + 1)-th initial path, calculate the probability of being selected in turn: 1 where

[0116]

[0117] is the individual fitness value of the initial path S ; i is the individual fitness value of the initial path S

[0118] (2) Calculate the cumulative probability value q i :

[0119]

[0120] (3) Generate a random number r ∈ [0, 1];

[0121] (4) If select the (N + 1)-th path; otherwise, select the S 1 that satisfies q j <r ≤ q j-1 ; j ;

[0122] (5) Repeat the processes of (3) and (4) until the selected population number N 2 is reached, and add the initial path corresponding to this individual fitness value to the new path population.

[0123] To reduce the risk of the fitness of excellent individuals decreasing due to mutation in the later stage of genetic algorithm iteration, this embodiment proposes an adaptive mutation operator. This method sets a relatively high mutation probability at the initial stage of the genetic algorithm to expand the search scope; as the number of iterations increases, the mutation probability is gradually reduced to avoid the destruction of excellent genes. This strategy takes into account both the global search ability and the local convergence performance in the later stage. The core idea of the adaptive crossover and mutation operator is to dynamically adjust the adaptive crossover probability and the adaptive mutation probability of the genetic algorithm. Different from the traditional fixed-parameter method, the adaptive strategy flexibly adjusts the parameters according to the population evolution state, thus optimizing the search process more efficiently. Specifically, for excellent paths, the crossover and mutation probabilities are reduced to retain their superiority; for inferior paths, the mutation probability is increased to increase their improvement opportunities. When the population size is large or the quality is poor, the mutation probability can also be appropriately increased to enhance diversity and prevent premature convergence. In the early stage of the genetic algorithm, increasing the adaptive crossover probability and the adaptive mutation probability helps to quickly explore the global optimal solution; while in the later stage, reducing the probability enhances the convergence stability.

[0124] The adaptive crossover performs a crossover operation on the selected paths and generates new paths according to the genetic formula to improve the exploration ability of the solution. The adaptive crossover probability P c The formula is:

[0125]

[0126] where f max represents the maximum fitness of the current path population, f avg represents the average individual fitness value of the current path population, f is the larger individual fitness value among the two paths to be crossed, and k 1 and k 2 are constants between 0 and 1 respectively.

[0127] The adaptive mutation generates new paths and randomly changes some genes with the mutation probability to prevent falling into local optima.

[0128] The adaptive mutation probability P e The formula is as follows:

[0129]

[0130] where f' represents the fitness of the mutation operation path; k 3 and k 4 are constants between 0 and 1 respectively.

[0131] Finally, eliminate the paths that do not meet the requirements of genetic operations, ensure the quality of the population, generate a new generation of population and judge the termination conditions. After completing the crossover and mutation operations, update the population K = K + 1. Judge whether the current generation has reached the preset maximum number of iterations or meets the optimization goal: if not, return to the fitness calculation and continue the iteration. If completed, output the path with the highest individual fitness value in the current generation as the optimal path.

[0132] During the actual movement process, the path planned by the robot must meet the kinematic and dynamic constraint conditions. Therefore, the path planned by the robot should be as smooth as possible. Due to the need for mobile robot path planning, the environment it is in is a grid map, then the planned path will generate sharp peaks at the inflection points. In order to make the robot move more stably and smoothly, the path needs to be smoothed after path planning. Common path smoothing methods include: Bezier curves, spline curves, etc. And the nth-order curve formula of the Bezier curve is as follows:

[0133]

[0134] In the formula, P(t) is the motion control point of the Bezier curve, P i is the position point, P(0) and P(1) are the starting point and the ending point respectively, B i,n (t) is the Bernstein basis function, is the binomial coefficient, also known as the combination number, which represents the combination number of taking i elements from n different elements. Here, n is a non-zero positive integer, the value range of i is from 0 to n, t is the interpolation on the Bezier curve, and its value range is between [0,1]. When t changes from 0 to 1, the point P(t) will move from the starting point P(0) of the Bezier curve to the ending point P(1).

[0135] Step 4: During the process of the robot moving along the global planned path, in response to dynamic environmental changes, adjust the local path planning in real time to ensure that the robot safely completes the moving task.

[0136] This embodiment uses the Dynamic Window Approach (DWA) to plan the local path. Its basic idea is based on the kinematic model of the robot and the motion characteristics of the kinematic model. The local path planning process includes establishing the kinematic model of the robot, then sampling the robot speed space (v, ω), then simulating the simulated trajectory within time t in this speed space (v, ω) based on the robot kinematic model, calculating the evaluation function of the simulated trajectory, and finally selecting the trajectory with the optimal evaluation function value to obtain the local optimal path, so as to improve the accuracy and efficiency of path planning.

[0137] The establishment of the robot kinematic model is

[0138] x t+Δt = x t + v x Δt cosθ t - v y Δt sinθ t ;

[0139] y t+Δt = y t + v x Δt sinθ t + v y Δt cosθ t ;

[0140] θ t+Δt = θ t + ω t Δt;

[0141] In the formula, x t+Δt is the abscissa of the robot at time t + Δt, y t+Δt is the ordinate of the robot at time t + Δt, x t is the abscissa of the robot at time t, y t is the ordinate of the robot at time t, v x and v y are the linear velocities of the robot along the x and y axes at time t in the chassis coordinate system, θ t is the angle between the robot and the x-axis at time t, ω t is the angular velocity of the robot at time t, θ t+Δt is the angle between the robot and the x-axis at time t + Δt.

[0142] The process of sampling the robot's speed is to sample the speed space of the mobile robot within the window area. There are infinitely many sets of speed pairs (v, ω) in the speed space. Set the boundary limit conditions:

[0143] v m = {(v, ω)|v ∈ [v min , v max ∧ ω ∈ [ω min , ω max};

[0144] In the formula, v m is the limit range of the maximum and minimum speeds of the robot, v max and v min are the maximum and minimum linear velocities that the robot can reach respectively, ω max and ω min are the maximum and minimum angular velocities that the robot's angular velocity can reach respectively;

[0145] Further, the constrained speed space v d :

[0146]

[0147] Wherein, v c is the current linear velocity of the robot, is the maximum acceleration, and Δt is the time interval; is the maximum deceleration; ω c is the current angular velocity of the robot, is the maximum angular acceleration; is the maximum angular deceleration;

[0148] Set the velocity space for the maximum acceleration limit:

[0149]

[0150] Wherein, represents the path length between the robot and the nearest obstacle;

[0151] During one Δt of the forward period of the surface robot, the effective velocity set interval v is:

[0152] v = v m ∩v d ∩v a .

[0153] After sampling in the velocity search space, an evaluation function is used to evaluate the trajectories corresponding to several groups of sampled velocities for selecting the optimal trajectory. The criteria for trajectory evaluation are: accurately avoiding obstacles and approaching the target point in the shortest time. The formula for the improved evaluation function is:

[0154] G(v, ω) = σ(α·head(v, ω) + β·dist(v, ω) + γ·vel(v, ω) + δpre(v, ω));

[0155] Wherein, α, β, γ, and δ are the weight factors for each item; σ represents normalization; head(v, ω) is the azimuth evaluation function, which represents the azimuth deviation between the traveling direction of the robot and the end point of the global planned path when moving to the end point of the local planned path at the current sampled velocity; dist(v, ω) is the safety factor evaluation function, which represents the path length between the robot and the nearest obstacle; vel(v, ω) is the current velocity magnitude evaluation function; pre(v, ω) is the target path distance evaluation sub-function, and the formula is as follows:

[0156]

[0157] Wherein, (x te , y te ) are the coordinates of the end point of the predicted trajectory, (x g , y g)To predict the coordinates of the target point of the trajectory. The traditional dynamic window method only considers the final end point and does not take into account the global path. To give full play to the importance of the global path in the robot trajectory planning, a target path distance evaluation sub-function pre(v, ω) is added this time, which represents the distance between the end of the predicted trajectory of the robot and the global path point of the robot. The physical meaning of pre(v, ω) is to introduce the guiding effect of the global path on the robot's obstacle avoidance, so that the surface robot can move quickly towards the target point, and the shorter the distance, the better the evaluation.

[0158] As Figure 5 shown, when the surface robot is driving along the globally planned path, it will perform local path planning based on the improved DWA. The process is as follows:

[0159] Step 1: The robot will send the perceived environmental perception data, the collected linear velocity, angular velocity and other data of the robot to an external system (PC / Cloud data platform module). After the external system processes the data, the processed data is sent back to the robot.

[0160] Step 2: The robot will generate a set of trajectory candidate sets according to the collected and transmitted data. Each trajectory is a possible movement path of the robot, including different combinations of speed and steering angle.

[0161] Step 3: For each generated trajectory, the surface robot will use an evaluation function to evaluate its quality. The evaluation function takes into account multiple factors, such as the distance from obstacles, speed, deviation of direction, and the distance between the end of the predicted trajectory and the global path point of the robot.

[0162] Step 4: According to the results of the evaluation function, the robot will select the optimal trajectory. Then, it will drive along the selected optimal trajectory. At the same time, during the robot's driving process, it will judge whether it has reached the end of the optimal trajectory. If it has reached the end of the optimal trajectory, it will continue to judge whether it has reached the end of the path. If it has reached the end, it will jump to Step 5. If not, it will return to Step 2; otherwise, if it has not reached the end of the optimal trajectory, it will continue to move along the optimal trajectory.

[0163] Step 5: The surface robot reaches the destination and ends this planning.

[0164] In this embodiment, there is also dynamic obstacle detection. The robot continuously monitors whether there are dynamic obstacles (such as floating objects or other boats) in the front path. If a dynamic obstacle is detected, the robot will immediately re-perform local path planning and select a safe and efficient alternative path. If there is no obstacle, it will continue to move along the established path.

[0165] The present invention adopts a strategy that combines global path planning and local path planning. The global path planning is based on an improved genetic algorithm, and generates an optimal global path by combining task requirements and environmental constraints. The local path planning adjusts the local path in real time according to the dynamic environmental changes, enabling the robot to plan a reasonable overall path in a complex dynamic water environment and flexibly respond to local changes, with good flexibility and adaptability. In addition, by constructing a fitness function that includes economy and safety, the present invention takes into account the path length and the distance between the robot and obstacles, making the planned path both economical and safe. In practical applications, it can effectively reduce the driving distance of the robot, while reducing the risk of collision with obstacles, and improving the operation efficiency and safety. The present invention adopts a strategy that combines elite selection and roulette wheel selection, retains the paths with high individual fitness values to transmit excellent genes, and uses roulette wheel selection for the remaining paths to increase diversity, avoiding the algorithm falling into local optimal solutions, and helping to find the global optimal path in a complex water surface environment, ensuring that the path planning of the robot is more scientific and reasonable. The present invention dynamically adjusts the adaptive crossover and mutation probabilities according to the evolutionary state of the path population, increasing the mutation probability in the initial stage to expand the search range and explore more potential paths, and reducing the probability in the later stage to accelerate the convergence speed and avoid the destruction of excellent genes. While ensuring the comprehensiveness of the search, it improves the convergence efficiency of the genetic algorithm and finds the optimal path faster. The present invention smooths the planned path by using Bessel curves, reducing sharp inflection points in the path, making the path more compliant with the kinematic and dynamic constraints of the robot. This can not only reduce the energy consumption of the robot during driving, but also improve its motion stability, extend the service life of the robot, and ensure the continuity and efficiency of the operation. The present invention improves the evaluation function by adding a target path distance evaluation sub-function and incorporating the global path into the evaluation system, enabling the robot to quickly move towards the target point during local path planning. At the same time, considering factors such as the distance, speed, and direction deviation from obstacles, it evaluates the trajectory from multiple dimensions and selects a better local path, enhancing the accuracy and efficiency of path planning.

[0166] In summary, the present invention can achieve precise and stable path planning for the robot in a complex water environment, improving the efficiency and adaptability of path planning.

Claims

1. A water surface path planning method based on genetic algorithm, characterized in that: The specific steps include: Step 1: Obtain robot position information and collect image data in real time; Step 2: Perform target detection on the collected image data based on the YOLOv8 target detection model based on deep learning; According to the target detection results, the number of targets is determined and the number is judged based on the sliding mode idea, and the target detection results are transformed into coordinates according to the number judgment results; Step 3: Generate the initial path using genetic algorithm based on the results of robot position and coordinate transformation; Taking into account the economy and safety of the path, the individual fitness value of each initial path is calculated through the fitness function; The elite selection is used to retain the initial paths with high individual fitness values, and the remaining initial paths are selected through the roulette strategy to increase the diversity of the path population; the adaptive crossover probability and adaptive mutation probability of the genetic algorithm are dynamically adjusted to optimize the initial path search process and obtain the optimal path; the Bezier curve is used to smooth the optimal path and output the global planning path; Step 4: When the robot moves along the global planned path, it adjusts the local path planning in real time according to the dynamic environment changes to ensure that the robot can complete the moving task safely.

2. The water surface path planning method based on genetic algorithm according to claim 1 is characterized in that: In step 2, the sliding mode concept is used to process the target overlap and the distance relationship between targets; The process of processing target overlap is to define the sliding surface s related to the target overlap o =OO th , where O is the actual detected target overlap, O th is a reasonable overlap threshold; when s o =0, it indicates an ideal sliding mode, that is, the target overlap is in a reasonable state; if O>O th , indicating that the overlap is too high, there are multiple targets that are misjudged as one, and target segmentation is performed; if O<O th , then the overlap is normal; The process of dealing with the distance relationship between targets is to define the sliding surface s D =DD th , where D is the actual distance between targets, D th It is a reasonable distance threshold set according to the target distribution characteristics. When the distance between the detected targets deviates from D th When the target is in the desired distance, dynamic adjustments are made according to the deviation to ensure that the target is in the expected distance.

3. The water surface path planning method based on genetic algorithm according to claim 1 is characterized in that: In step 3, the process of generating the initial path by the genetic algorithm is as follows: first, the key parameters of the genetic algorithm are set, including population size, maximum number of iterations, crossover probability, mutation probability and adaptive parameters, and the initial path population is randomly generated according to the population size. The i-th initial path S i =[s s ,s i1 ,s i2 ,···s e ](i=1,2,···n),s ij (j=1,2,···k) is the initial path S i The number of waypoints passed, s s and e are the starting point and end point of the initial path respectively.

4. The water surface path planning method based on genetic algorithm according to claim 3 is characterized in that: The fitness function calculates the individual fitness value of each initial path as follows: f S =af1(S)+bf2(S); Among them, f S represents the individual fitness value of the initial path, a and b are weight coefficients, f1(S) and f2(S) represent the economy and safety of the initial path respectively; The economic calculation formula of the initial path is: Among them, len(S i ) is the length of the initial path; The security calculation formula of the initial path is: and S i )=1 / d i ; Among them, dan(S i ) is the reciprocal value of the distance between the robot and the obstacle when driving; d i Indicates the shortest distance between the robot and obstacles when driving.

5. The water surface path planning method based on genetic algorithm according to claim 4 is characterized in that: The elite selection process is to select the first N1 initial paths according to the calculated individual fitness values ​​of the initial paths, and arrange them in descending order to add them to the new path population; The process of selecting the remaining initial paths by the roulette strategy is: (1) Starting from the initial path No. N1+1, the probability of being selected is calculated in sequence: in, is the initial path S i The individual fitness value of (2) Calculate the cumulative probability value q i : (3) Generate a random number r∈[0,1]; (4) If Select the N1+1th path; otherwise, select S j Satisfy q j-1 <r≤q j ; (5) Repeat processes (3) and (4) until the number of selected groups N2 is reached, and add the initial path corresponding to this individual fitness value to the new path population.

6. The water surface path planning method based on genetic algorithm according to claim 1, characterized in that: The adaptive crossover probability P c The formula is: Among them, f max represents the maximum fitness of the current path population, f avg represents the average individual fitness value of the current path population, f is the larger individual fitness value of the two paths to be crossed, k1 and k2 are constants between 0 and 1 respectively; The adaptive mutation probability P e The formula is as follows: Among them, f' represents the fitness of the mutation operation path; k3 and k4 are constants between 0 and 1 respectively.

7. The water surface path planning method based on genetic algorithm according to claim 1, characterized in that: The n-order curve formula of the Bezier curve is as follows: Where P(t) is the motion control point of the Bezier curve and P is the position point i , P(0) and P(1) are the starting point and the end point respectively, B i,n (t) is the Bernstein basis function, is the binomial coefficient, also known as the combination number, which represents the number of combinations of i elements from n different elements, where n is a non-zero positive integer, i ranges from 0 to n, and t is the interpolation on the Bezier curve, ranging from [0,1].

8. The water surface path planning method based on genetic algorithm according to claim 1, characterized in that: In step 4, the local path planning process includes establishing a robot kinematic model, then sampling the robot velocity space (v, ω), and then simulating a simulated trajectory within time t in this velocity space (v, ω) based on the robot kinematic model, calculating the evaluation function of the simulated trajectory, and finally selecting the trajectory with the best evaluation function value to obtain the local optimal path, so as to improve the accuracy and efficiency of path planning.

9. The water surface path planning method based on genetic algorithm according to claim 8, characterized in that: The robot kinematic model is established as follows: x t+Δt =x t +v x Δtcosθ t -v y Δtsinθ t ; y t+Δt =y t +v x Δtsinθ t +v y Δtcosθ t ; i t+Δt =θ t +oh t Δt; In the formula, x t+Δt is the horizontal coordinate of the robot at time t+Δt, y t+Δt is the vertical coordinate of the robot at time t+Δt, x t is the horizontal coordinate of the robot at time t, y t is the vertical coordinate of the robot at time t, v x and v y is the linear velocity of the robot along the x and y axes at time t in the chassis coordinate system, θ t is the angle between the robot and the x-axis at time t, ω t is the angular velocity of the robot at time t, θ t+Δt is the angle between the robot and the x-axis at time t+Δt.

10. The water surface path planning method based on genetic algorithm according to claim 9, characterized in that: The robot speed sampling process is to sample the speed space of the mobile robot in the window area. There are infinite sets of speed pairs (v, ω) in the speed space. The boundary limiting conditions are set as follows: v m ={(v,ω)|v∈[v min ,v max ]∧ω∈[ω min ,ω max ]}; In the formula, v m is the maximum and minimum speed limit of the robot, v max and v min are the maximum and minimum linear speeds that the robot can achieve, ω max and ω min are the maximum angular velocity and minimum angular velocity that the robot can reach respectively; Further constrain the velocity space v d : In the formula, v c is the current linear velocity of the robot, is the maximum acceleration, Δt is the time interval; is the maximum deceleration; ω c is the current angular velocity of the robot, is the maximum angular acceleration; is the maximum angular deceleration; Set the speed space for the maximum acceleration limit: Where dist(v,ω) represents the path length between the robot and the nearest obstacle; Within a forward cycle of the water robot, Δt, the effective speed set interval v is: v=v m ∩v d ∩v a ; The formula of the evaluation function is: G(v,ω)=σ(α·head(v,ω)+β·dist(v,ω)+γ·vel(v,ω)+δpre(v,ω)); Among them, α, β, γ and δ are the weight factors of each item; σ represents normalization; head(v, ω) is the azimuth evaluation function, which represents the azimuth deviation between the robot's direction of travel and the end point of the global planning path when moving to the end point of the local planning path at the current sampling speed; dist(v, ω) is the safety factor evaluation function, which represents the path length between the robot and the nearest obstacle; vel(v, ω) is the current speed evaluation function; pre(v, ω) is the target path distance evaluation subfunction, and the formula is as follows: Among them, (x te ,y te ) is the predicted trajectory end coordinate, (x g ,y g ) is the coordinate of the target point of the predicted trajectory.

Citation Information

Patent Citations

  • A robot path planning method integrating Bezier optimization genetic algorithm

    CN110347151B

Cited By

  • Robot time optimal trajectory planning method based on dynamics constraint

    CN120773069A