Mobile robot path planning method and system based on marine predator algorithm, and storage medium
By using the marine predator algorithm and clustering technology, static and moving obstacles in the robot's path are identified and optimized, solving the problem of incomplete path planning in existing technologies and achieving higher-precision path optimization.
Patent Information
- Application Number
- CN202410355389.5
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-03-27
- Publication Date
- 2026-05-12
AI Technical Summary
In the existing technology, mobile robot path planning algorithms have failed to effectively handle dynamic obstacles, resulting in incomplete path optimization and requiring further improvement in accuracy.
The ocean predator algorithm is used to collect the motion state and information parameters of obstacles, and then use clustering algorithms to divide obstacles into static and moving groups to obtain the shape features and motion trajectories of obstacles. Combined with static map matching and template matching, the path planning is optimized.
It improves the accuracy of path planning, effectively identifies and avoids static and moving obstacles, optimizes robot paths, and ensures safe and efficient path selection.
Smart Images

Figure CN122015836A_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of mobile robot path planning technology, specifically to a mobile robot path planning method, system, and storage medium based on the marine predator algorithm. Background Technology
[0002] Robot path planning is a research area in robotics that deals with finding the optimal path for a robot to navigate from a starting point to a target, while avoiding obstacles and optimizing certain criteria such as time, energy consumption, or safety. Robot path planning plays a crucial role in autonomous robots operating in complex and dynamic environments. The ability to navigate automatically is essential for robots to perform tasks such as assembly, inspection, and transportation. Path planning enables robots to avoid obstacles, navigate through complex structures, and optimize their motion to save energy and time.
[0003] The main goal of robot path planning is to design an optimal path for the robot to navigate from the starting point to the target while avoiding obstacles and optimizing certain criteria. Path planning algorithms need to consider various factors, such as the robot's kinematics and dynamics, the geometry and topology of the environment, the presence of static and dynamic obstacles, and the robot's sensors and actuators.
[0004] A prior art method for path planning and control of a mobile robot, disclosed in CN112987740B, includes a data processing step where obstacles in the field are expanded by the robot's radius into a circle centered on the obstacles; a judgment step where a straight line is formed connecting the starting point and the target point, and the line is judged to have an intersection with the circle; and a route planning step where auxiliary line segments parallel to the straight line are constructed on the circle, and the preliminary planned route is smoothed, with the smoothed planned route being the optimal path from the starting point to the target point. This invention provides a novel path planning and control method for a mobile robot that effectively handles circular obstacles. By only studying and processing obstacles that are accessible within the current planned path, and discarding other irrelevant obstacles, the computation time of the algorithm is improved.
[0005] However, there are still some shortcomings. As can be seen from the above statement, only the path optimization problem of mobile robots with static obstacles was analyzed, and the path optimization problem of mobile robots with moving obstacles was not analyzed. Therefore, the path optimization is incomplete and the accuracy of the optimization needs to be further improved.
[0006] The information disclosed in the background section is only intended to enhance the understanding of the background of this disclosure, and therefore may include information that does not constitute prior art known to those skilled in the art. Summary of the Invention
[0007] The purpose of this invention is to provide a mobile robot path planning method, system, and storage medium based on the marine predator algorithm, so as to solve the problems mentioned in the background art.
[0008] To achieve the above objectives, the present invention provides the following technical solution:
[0009] A path planning method for mobile robots based on the marine predator algorithm, comprising the following steps:
[0010] S1. Collect motion state parameters and information parameters of N obstacles of the same size on the robot's movement path. The motion state parameters of the obstacles include moving state and stationary state. The information parameters of the obstacles include the real-time position of the obstacles, the real-time distance between the obstacles and the robot, and the moving speed of the obstacles.
[0011] S2. Obtain the position of the obstacle when it is stationary and the distance between the obstacle and the robot. Use a clustering algorithm to divide them into static groups. Obtain the position information of the obstacle when it is moving and the distance between the obstacle and the robot. Continuously update the distance values and use a clustering algorithm to divide them into moving groups.
[0012] S3. Analyze the position of obstacles and the distance between obstacles and robots in the static group to obtain the shape features of static obstacles. Using the obtained shape features of static obstacles, obtain the shape features of moving obstacles through static map matching, feature extraction and template matching. Analyze the real-time position of obstacles in the moving group, the real-time distance between obstacles and robots and the moving speed of obstacles to obtain the movement trajectory of moving obstacles.
[0013] S4. The ocean predator algorithm is used to search for the optimal solution. The original path length is introduced, and the original path length is modified according to the movement trajectory of the moving group. The objective function of the modified path is calculated, and the optimal path solution is obtained based on the objective function.
[0014] Further, in step S2, when the obstacle is stationary, its position and the distance between the obstacle and the robot are collected, and the process of dividing them into static groups using a clustering algorithm is as follows:
[0015] Data acquisition: Obtain the location information of obstacles and the distance between obstacles and the robot through sensors. The location information of obstacles can be obtained through GPS positioning, and the distance between obstacles and the robot can be obtained through distance sensors.
[0016] Feature extraction: Based on the collected data, features are extracted, including the position coordinates of obstacles and the distance between obstacles and the robot;
[0017] Clustering algorithm: Based on the similarity or distance between samples, the K-means clustering algorithm is selected to group stationary obstacles.
[0018] Furthermore, in step S2, the process of acquiring the location information of the obstacle and the distance between the obstacle and the robot in real time when the obstacle moves, and dividing them into moving groups using a clustering algorithm, is as follows:
[0019] Data acquisition: Real-time data acquisition is achieved through sensors, including the real-time position of obstacles, their movement speed, and the real-time distance between obstacles and the robot. The real-time position of obstacles can be obtained through GPS positioning, their movement speed can be obtained through speed sensors, and the real-time distance between obstacles and the robot can be obtained through distance sensors.
[0020] Feature extraction: Based on the collected data, features are extracted, including the real-time position coordinates of obstacles, the robot's moving speed, and the real-time distance between obstacles and the robot.
[0021] Clustering process: Based on the similarity or distance between samples, the K-means clustering algorithm is selected to group the moving obstacles.
[0022] Furthermore, in step S3, the process of analyzing the position of obstacles in the static group and the distance between obstacles and the robot to obtain the shape features of obstacles is as follows:
[0023] Data acquisition: Obtain the position coordinates of obstacles and the distance information between obstacles and the robot from the static group;
[0024] Boundary extraction: Based on the obstacle's position coordinates, the Sobe l operator is used to obtain the obstacle's boundary;
[0025] Shape feature calculation: Based on the obtained boundary of the obstacle, the shape feature algorithm is used to obtain the shape feature of the obstacle.
[0026] Furthermore, the process of obtaining the boundary of the obstacle using the Sobe l operator is as follows:
[0027] Image grayscale conversion: The image corresponding to the position coordinates of the obstacle is converted to grayscale, transforming a color image into a grayscale image. The formula used is as follows:
[0028] Y = 0.298 * R + 0.587 * G + 0.114 * B
[0029] Where Y is the gray value of the obstacle's position coordinates, and R, G, and B are the red, green, and blue component values of the pixels in the image corresponding to the obstacle's position coordinates, respectively.
[0030] Sobe L operator operation: The Sobe L operator is used for edge detection of grayscale images. The Sobe L operator includes two filters, horizontal and vertical, which are used to detect edges in the horizontal and vertical directions of the image, respectively. For horizontal edge detection, the following formula can be used:
[0031]
[0032] For vertical edge detection, the following formula can be used:
[0033]
[0034] The Sobe l operator formula described above is used to perform convolution operations on the grayscale image, calculating the gradient values of each pixel in both the horizontal and vertical directions. The horizontal gradient value can be obtained using the following formula:
[0035]
[0036] The horizontal gradient value can be obtained using the following formula:
[0037]
[0038] Among them, G X (i,j), G Y (i,j) represent the horizontal and vertical gradient values of the pixel in the i-th row and j-th column, respectively, and X(i,j) represents the grayscale value of the pixel in the i-th row and j-th column.
[0039] Edge strength calculation: The gradient magnitude of the generated pixel is based on the following formula:
[0040]
[0041] Among them, T X (i,j) represents the gradient magnitude of the pixel in the i-th row and j-th column.
[0042] Edge thresholding: Based on a set threshold, the edge intensity image is thresholded. Pixels with edge intensity exceeding the threshold are marked as edge points, and the remaining pixels are marked as non-edge points. The marked edge points and non-edge points can be used to define the boundary of the obstacle and simulate the shape characteristics of the static obstacle.
[0043] Furthermore, in step S3, after obtaining the shape of the static obstacle, the process of obtaining the shape of the moving obstacle is as follows:
[0044] Static map matching: The map data of static obstacles is matched with the current sensor data. The static map already contains the shape information of static obstacles. The current sensor data can be compared with the map to identify moving obstacles that match the map, thereby obtaining their shape information.
[0045] Feature extraction and matching: Edge and corner features are extracted from the map data of static obstacles, and then similar feature points are found in the current sensor data. The position and shape of the moving obstacle can be determined by feature matching.
[0046] Template matching: The shape of a static obstacle is used as a template. Template matching is then performed on the current sensor data. If the area that matches the template is found, it can be identified as a moving obstacle, and its shape can be obtained.
[0047] Furthermore, in step S3, the process of analyzing the real-time position of obstacles in the moving group, the real-time distance between obstacles and the robot, and the moving speed to obtain the motion trajectory of obstacles is as follows:
[0048] Real-time location analysis:
[0049] The real-time location of an obstacle can be obtained based on GPS positioning data. By recording the location information of the obstacle at different points in time, its position can be changed over time.
[0050] Real-time distance analysis:
[0051] The real-time distance between the obstacle and the robot can be calculated using the Euclidean distance formula:
[0052]
[0053] Where S is the real-time distance between the obstacle and the robot, x z Let x be the x-coordinate of the obstacle, and y be the y-coordinate of the obstacle. z Let x be the y-coordinate of the obstacle, and x be the x-coordinate of the obstacle. z and y z It can locate the position of obstacles, x j Let x be the robot's x-coordinate and y be the robot's y-coordinate. j Let x be the robot's y-coordinate, and x be the coordinates of the robot. j and y j It can locate the robot's position;
[0054] Movement speed analysis:
[0055] The moving speed of an obstacle can be obtained by calculating the change in its position between different points in time. The average speed is calculated using the following formula:
[0056]
[0057] in, For average speed, W i t represents the distance difference between the current position and the previous position of the obstacle. i This represents the time interval between the obstacle's previous position and its current position.
[0058] In summary, by using the real-time position of the moving obstacle, the real-time distance between the obstacle and the robot, and the moving speed, its motion trajectory can be plotted.
[0059] Furthermore, in step S4, the marine predator algorithm is used to search for the optimal solution. The original path length is introduced, and modified according to the movement trajectory of the moving group. The objective function of the modified path is calculated, and the process of obtaining the optimal path solution based on the objective function is as follows:
[0060] Cubic spline interpolation is used to smooth the path between the starting point and the target point. If the number of interpolation points in the entire planned path is M, the original path length L is calculated using the following formula:
[0061]
[0062] Among them pp i (pp ix pp iy ) is the i-th interpolation point;
[0063] If some of the intermediate points are located within obstacles, the result is unacceptable; if none of the intermediate points are located within obstacles, the result is acceptable. However, if none of the intermediate points are located within obstacles, but some interpolation points are located within obstacles, the result must be modified.
[0064] Assume that the region formed by each individual obstacle is a bounded circle, and the bounded circles of the obstacles are shown. Define the center of the i-th bounded circle as ob. i (ob ix ob iy The radius of the i-th bounded circle is ob. ir If the interpolation point pp i Located within obstacle j, the violation is calculated using the following equation:
[0065]
[0066]
[0067]
[0068] d ij v is the distance between the interpolation point i and the center of the boundary circle j. ijThis indicates that if the interpolation point i is located within obstacle j, it is a violation, and v is a complete violation.
[0069] Based on the movement trajectory information of the mobile group, a certain path length is added or subtracted at each node of the original path. The increment can be adjusted according to the movement direction, speed and distance of the mobile group. If the movement direction of the group is the same as the original path direction, the path length can be reduced; if the direction is opposite, the path length can be increased.
[0070] Therefore, the modified path length L m The calculation formula is as follows:
[0071] L m =L(1+ρv)
[0072] Where L m The corrected path length is ρ, where ρ is the adjustment factor.
[0073] Therefore, the objective function L for MPA optimization f The definition is as follows:
[0074]
[0075] Where all interpolation points are not in obstacles, then v ij =0, v=0, then L f =L; when some interpolation points are located within obstacles, then L f =L m When some intermediate points are located within obstacles, then L f =∞;
[0076] Therefore, the optimal solution obtained by the objective function is when L f =L.
[0077] A mobile robot path planning system based on the marine predator algorithm, the system being used to execute the mobile robot path planning method based on the marine predator algorithm described above, comprising:
[0078] The data acquisition module is used to collect motion state parameters and information parameters of N obstacles of the same size on the robot's movement path. The motion state parameters of the obstacles include moving state and stationary state, and the information parameters of the obstacles include the real-time position of the obstacles, the real-time distance between the obstacles and the robot, and the moving speed of the obstacles.
[0079] The group classification module is used to obtain the position of obstacles when they are stationary and the distance between obstacles and robots, and classify them into static groups using a clustering algorithm. When obstacles are moving, the module obtains their position information and the distance between obstacles and robots, and continuously updates the distance values, and classifies them into moving groups using a clustering algorithm.
[0080] The data analysis module is used to analyze the position of obstacles in static groups, the distance between obstacles and robots, and obtain the shape features of static obstacles. Using the obtained shape features of static obstacles, the module obtains the shape features of moving obstacles through static map matching, feature extraction, and template matching. The module also analyzes the real-time position of obstacles in moving groups, the real-time distance between obstacles and robots, and the moving speed of obstacles to obtain the movement trajectory of moving obstacles.
[0081] The path planning module is used to search for the optimal solution using the marine predator algorithm. It introduces the original path length, modifies the original path length according to the movement trajectory of the moving group, obtains the objective function of the modified path, and obtains the optimal path solution based on the objective function.
[0082] A storage medium storing a computer program, which, when executed by a processor, implements the mobile robot path planning method based on the marine predator algorithm described above.
[0083] Compared with the prior art, the beneficial effects of the present invention are:
[0084] This invention collects motion state parameters and information parameters of N obstacles of the same size along the robot's movement path. Using a clustering algorithm, these obstacles are divided into static and moving groups. The position of obstacles in the static groups and the distance between the obstacles and the robot are analyzed to obtain their shape features. Then, through static map matching, feature extraction, and template matching, the shape of the moving obstacles is obtained, effectively identifying both static and moving obstacles. By analyzing the real-time position of obstacles in the moving groups, the real-time distance between the obstacles and the robot, and their movement speed, the movement trajectory of the moving obstacles is obtained. The Ocean Predator algorithm is then used to search for the optimal solution. The original path length is introduced and modified based on the movement trajectory of the moving groups to obtain the objective function of the modified path. Based on the objective function, the optimal path solution is obtained, thus comprehensively optimizing the robot's path and improving the accuracy of path planning. Attached Figure Description
[0085] Figure 1 This is a schematic diagram of the overall method flow of the present invention;
[0086] Figure 2 This is a block diagram of the module composition of the present invention. Detailed Implementation
[0087] To make the objectives, technical solutions, and advantages of this invention clearer, the invention will be further described in detail below with reference to specific embodiments.
[0088] It should be noted that, unless otherwise defined, the technical or scientific terms used in this invention should have the ordinary meaning understood by one of ordinary skill in the art to which this invention pertains. The terms "first," "second," and similar terms used in this invention do not indicate any order, quantity, or importance, but are merely used to distinguish different components. Terms such as "comprising" or "including" mean that the element or object preceding the word encompasses the elements or objects listed following the word and their equivalents, without excluding other elements or objects. Terms such as "connected" or "linked" are not limited to physical or mechanical connections, but can include electrical connections, whether direct or indirect. Terms such as "upper," "lower," "left," and "right" are used only to indicate relative positional relationships; when the absolute position of the described object changes, the relative positional relationship may also change accordingly.
[0089] Example:
[0090] Please see Figures 1 to 2 The present invention provides a technical solution:
[0091] A path planning method for mobile robots based on the marine predator algorithm, such as... Figure 1 As shown, the specific steps include:
[0092] S1. Collect motion state parameters and information parameters of N obstacles of the same size on the robot's movement path. The motion state parameters of the obstacles include moving state and stationary state. The information parameters of the obstacles include the real-time position of the obstacles, the real-time distance between the obstacles and the robot, and the moving speed of the obstacles.
[0093] S2. Obtain the position of the obstacle when it is stationary and the distance between the obstacle and the robot. Use a clustering algorithm to divide them into static groups. Obtain the position information of the obstacle when it is moving and the distance between the obstacle and the robot. Continuously update the distance values and use a clustering algorithm to divide them into moving groups.
[0094] S3. Analyze the position of obstacles and the distance between obstacles and robots in the static group to obtain the shape features of static obstacles. Using the obtained shape features of static obstacles, obtain the shape features of moving obstacles through static map matching, feature extraction and template matching. Analyze the real-time position of obstacles in the moving group, the real-time distance between obstacles and robots and the moving speed of obstacles to obtain the movement trajectory of moving obstacles.
[0095] S4. The ocean predator algorithm is used to search for the optimal solution. The original path length is introduced, and the original path length is modified according to the movement trajectory of the moving group. The objective function of the modified path is calculated, and the optimal path solution is obtained based on the objective function.
[0096] When the motion state of an obstacle changes, the path traveled by the mobile robot will also change. The specific reasons are as follows:
[0097] Collision risk: When an obstacle begins to move from a stationary state, the mobile robot needs to adjust its path in a timely manner to avoid collisions. If the robot continues to travel along its previously planned path, it will face the risk of a collision. Therefore, for safe operation, the robot needs to adjust its path according to changes in the movement of obstacles.
[0098] Obstacle avoidance optimization: Changes in the motion state of obstacles may cause them to create new obstacle points on the path or move onto the original path. In path planning, the robot aims to select the optimal path to avoid obstacles and minimize travel time. When the motion state of obstacles changes, the robot needs to re-evaluate and optimize the path to avoid moving obstacles while minimizing the extra distance and time caused by detours.
[0099] When the information parameters of an obstacle change, the path traveled by the mobile robot will change. The specific reasons are as follows:
[0100] Threat Level Changes: Obstacle information parameters include radius, position, and speed. When these parameters change, the threat level posed by the obstacle to the mobile robot also changes. If the obstacle has a large radius, it may require a larger avoidance area, causing the robot to adjust its path to avoid it. Conversely, if the obstacle has a small radius, its threat level to the robot may decrease, and path planning can more closely approximate the original path.
[0101] Path optimization: Changes in obstacle information parameters can also lead to path planning optimization. For example, when an obstacle's position changes, the robot can replan its path to avoid its new location, thus reaching the target point more efficiently. Furthermore, the robot may refine or update the obstacle information parameters to plan a more precise path, providing a more accurate obstacle avoidance strategy.
[0102] Dynamic obstacle avoidance: Changes in obstacle information parameters may require robots to adjust their paths in real time to adapt to new environments. For example, when a new obstacle appears, the robot needs to detect and adjust its path promptly to avoid it. Dynamic obstacle avoidance algorithms can quickly update path planning based on changes in obstacle information parameters, enabling robots to adapt to complex and dynamic environments.
[0103] Therefore, collecting motion state parameters and information parameters of obstacles on the robot's movement path is of great importance for planning the robot's path.
[0104] Based on the above embodiments, in step S2, when the obstacle is stationary, its position and the distance between the obstacle and the robot are collected, and the obstacle is divided into static groups using a clustering algorithm as follows:
[0105] S21. Data Acquisition: Obtain the location information of obstacles and the distance between obstacles and the robot through sensors. The location information of obstacles can be obtained through GPS positioning, and the distance between obstacles and the robot can be obtained through distance sensors.
[0106] S22. Feature Extraction: Based on the collected data, extract features, including the position coordinates of obstacles and the distance between obstacles and the robot;
[0107] S23. Clustering Algorithm: Based on the similarity or distance between samples, the K-means clustering algorithm is selected to group stationary obstacles.
[0108] Based on the above embodiments, the K-means clustering algorithm groups stationary obstacles as follows:
[0109] a. Initialization: Set the parameters required for clustering, such as the number of clusters;
[0110] b. Initialize cluster centers: Set initial cluster centers based on the characteristics of the data;
[0111] c. Sample assignment: Assign each sample to the nearest cluster center;
[0112] d. Recalculate cluster centers: Based on the assigned samples, recalculate the position of each cluster center;
[0113] e. Repeat steps c and d until the location of the cluster centers no longer changes or a predefined stopping condition is met;
[0114] f. Output clustering results: Assign the samples to the final static groups, each group representing a static obstacle.
[0115] Based on the above embodiments, in step S2, when the obstacle moves, its position information and the distance between the obstacle and the robot are acquired in real time, and the obstacle is divided into moving groups by a clustering algorithm as follows:
[0116] S24. Data Acquisition: Real-time data acquisition is conducted using sensors to collect the real-time position of obstacles, their movement speed, and the real-time distance between obstacles and the robot. The real-time position of obstacles can be obtained through GPS positioning, their movement speed can be obtained through a speed sensor, and the real-time distance between obstacles and the robot can be obtained through a distance sensor.
[0117] S25. Feature Extraction: Based on the collected data, extract features, including the real-time position coordinates of obstacles, the robot's moving speed, and the real-time distance between obstacles and the robot.
[0118] S26. Clustering process: Based on the similarity or distance between samples, the K-means clustering algorithm is selected to group the moving obstacles.
[0119] Based on the above embodiments, the moving obstacles are divided into moving groups, and the process is as follows:
[0120] a. Initialization: Set the parameters required for clustering;
[0121] b. Dynamically updated samples: The real-time position of moving obstacles and the real-time distance between obstacles and the robot are updated over time;
[0122] c. Data Update: Add the latest location and distance information to the current clustering dataset;
[0123] d. Sample allocation: Based on the latest data, assign each sample to the nearest cluster center;
[0124] e. Recalculate cluster centers: Based on the assigned samples, recalculate the position of each cluster center;
[0125] f. Repeat steps d and e to perform real-time clustering on the moving obstacle dataset;
[0126] g. Output moving groups: Assign samples to final moving groups, each group representing a moving obstacle.
[0127] Based on the above embodiments, in step S3, the process of analyzing the position of obstacles in the static group and the distance between obstacles and the robot to obtain the shape features of obstacles is as follows:
[0128] S31. Data Acquisition: Obtain the position coordinates of obstacles and the distance information between obstacles and the robot from the static group;
[0129] S32. Boundary Extraction: Based on the obstacle's position coordinates, the Sobe l operator is used to obtain the obstacle's boundary;
[0130] S33. Shape Feature Calculation: Based on the obtained boundary of the obstacle, the shape feature algorithm is used to obtain the shape feature of the obstacle.
[0131] The process of obtaining the boundary of the obstacle using the Sobe l operator is as follows:
[0132] S321. Image Grayscale Conversion: The image corresponding to the position coordinates of the obstacle is converted to grayscale, transforming a color image into a grayscale image, based on the following formula:
[0133] Y = 0.298 * R + 0.587 * G + 0.114 * B
[0134] Where Y is the gray value of the obstacle's position coordinates, and R, G, and B are the red, green, and blue component values of the pixels in the image corresponding to the obstacle's position coordinates, respectively.
[0135] S322. Sobe L Operator Operation: The Sobe L operator is used to perform edge detection on a grayscale image. The Sobe L operator includes two filters, horizontal and vertical, which are used to detect edges in the horizontal and vertical directions of the image, respectively. For horizontal edge detection, the following formula can be used:
[0136]
[0137] For vertical edge detection, the following formula can be used:
[0138]
[0139] The Sobe l operator formula described above is used to perform convolution operations on the grayscale image, calculating the gradient values of each pixel in both the horizontal and vertical directions. The horizontal gradient value can be obtained using the following formula:
[0140]
[0141] The horizontal gradient value can be obtained using the following formula:
[0142]
[0143] Among them, G X (i,j), G Y (i,j) represent the horizontal and vertical gradient values of the pixel in the i-th row and j-th column, respectively, and X(i,j) represents the grayscale value of the pixel in the i-th row and j-th column.
[0144] S323. Edge Intensity Calculation: The gradient magnitude of the generated pixel is based on the following formula:
[0145]
[0146] Among them, T X (i,j) represents the gradient magnitude of the pixel in the i-th row and j-th column.
[0147] S324. Edge Thresholding: Based on the set threshold, the edge intensity image is thresholded. Pixels with edge intensity exceeding the threshold are marked as edge points, and the remaining pixels are marked as non-edge points. The marked edge points and non-edge points can be used to define the boundary of the obstacle and simulate the shape characteristics of the static obstacle.
[0148] Based on the above embodiments, in step S3, after obtaining the shape of the static obstacle, the process of obtaining the shape of the moving obstacle is as follows:
[0149] S325. Static map matching: Since the shape features of static obstacles are the same as those of moving obstacles, and the shape features of moving obstacles do not change over time, the map data of static obstacles is matched with the current sensor data. The static map already contains the shape information of static obstacles. The current sensor data can be compared with the map to identify the moving obstacles that match the map, thereby obtaining their shape information.
[0150] S326. Feature extraction and matching: Extract features such as edges and corners from the map data of static obstacles, and then find similar feature points in the current sensor data. The position and shape of the moving obstacle can be determined through feature matching.
[0151] S327. Template matching: The shape of a static obstacle is used as a template. Template matching is then performed on the current sensor data. If the area that matches the template is found, it can be identified as a moving obstacle, and its shape can be obtained.
[0152] Based on the above embodiments, in step S3, the process of analyzing the real-time position of obstacles in the moving group, the real-time distance between obstacles and robots, and the moving speed to obtain the movement trajectory of obstacles is as follows:
[0153] Real-time location analysis:
[0154] The real-time location of an obstacle can be obtained based on GPS positioning data. By recording the location information of the obstacle at different points in time, its position can be changed over time.
[0155] Real-time distance analysis:
[0156] The real-time distance between the obstacle and the robot can be calculated using the Euclidean distance formula:
[0157]
[0158] Where S is the real-time distance between the obstacle and the robot, x z Let x be the x-coordinate of the obstacle, and y be the y-coordinate of the obstacle. z Let x be the y-coordinate of the obstacle, and x be the x-coordinate of the obstacle. zand y z It can locate the position of obstacles, x j Let x be the robot's x-coordinate and y be the robot's y-coordinate. j Let x be the robot's y-coordinate, and x be the coordinates of the robot. j and y j It can locate the robot's position;
[0159] Movement speed analysis:
[0160] The moving speed of an obstacle can be obtained by calculating the change in its position between different points in time. The formula for calculating the average speed is as follows:
[0161]
[0162] in, For average speed, W i t represents the distance difference between the current position and the previous position of the obstacle. i This represents the time interval between the obstacle's previous position and its current position.
[0163] In summary, by using the real-time position of the moving obstacle, the real-time distance between the obstacle and the robot, and the moving speed, its motion trajectory can be plotted.
[0164] Based on the above embodiments, in step S4, the marine predator algorithm is used to search for the optimal solution. The original path length is introduced, and it is modified according to the movement trajectory of the moving group. The objective function of the modified path is calculated, and the process of obtaining the optimal path solution based on the objective function is as follows:
[0165] Cubic spline interpolation is used to smooth the path between the starting point and the target point. If the number of interpolation points in the entire planned path is M, the original path length L is calculated using the following formula:
[0166]
[0167] Among them pp i (pp ix pp iy ) is the i-th interpolation point;
[0168] If some of the intermediate points are within obstacles, the result is unacceptable; if none of the intermediate points are within obstacles, the result is acceptable. However, if none of the intermediate points are within obstacles, but some interpolation points are, the result must be modified.
[0169] Assume that the region formed by each individual obstacle is a bounded circle, and define the center of the i-th bounded circle as ob. i (ob ix obiy The radius of the i-th bounded circle is ob. ir If the interpolation point pp i Located within obstacle j, we use the following equation to calculate the violation:
[0170]
[0171]
[0172]
[0173] d ij v is the distance between the interpolation point i and the center of the boundary circle j. ij This indicates that if the interpolation point i is located within obstacle j, it is a violation, and v is a complete violation.
[0174] Based on the movement trajectory information of the mobile group, a certain path length is added or subtracted at each node of the original path. The increment can be adjusted according to factors such as the movement direction, speed, and distance of the mobile group. For example, if the group's movement direction is the same as the original path direction, the path length can be reduced; if the direction is opposite, the path length can be increased.
[0175] Therefore, the modified path length L m The calculation formula is as follows:
[0176] L m =L(1+ρv)
[0177] Where L m The corrected path length is ρ, where ρ is the adjustment factor.
[0178] In path planning, when the interpolation point i is located inside the obstacle j, the path will be corrected. This is to avoid the robot from colliding with the obstacle and to ensure the safety of the path. The corrected path will detour around the obstacle, thus deviating from the original path and resulting in a longer journey.
[0179] Therefore, the objective function L for MPA optimization f The definition is as follows:
[0180]
[0181] Where all interpolation points are not in obstacles, then v ij =0, v=0, then L f =L; when some interpolation points are located within obstacles, then L f =L m When some intermediate points are located within obstacles, then L f =∞.
[0182] Therefore, the optimal solution obtained by the objective function is when L f =L.
[0183] A mobile robot path planning system based on the marine predator algorithm, wherein the system is used to execute the mobile robot path planning method based on the marine predator algorithm described above, such as... Figure 2 As shown, it includes:
[0184] The data acquisition module is used to collect motion state parameters and information parameters of N obstacles of the same size on the robot's movement path. The motion state parameters of the obstacles include moving state and stationary state, and the information parameters of the obstacles include the real-time position of the obstacles, the real-time distance between the obstacles and the robot, and the moving speed of the obstacles.
[0185] The group classification module is used to obtain the position of obstacles when they are stationary and the distance between obstacles and robots, and classify them into static groups using a clustering algorithm. When obstacles are moving, the module obtains their position information and the distance between obstacles and robots, and continuously updates the distance values, and classifies them into moving groups using a clustering algorithm.
[0186] The data analysis module is used to analyze the position of obstacles in static groups, the distance between obstacles and robots, and obtain the shape features of static obstacles. Using the obtained shape features of static obstacles, the module obtains the shape features of moving obstacles through static map matching, feature extraction, and template matching. The module also analyzes the real-time position of obstacles in moving groups, the real-time distance between obstacles and robots, and the moving speed of obstacles to obtain the movement trajectory of moving obstacles.
[0187] The path planning module is used to search for the optimal solution using the marine predator algorithm. It introduces the original path length, modifies the original path length according to the movement trajectory of the moving group, calculates the objective function of the modified path, and obtains the optimal path solution based on the objective function.
[0188] A storage medium storing a computer program, which, when executed by a processor, implements the mobile robot path planning method based on the marine predator algorithm described above.
[0189] The above formulas are all dimensionless calculations. The formulas are derived from software simulations based on a large amount of collected data to obtain the most recent real-world results. The preset parameters in the formulas are set by those skilled in the art according to the actual situation.
[0190] The above embodiments can be implemented, in whole or in part, by software, hardware, firmware, or any other combination thereof. When implemented in software, the above embodiments can be implemented, in whole or in part, as a computer program product. Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented by electronic hardware, or a combination of computer software and electronic hardware. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution.
[0191] The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; they may be located in one place or distributed across multiple network units. Some or all of the units can be selected to achieve the purpose of this embodiment, depending on actual needs.
[0192] The above description is merely a specific embodiment of this application, but the scope of protection of this application is not limited thereto. Any changes or substitutions that can be easily conceived by those skilled in the art within the scope of the technology disclosed in this application should be included within the scope of protection of this application.
Claims
1. A path planning method for a mobile robot based on the marine predator algorithm, characterized in that, The specific steps include: S1. Collect motion state parameters and information parameters of N obstacles of the same size on the robot's movement path. The motion state parameters of the obstacles include moving state and stationary state. The information parameters of the obstacles include the real-time position of the obstacles, the real-time distance between the obstacles and the robot, and the moving speed of the obstacles. S2. Obtain the position of the obstacle when it is stationary and the distance between the obstacle and the robot. Use a clustering algorithm to divide them into static groups. Obtain the position information of the obstacle when it is moving and the distance between the obstacle and the robot. Continuously update the distance values and use a clustering algorithm to divide them into moving groups. S3. Analyze the position of obstacles and the distance between obstacles and robots in the static group to obtain the shape features of static obstacles. Using the obtained shape features of static obstacles, obtain the shape features of moving obstacles through static map matching, feature extraction and template matching. Analyze the real-time position of obstacles in the moving group, the real-time distance between obstacles and robots and the moving speed of obstacles to obtain the movement trajectory of moving obstacles. S4. The ocean predator algorithm is used to search for the optimal solution. The original path length is introduced, and the original path length is modified according to the movement trajectory of the moving group. The objective function of the modified path is calculated, and the optimal path solution is obtained based on the objective function.
2. The mobile robot path planning method based on the marine predator algorithm according to claim 1, characterized in that, In step S2, when the obstacle is stationary, its position and the distance between the obstacle and the robot are collected, and the obstacle is divided into static groups using a clustering algorithm as follows: Data acquisition: Obtain the location information of obstacles and the distance between obstacles and the robot through sensors. The location information of obstacles can be obtained through GPS positioning, and the distance between obstacles and the robot can be obtained through distance sensors. Feature extraction: Based on the collected data, features are extracted, including the position coordinates of obstacles and the distance between obstacles and the robot; Clustering algorithm: Based on the similarity or distance between samples, the K-means clustering algorithm is selected to group stationary obstacles.
3. The mobile robot path planning method based on the marine predator algorithm according to claim 1, characterized in that, In step S2, the process of acquiring the real-time location information of obstacles and the distance between obstacles and the robot, and dividing them into moving groups using a clustering algorithm, is as follows: Data acquisition: Real-time data acquisition is achieved through sensors, including the real-time position of obstacles, their movement speed, and the real-time distance between obstacles and the robot. The real-time position of obstacles can be obtained through GPS positioning, their movement speed can be obtained through speed sensors, and the real-time distance between obstacles and the robot can be obtained through distance sensors. Feature extraction: Based on the collected data, features are extracted, including the real-time position coordinates of obstacles, the robot's moving speed, and the real-time distance between obstacles and the robot. Clustering process: Based on the similarity or distance between samples, the K-means clustering algorithm is selected to group the moving obstacles.
4. The mobile robot path planning method based on the marine predator algorithm according to claim 1, characterized in that, In step S3, the process of analyzing the position of obstacles in the static group, the distance between obstacles and the robot, and obtaining the shape features of obstacles is as follows: Data acquisition: Obtain the position coordinates of obstacles and the distance information between obstacles and the robot from the static group; Boundary extraction: Based on the obstacle's position coordinates, the Sobel operator is used to obtain the obstacle's boundary; Shape feature calculation: Based on the obtained boundary of the obstacle, the shape feature algorithm is used to obtain the shape feature of the obstacle.
5. The mobile robot path planning method based on the marine predator algorithm according to claim 4, characterized in that, The process of obtaining the boundary of an obstacle using the Sobel operator is as follows: Image grayscale conversion: The image corresponding to the position coordinates of the obstacle is converted to grayscale, transforming a color image into a grayscale image. The formula used is as follows: Y = 0.298 * R + 0.587 * G + 0.114 * B Where Y is the gray value of the obstacle's position coordinates, and R, G, and B are the red, green, and blue component values of the pixels in the image corresponding to the obstacle's position coordinates, respectively. Sobel operator operation: The Sobel operator is used to perform edge detection on grayscale images. The Sobel operator includes two filters, horizontal and vertical, which are used to detect edges in the horizontal and vertical directions of the image, respectively. For horizontal edge detection, the following formula can be used: For vertical edge detection, the following formula can be used: The Sobel operator formula described above is used to perform convolution operations on a grayscale image, calculating the gradient values of each pixel in both the horizontal and vertical directions. The horizontal gradient value can be obtained using the following formula: The horizontal gradient value can be obtained using the following formula: Among them, G X (i,j), G Y (i,j) represent the horizontal and vertical gradient values of the pixel in the i-th row and j-th column, respectively, and X(i,j) represents the grayscale value of the pixel in the i-th row and j-th column. Edge strength calculation: The gradient magnitude of the generated pixel is based on the following formula: Among them, T X (i,j) represents the gradient magnitude of the pixel in the i-th row and j-th column; Edge thresholding: Based on a set threshold, the edge intensity image is thresholded. Pixels with edge intensity exceeding the threshold are marked as edge points, and the remaining pixels are marked as non-edge points. The marked edge points and non-edge points can be used to define the boundary of the obstacle and simulate the shape characteristics of the static obstacle.
6. The mobile robot path planning method based on the marine predator algorithm according to claim 1, characterized in that, In step S3, after obtaining the shape of the static obstacle, the process of obtaining the shape of the moving obstacle is as follows: Static map matching: The map data of static obstacles is matched with the current sensor data. The static map already contains the shape information of static obstacles. The current sensor data can be compared with the map to identify moving obstacles that match the map, thereby obtaining their shape information. Feature extraction and matching: Edge and corner features are extracted from the map data of static obstacles, and then similar feature points are found in the current sensor data. The position and shape of the moving obstacle can be determined by feature matching. Template matching: The shape of a static obstacle is used as a template. Template matching is then performed on the current sensor data. If the area that matches the template is found, it can be identified as a moving obstacle, and its shape can be obtained.
7. The mobile robot path planning method based on the marine predator algorithm according to claim 1, characterized in that, In step S3, the process of analyzing the real-time position of obstacles in the moving group, the real-time distance between obstacles and the robot, and the moving speed to obtain the motion trajectory of obstacles is as follows: Real-time location analysis: The real-time location of an obstacle can be obtained based on GPS positioning data. By recording the location information of the obstacle at different points in time, its position can be changed over time. Real-time distance analysis: The real-time distance between the obstacle and the robot can be calculated using the Euclidean distance formula: Where S is the real-time distance between the obstacle and the robot, x z Let x be the x-coordinate of the obstacle, and y be the y-coordinate of the obstacle. z Let x be the y-coordinate of the obstacle, and x be the x-coordinate of the obstacle. z and y z It can locate the position of obstacles, x j Let x be the robot's x-coordinate and y be the robot's y-coordinate. j Let x be the robot's y-coordinate, and x be the coordinates of the robot. j and y j It can locate the robot's position; Movement speed analysis: The moving speed of an obstacle can be obtained by calculating the change in its position between different points in time. The average speed is calculated using the following formula: in, For average speed, W i t represents the distance difference between the current position and the previous position of the obstacle. i This represents the time interval between the obstacle's previous position and its current position. In summary, by using the real-time position of the moving obstacle, the real-time distance between the obstacle and the robot, and the moving speed, its motion trajectory can be plotted.
8. The mobile robot path planning method based on the marine predator algorithm according to claim 1, characterized in that, In step S4, the marine predator algorithm is used to search for the optimal solution. The original path length is introduced, and it is modified according to the movement trajectory of the moving group. The objective function of the modified path is calculated, and the process of obtaining the optimal path solution based on the objective function is as follows: Cubic spline interpolation is used to smooth the path between the starting point and the target point. If the number of interpolation points in the entire planned path is M, the original path length L is calculated using the following formula: Among them pp i (pp ix pp iy ) is the i-th interpolation point; If some of the intermediate points are located within obstacles, the result is unacceptable; if none of the intermediate points are located within obstacles, the result is acceptable. However, if none of the intermediate points are located within obstacles, but some interpolation points are located within obstacles, the result must be modified. Assume that the region formed by each individual obstacle is a bounded circle, and the bounded circles of the obstacles are shown. Define the center of the i-th bounded circle as ob. i (ob ix ob iy The radius of the i-th bounded circle is ob. ir If the interpolation point pp i Located within obstacle j, the violation is calculated using the following equation: d ij v is the distance between the interpolation point i and the center of the boundary circle j. ij This indicates that if the interpolation point i is located within obstacle j, it is a violation, and v is a complete violation. Based on the movement trajectory information of the mobile group, a certain path length is added or subtracted at each node of the original path. The increment can be adjusted according to the movement direction, speed and distance of the mobile group. If the movement direction of the group is the same as the original path direction, the path length can be reduced; if the direction is opposite, the path length can be increased. Therefore, the modified path length L m The calculation formula is as follows: THE m =L(1+ρv) Where L m The corrected path length is ρ, where ρ is the adjustment factor. Therefore, the objective function L for MPA optimization f The definition is as follows: Where all interpolation points are not in obstacles, then v ij =0, v=0, then L f =L; when some interpolation points are located within obstacles, then L f =L m When some intermediate points are located within obstacles, then L f =∞; Therefore, the optimal solution obtained by the objective function is when L f =L.
9. A mobile robot path planning system based on the marine predator algorithm, characterized in that, The system is used to execute the mobile robot path planning method based on the marine predator algorithm as described in any one of claims 1-8, including: The data acquisition module is used to collect motion state parameters and information parameters of N obstacles of the same size on the robot's movement path. The motion state parameters of the obstacles include moving state and stationary state, and the information parameters of the obstacles include the real-time position of the obstacles, the real-time distance between the obstacles and the robot, and the moving speed of the obstacles. The group classification module is used to obtain the position of obstacles when they are stationary and the distance between obstacles and robots, and classify them into static groups using a clustering algorithm. When obstacles are moving, the module obtains their position information and the distance between obstacles and robots, and continuously updates the distance values, and classifies them into moving groups using a clustering algorithm. The data analysis module is used to analyze the position of obstacles in static groups, the distance between obstacles and robots, and obtain the shape features of static obstacles. Using the obtained shape features of static obstacles, the module obtains the shape features of moving obstacles through static map matching, feature extraction, and template matching. The module also analyzes the real-time position of obstacles in moving groups, the real-time distance between obstacles and robots, and the moving speed of obstacles to obtain the movement trajectory of moving obstacles. The path planning module is used to search for the optimal solution using the marine predator algorithm. It introduces the original path length, modifies the original path length according to the movement trajectory of the moving group, calculates the objective function of the modified path, and obtains the optimal path solution based on the objective function.
10. A storage medium, characterized in that, The storage medium internally stores a computer program, which, when executed by a processor, implements the mobile robot path planning method based on the marine predator algorithm as described in any one of claims 1-8.
