Path planning method, path planning device, robot and readable storage medium
By selecting the path point with the closest distance and the smallest identification number in the robot path planning, the location error caused by path crossing or overlap is solved, ensuring that the robot accurately tracks the path and avoids the loss of the target area.
Patent Information
- Application Number
- CN202311866073.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-29
- Publication Date
- 2025-07-01
AI Technical Summary
When a robot is planning a path, the paths cross or overlap will cause positioning errors and some paths and target areas will be lost.
By determining the current location of the robot and the path point identification number in the current remaining path, select the path point with the closest and smallest identification number as the current path point, and delete the previous path point to update the remaining path.
Improve the accuracy of path points, avoid the problem of missing target areas due to loss of planned paths, and enhance the robot's path tracking ability.
Smart Images

Figure CN120233769A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the technical field of robot control, and more particularly, to a path planning method, a path planning device, a robot, and a non-volatile computer-readable storage medium. Background Art
[0002] When a robot performs path planning currently, it first obtains the current real-time position of the robot, then calculates the path point on the entire path that is closest to the current position of the machine, and takes the path point as the current path point of the robot in the path. Then, the next path point of the current path point is selected as the target path point to control the movement path of the robot. However, in the case of path intersection or overlap during path planning, positioning errors are likely to occur, resulting in the robot losing part of the path and thus losing part of the target area. For example, the 25th path point and the 50th path point coincide. When the robot executes to the 25th path point, the current path point is determined as the 50th path point and the robot continues to walk along the 50th path point. In this way, the robot will lose the path between the 25th path point and the 50th path point, as well as the corresponding target area. Summary of the Invention
[0003] Embodiments of the present application provide a path planning method, a path planning device, a robot, and a non-volatile computer-readable storage medium to improve the accuracy of the target path point, thereby avoiding the problem of missing the target area due to losing the planned path.
[0004] The path planning method according to the embodiments of the present application includes determining the current position of the robot; obtaining the current remaining path of the robot, where the current remaining path is the path to be traveled in the global path of the robot, the global path includes multiple path points, and each path point is set with a corresponding identification number, and the identification numbers are set from small to large according to the order of passing of the path points in the global path; determining at least one candidate path point according to the distance between the current position and the path points in the current remaining path; determining, from the at least one candidate path point, one of the candidate path points as the current path point according to the size of the identification numbers of the at least one candidate path point; deleting the path before the current path point from the current remaining path to obtain a target path; and updating the current remaining path to the target path so that the robot moves according to the updated current remaining path.
[0005] In some embodiments, determining one of the at least one candidate path point as the current path point according to the magnitude of the identification numbers of the at least one candidate path point includes: determining the candidate path point with the smallest identification number as the reference path point from the at least one candidate path point; determining the connection line between the current position and the reference path point, and determining the included angle α between this connection line and the path after the reference path point; in the case of 0° ≤ α ≤ 90°, deleting the reference path point from the at least one candidate path point, and re-entering the step of determining the candidate path point with the smallest identification number as the reference path point from the at least one candidate path point; in the case of 90° < α ≤ 180°, determining the reference path point as the current path point.
[0006] In some embodiments, determining one of the at least one candidate path point as the current path point according to the magnitude of the identification numbers of the at least one candidate path point includes: determining the candidate path point with the smallest identification number as the current path point from the at least one candidate path point.
[0007] In some embodiments, before determining the candidate path point with the smallest identification number as the current path point from the at least one candidate path point, the method further includes: determining the connection line between the current position and each candidate path point, and determining the included angle β between each connection line and the path after the corresponding candidate path point; determining the candidate path point with the smallest identification number as the current path point from the at least one candidate path point includes: determining the candidate path point with the smallest identification number as the current path point from the candidate path points where the included angle β is in (90°, 180°].
[0008] In some embodiments, determining at least one candidate path point according to the distance between the current position and the path points in the current remaining path includes: selecting the first N path points with smaller identification numbers as intermediate path points from the path points in the current remaining path, where N is a positive integer; calculating the distance between each intermediate path point and the current position; according to the distance corresponding to each intermediate path point, selecting the first M intermediate path points with smaller distances as the candidate path points, where M is a positive integer and M is not greater than N.
[0009] The path planning device according to the embodiment of the present application includes a first determination module, a first acquisition module, a second determination module, a third determination module, a deletion module, and an update module. The first determination module is configured to determine the current position of the robot. The first acquisition module is configured to acquire the current remaining path of the robot. The current remaining path is the path to be traveled in the global path of the robot. The global path includes a plurality of path points, and each path point is provided with a corresponding identification number, and the identification numbers are set in ascending order according to the order of passing of the path points in the global path. The second determination module is configured to determine at least one candidate path point according to the distance between the current position and the path points in the current remaining path. The third determination module is configured to determine, from the at least one candidate path point, one of the candidate path points as the current path point according to the size of the identification numbers of the at least one candidate path point. The deletion module is configured to delete the path before the current path point from the current remaining path to obtain a target path. The update module is configured to update the current remaining path to the target path so that the robot moves according to the updated current remaining path.
[0010] In some embodiments, the third determination module is configured to: determine, from the at least one candidate path point, the candidate path point with the smallest identification number as a reference path point; determine the connection line between the current position and the reference path point, and determine the included angle α between the connection line and the path after the reference path point; in the case of 0° ≤ α ≤ 90°, delete the reference path point from the at least one candidate path point, and re-enter the step of determining, from the at least one candidate path point, the candidate path point with the smallest identification number as the reference path point; in the case of 90° < α ≤ 180°, determine the reference path point as the current path point.
[0011] In some embodiments, the third determination module is configured to determine, from the at least one candidate path point, the candidate path point with the smallest identification number as the current path point.
[0012] In some embodiments, the third determination module is configured to determine the connection line between the current position and each candidate path point, determine the included angle β between each connection line and the path after the corresponding candidate path point, and determine, from the candidate path points with the included angle β in (90°, 180°], the candidate path point with the smallest identification number as the current path point.
[0013] In some embodiments, the second determination module is configured to select the first N waypoints with smaller identification numbers from the waypoints in the current remaining path as intermediate waypoints, where N is a positive integer; calculate the distance between each of the intermediate waypoints and the current position; and select the first M intermediate waypoints with smaller distances from the N intermediate waypoints as the candidate waypoints, where M is a positive integer and M is not greater than N.
[0014] The robot according to the embodiment of the present application includes a processor, a memory, and a computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the path planning method according to any one of the above embodiments.
[0015] The non-volatile computer-readable storage medium according to the embodiment of the present application includes a computer program, and when the computer program is executed by a processor, the processor is caused to execute the path planning method according to any one of the above embodiments.
[0016] The path planning method, path planning device, robot, and non-volatile computer-readable storage medium according to the embodiments of the present application first determine the current position of the robot and obtain the current remaining path of the robot, where the current remaining path is the path to be traveled in the global path of the robot, and the global path includes multiple path points. Each current path point is set with a corresponding identification number, and the current path point identification number is set from small to large according to the order of passing of the path points in the global path of the current path point. Then, according to the distance between the current position and the path points in the current remaining path, select the path points closer to the current position as candidate path points to determine at least one candidate path point. Next, according to the size of the identification number of the candidate path points, determine one candidate path point as the current path point from at least one candidate path point, so as to determine the current path point by combining the order of the candidate path points in the current remaining path and the distance between the candidate path points and the current position, thereby selecting the current path point that is closer to the current position and has a smaller identification number. Then, delete the path before the current path point from the current remaining path to obtain the target path, and update the current remaining path to the target path. Then, the robot can move according to the updated current remaining path. In this way, the current path point that can reflect the position of the current position in the current remaining path can be accurately selected, and it is ensured that the robot can travel according to the current remaining path determined by deleting the path before the current path point. Even in the case where the paths overlap or cross, and the robot has not passed the path point with a smaller identification number among the overlapping path points, the robot will not confirm the path point with a larger identification number among the overlapping path points as the current path point, so that the robot can travel according to the path point with a smaller identification number. In this way, the accuracy of the current path point can be ensured, thereby avoiding the problem of missing the planned path and resulting in the lack of the target area.
[0017] Additional aspects and advantages of the embodiments of the present application will be given in part in the following description, become apparent in part from the following description, or be learned through the practice of the embodiments of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0018] The above and / or additional aspects and advantages of the present application will become apparent and be readily understood from the following description of the embodiments in conjunction with the accompanying drawings, in which:
[0019] Figure 1 is a flowchart of the path planning method according to some embodiments of the present application;
[0020] Figure 2 is a usage scenario diagram of the path planning method according to some embodiments of the present application;
[0021] Figure 3 is a usage scenario diagram of the path planning method according to some embodiments of the present application;
[0022] Figure 4 It is a usage scenario diagram of the path planning method according to some embodiments of the present application;
[0023] Figure 5 It is a usage scenario diagram of the path planning method according to some embodiments of the present application;
[0024] Figure 6 It is a schematic flowchart of the path planning method according to some embodiments of the present application;
[0025] Figure 7 It is a schematic flowchart of the path planning method according to some embodiments of the present application;
[0026] Figure 8 It is a schematic flowchart of the path planning method according to some embodiments of the present application;
[0027] Figure 9 It is a schematic diagram of modules of the path planning device according to some embodiments of the present application;
[0028] Figure 10 It is a schematic structural diagram of the robot according to some embodiments of the present application;
[0029] Figure 11 It is a schematic diagram of the connection state between a non - volatile computer - readable storage medium and a processor according to some embodiments of the present application. Detailed Embodiments
[0030] The following details the embodiments of the present application. The examples of the embodiments are shown in the accompanying drawings, where the same or similar reference numerals denote the same or similar elements or elements with the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and are only used to explain the embodiments of the present application, and should not be construed as a limitation of the embodiments of the present application.
[0031] In the prior art, during the navigation of a wheeled robot, the A* algorithm or the shortest path algorithm (such as the Dijsktra algorithm) is commonly used to generate a global path, and then the Dynamic Window Approaches (DWA) is used for local planning and obstacle avoidance. During the process of the robot executing the planned path, the robot will calculate its own position in the path in real time, and then calculate the linear velocity and angular velocity required by the robot at the next moment according to the current position. The commonly used calculation method for calculating the current position of the robot in the path currently is: obtaining the current real-time position of the robot through the Simultaneous Localization And Mapping (SLAM) algorithm, calculating the path point on the entire path that is closest to the current position of the robot, and then using the path point with the closest distance as the current path point of the robot in the path, and selecting the next path point of the current path point as the target path point to control the movement path of the robot. However, in the case of path intersections or overlaps in the planned path, the current such calculation method is prone to positioning errors, resulting in the robot losing part of the path and losing part of the target area. For example, the 25th path point and the 50th path point overlap. When the robot executes to the 25th path point, the current path point is determined as the 50th path point and continues to walk along the 50th path point. In this way, the robot will lose the path between the 25th path point and the 50th path point, as well as the corresponding target area.
[0032] To solve the above technical problems, an embodiment of the present application provides a path planning method.
[0033] The path planning method of the present application will be elaborated in detail below:
[0034] Please refer to Figure 1 , an embodiment of the present application provides a path planning method, and the path planning method includes:
[0035] Step 011: Determine the current position of the robot;
[0036] Specifically, first, the robot needs to obtain the current position of the robot. For example, the robot can obtain the current position of the robot in the current map through the SLAM algorithm, so as to subsequently determine the path point of the robot in the planned path according to the current position.
[0037] Step 012: Obtain the current remaining path of the robot. The current remaining path is the path to be traveled in the global path of the robot. The global path includes multiple path points, and each path point is set with a corresponding identification number, and the identification numbers are set from small to large according to the order of passing of the path points in the global path;
[0038] Specifically, the global path is the path set by the robot according to the work task. The global path includes multiple path points, and each path point is set with a corresponding identification number. The identification numbers are set from small to large according to the order of passing of the path points in the global path. For example, the identification number of the first path point of the global path is 0, the identification number of the second path point is 1, the identification number of the third path point is 2, and so on, until the last path point of the global path is also set with a corresponding identification number. It can be understood that when the robot is working, it will first pass through the path points with small identification numbers, and then pass through the path points with large identification numbers.
[0039] The current remaining path is the path to be traveled in the global path of the robot. For example, when the robot is at the first path point, the current remaining path is the global path. When the robot is at the tenth path point, the current remaining path is all the paths after the tenth path point. Therefore, at this time, it is also necessary to obtain the current remaining path of the robot to initially confirm the movement path of the robot.
[0040] Step 013: Determine at least one candidate path point according to the distance between the current position and the path points in the current remaining path;
[0041] Specifically, after determining the current position, the distance between the current position and the path points in the current remaining path can be calculated. Then, according to the distance between the current position and the path points in the current remaining path, at least one candidate path point with a smaller distance is determined to select the candidate path points closer to the current position in the current remaining path, so as to facilitate determining the position of the current position in the current remaining path.
[0042] For example, a distance can be preset. For example, the preset distance is 1m, 2m or 5m. Taking the current position as the center and the preset distance as the radius, a preset range can be obtained, and the path points within this range can be determined as candidate path points.
[0043] Alternatively, the path points of the current remaining path can also be sorted according to the distance between each path point in the current remaining path and the current position, and then the first M path points in the order of distance are used as candidate path points. At this time, the preset range is from the first path point in the order of distance to the Mth path point in the sorting. Wherein, M is a positive integer, and M can be determined according to the number of path points in the global path. For example, when there are 100 path points in the global path, M can be 20; when there are 20 path points in the global path, M can be 5.
[0044] Step 014: Determine one candidate path point as the current path point from at least one candidate path point according to the size of the identification numbers of at least one candidate path point;
[0045] Specifically, after determining the candidate path points, according to the magnitudes of the identification numbers of at least one candidate path point, one candidate path point is determined from at least one candidate path point as the current path point, so as to determine the current path point reflecting the current position in combination with the order of the candidate path points in the global path. For example, the point with the smallest identification number among the candidate path points can be used as the current path point, or a path point located in front of the current position can be selected from the candidate path points, and then the point with the smallest identification number among the path points in front of the current position is selected as the current path point. In this way, the current path point can be determined by combining the identification number and the distance, so as to select a path point with a relatively short distance and a relatively small identification number from the current remaining path as the current path point, so that even when the paths overlap or cross and the robot has not passed through the path point with a relatively small identification number among the overlapping path points, the path point with a relatively large identification number among the overlapping path points will not be recognized as the current path point, thereby improving the accuracy of the current path point.
[0046] Step 015: Delete the path before the current path point from the current remaining path to obtain the target path;
[0047] Specifically, after each determination of the current path point, the path before the current path point can be deleted from the current remaining path, that is, the path corresponding to the path point with an identification number smaller than that of the current path point in the current remaining path is deleted to obtain the target path. For example, please refer to Figure 2 , the global path is as Figure 2 (a) shown. When the current path point is the candidate path point with the smallest identification number, the target path is as Figure 2 (b). When the current path point is the path point with the smallest identification number and an obtuse angle among the candidate path points, the target path is as Figure 2 (c) shown.
[0048] As the number of times of determining the current path point and the number of times of deleting the path before the current path point increase continuously, the length of the current remaining path decreases continuously. For example, the current remaining path corresponding to the first path point is the global path, and the current remaining path corresponding to the third path point is the path after the third path point. When determining the next path point, the path after the third path point can be used to determine the current path point. In this way, the calculation amount can be continuously reduced during the process of determining the current path point, thereby saving the computing resources of the robot.
[0049] At the same time, among the overlapping path points, when the robot has passed through the path point with a relatively small identification number, the path point with a relatively small identification number will be deleted from the current remaining path, so that when the next path point of the robot is the path point with a relatively large identification number, the process of determining the target path point will not be affected by the path point with a relatively small identification number, that is, the path point with a relatively small identification number will not be recognized as the current path point.
[0050] Step 016: Update the current remaining path to the target path so that the robot moves according to the updated current remaining path.
[0051] Specifically, after determining the target path, the current remaining path can be updated to the target path, and subsequently the robot can move according to the updated current remaining path. For example, based on the current position, the first path point in the current remaining path, and the corresponding algorithm, such as the DWA algorithm, the target linear velocity and target angular velocity of the robot can be determined to determine the linear velocity and angular velocity required by the robot at the next moment, and then the robot can be controlled based on the target linear velocity and target angular velocity to ensure that the robot can accurately reach the first path point in the current remaining path. It can be understood that the accuracy of the first path point in the current remaining path is relatively high, so the path tracking ability of the robot is relatively strong at this time.
[0052] The path planning method according to the embodiment of the present application first determines the current position of the robot and obtains the current remaining path of the robot. The current remaining path is the path to be traveled in the global path of the robot, and the global path includes multiple path points. Each current path point is set with a corresponding identification number, and the current path point identification number is set from small to large according to the order of passing of the path points in the global path. Then, according to the distance between the current position and the path points in the current remaining path, the path point closer to the current position is selected as the candidate path point to determine at least one candidate path point. Then, according to the size of the identification number of the candidate path point, one candidate path point can be determined from at least one candidate path point as the current path point to determine the current path point by combining the order of the candidate path point in the current remaining path and the distance between the candidate path point and the current position, so as to select the current path point that is closer to the current position and has a smaller identification number. Then, the paths before the current path point are deleted from the current remaining path to obtain the target path, and the current remaining path is updated to the target path. Then the robot can move according to the updated current remaining path. In this way, the current path point that can reflect the position of the current position in the current remaining path can be accurately selected, and it can be ensured that the robot can travel according to the current remaining path determined by deleting the paths before the current path point. Even in the case where the paths overlap or cross and the robot has not passed the path point with a smaller identification number among the overlapping path points, the robot will not confirm the path point with a larger identification number among the overlapping path points as the current path point, so that the robot can travel according to the path point with a smaller identification number, thus ensuring the accuracy of the current path point and avoiding the problem of missing the planned path and resulting in the absence of the target area.
[0053] Please combine Figure 3 and Figure 4 , Figure 3 (a) andFigure 4 (a) includes the planned path and the actual walking path of the robot applying the current path planning scheme. Figure 3 (b) and Figure 4 (b) includes the planned path and the actual walking path of the robot applying the path planning scheme of the present application.
[0054] Figure 3 The black lines are the planned paths, and the gray lines are the actual walking paths of the robots. Figure 3 (a) and Figure 3 (b) have the same planned path. Assume that the overlapping path points are the 20th path point and the 50th path point. It can be seen from Figure 3 that Figure 3 in (a), the robot directly walks along the 50th path point, causing the robot to lose the path between the 20th path point and the 50th path point; while Figure 3 in (b), the robot still continues to walk along the 20th path point, and the walking path is basically the same as the planned path.
[0055] Figure 4 In, the line pointed by the arrow is the actual walking path, and the other path is the planned path. Figure 4 (a) and Figure 4 (b) have the same planned path. Assume that the overlapping path points are the 5th path point and the 60th path point. It can be seen from Figure 4 that Figure 4 in (a), the robot directly walks along the 60th path point, causing the robot to lose the path between the 5th path point and the 60th path point; while Figure 4 in (b), the robot still continues to walk along the 5th path point, and the walking path is basically the same as the planned path.
[0056] Thus, it can be seen that the robot applying the path planning scheme of the present application has strong path tracking ability, and the actual walking path is basically the same as the planned path.
[0057] Please refer to Figure 5 , in some embodiments, step 014: determining a candidate path point as the current path point from at least one candidate path point according to the magnitudes of the identification numbers of at least one candidate path point includes:
[0058] Step 0141: determining the candidate path point with the smallest identification number as the reference path point from at least one candidate path point;
[0059] Step 0142: determining the connection line between the current position and the reference path point, and determining the included angle α between this connection line and the path after the reference path point;
[0060] Step 0143: When 0°≦α≦90°, delete the reference path point from at least one candidate path point, and re-enter the step of determining the candidate path point with the smallest identification number as the reference path point from at least one candidate path point;
[0061] Step 0144: When 90°<α≦180°, determine the reference path point as the current path point.
[0062] Specifically, after determining the candidate path points, the candidate path point with the smallest identification number can be first determined as the reference path point. It can be understood that the reference path point is the path point with the smallest identification number among the path points closer to the current position. The path points in the current remaining path before the reference path point can be confirmed as the passed path points. Subsequently, the current path point is needed to update the current remaining path. Therefore, the current path point can be selected from the unpassed path points so that all the path points of the updated current remaining path are unpassed path points, thus ensuring that the robot does not go back. And the reference path point may also be a passed path point. Therefore, it is also necessary to confirm whether the reference path point is a passed path point.
[0063] Please refer to Figure 2 , the straight line with an arrow in the figure is the current remaining path, the arrow direction is the path direction, and point A is the current position of the robot. After selecting the candidate path points, path point B and path point C, and the path points between path point B and path point C are candidate path points.
[0064] According to Figure 2 It can be inferred that when the angle α between the connection line of the current position and the path point and the path after the reference path point is a right angle, this path point is the closest to the current position, and this path point can be confirmed as the path point corresponding to the current position of the robot in the current remaining path. It can be understood that the path point corresponding to the right angle is a passed path point. For those path points with an acute angle, such as path point B, they can also be confirmed as passed path points. Therefore, when 0°≦α≦90°, this path point can be confirmed as a passed path point. And when 90°<α≦180°, this path point can be confirmed as an unpassed path point. For example, path point C and path point E are unpassed path points, and the corresponding angles are obtuse angles. Therefore, the reference path point can be judged whether it is a passed path point according to the angle between the connection line of the current position and the reference path point and the path after the reference path point.
[0065] At this time, the included angle α between the line connecting the current position and the reference path point and the path after the reference path point can be calculated. When 90° < α ≤ 180°, it can be confirmed that the reference path point is the path point with the smallest identification number among the unpassed path points. It can be understood that the reference path point is the path point that can best represent the position corresponding to the current position in the global path among the unpassed path points. Therefore, the reference path point can be confirmed as the current path point. In this way, after updating the current remaining path based on the current path point subsequently, all path points in the current remaining path are unpassed path points, thus preventing the robot from taking a U-turn. When 0° ≤ α ≤ 90°, it can be confirmed that the reference path point is a passed path point. The reference path point needs to be deleted from the candidate path points, and step 0131 is re-entered. At this time, the confirmed reference path point is the next path point of the previous reference path point among the candidate path points, and then it is judged whether the currently confirmed reference path point is an unpassed path point. This cycle continues until the included angle corresponding to the reference path point is an obtuse angle.
[0066] For example Figure 2 in, the candidate path points include path point B, path point C, path point D, and path point E. The identification number of path point B is the smallest, and path point B can be first confirmed as the reference path point. When it is confirmed that the included angle of path point B is an acute angle, path point B is deleted, and the next candidate path point, that is, path point D, is confirmed as the reference path point. When it is confirmed that the included angle of path point D is a right angle, path point D is deleted, and the next candidate path point, that is, path point E, is confirmed as the reference path point. When it is confirmed that the included angle of path point E is an obtuse angle, path point E can be confirmed as the current path point.
[0067] In addition, when updating the current remaining path, after confirming the reference path point, the target path can be determined according to the path points in the current remaining path whose identification numbers are greater than or equal to the identification number of the reference path point, so as to determine the current remaining path, and obtain the current remaining path as shown in Figure 2 (b). Then, the current path point is determined according to the updated current remaining path, and the current remaining path is updated according to the current path point, so as to obtain the current remaining path as shown in Figure 2 (c). Of course, after confirming the reference path point, the current remaining path may not be updated first, and the update of the current remaining path is only completed when the current path point is determined.
[0068] In this way, after determining the reference path points according to the identification numbers and confirming the current path point according to the included angles corresponding to the reference path points, it can be confirmed that the current path point is the path point with the smallest identification number among the unpassed path points. Therefore, after controlling the robot to move according to the current path point, the deviation between the actual movement path of the robot and the planned path is small, the probability of losing part of the path and part of the target area is small, and the path tracking ability of the robot is strong. At the same time, the current path point obtained at this time is the path point that can best represent the position corresponding to the current position in the global path among the unpassed path points. After updating the current remaining path according to the current path point, all the path points in the current remaining path are unpassed path points. Therefore, after controlling the robot to move according to the current remaining path, it can be ensured that the robot will not go back the same way.
[0069] Please refer to Figure 6 , in some embodiments, step 014: determining a candidate path point as the current path point from at least one candidate path point according to the magnitudes of the identification numbers of the at least one candidate path point includes:
[0070] Step 0145: determining the candidate path point with the smallest identification number as the current path point.
[0071] Specifically, the candidate path point with the smallest identification number can be directly determined as the current path point, that is, the path point with the smallest identification number among the path points closer to the current position is used as the current path point. It can be understood that in the case of path overlap or intersection and the robot has not passed the path point with a smaller identification number among the overlapping path points, the confirmed current path point is unlikely to be the path point with a larger identification number among the intersecting or overlapping path points. In this way, in the case of path overlap or intersection and the robot has not passed the path point with a smaller identification number among the overlapping path points, it can be prevented from using the path point with a larger identification number among the intersecting or overlapping path points as the current path point, thereby reducing the occurrence probability of the robot losing the path and part of the target area and ensuring that the deviation between the actual movement path of the robot and the planned path is small.
[0072] Please refer to Figure 7 , in some embodiments, step 014: determining a candidate path point as the current path point from at least one candidate path point according to the magnitudes of the identification numbers of the at least one candidate path point includes:
[0073] Step 0146: determining the connection lines between the current position and each candidate path point, and determining the included angle β between each connection line and the path after the corresponding candidate path point;
[0074] Step 0147: determining the candidate path point with the smallest identification number among the candidate path points with the included angle β in the range of (90°, 180°] as the current path point.
[0075] Specifically, after determining the candidate path points, the connection lines between the current position and each candidate path point can be determined, and the angles β between each connection line and the path after the corresponding candidate path point can be determined to confirm the angles corresponding to each candidate path point. In the case of 90° < α ≤ 180°, the candidate path points are unpassed path points, and the current path point needs to be determined from these unpassed candidate path points. Therefore, according to the angle, the candidate path points with the angle β in (90°, 180°] can be selected from the candidate path points, and among the candidate path points with the angle β in (90°, 180°], the candidate path point with the smallest identification number can be determined as the current path point. The current path point obtained at this time is the path point with the smallest identification number among the unpassed path points. It can be understood that the current path point obtained at this time is the path point among the unpassed path points that can best represent the position corresponding to the current position in the global path, so that after updating the current remaining path according to the current path point, all the path points in the current remaining path are unpassed path points. In this way, on the one hand, the accuracy of the current path point can be ensured by screening the identification number to prevent the occurrence of path loss, and on the other hand, the robot can be ensured not to go back by screening the angle, so that the deviation between the actual movement path of the robot and the planned path is small.
[0076] Please refer to Figure 8 , in some embodiments, step 013: determining at least one candidate path point according to the distances between the current position and the path points in the current remaining path, including:
[0077] Step 0131: Select the first N path points with smaller identification numbers from the path points in the current remaining path as intermediate path points, where N is a positive integer;
[0078] Step 0132: Calculate the distances between each intermediate path point and the current position;
[0079] Step 0133: According to the distances corresponding to each intermediate path point, select the first M intermediate path points with smaller distances from these N intermediate path points as candidate path points, where M is a positive integer and M is not greater than N.
[0080] Specifically, after the robot determines the current path point each time, it can clip the current remaining path to delete the passed path points from the current remaining path. Therefore, the distance between the next path point in the planned path and the first path point of the current remaining path is generally not too far. At this time, according to the identification numbers of the path points of the current remaining path, the first N path points with smaller identification numbers can be selected as intermediate path points, that is, the path points ranked first to Nth in identification number in the current remaining path are all used as intermediate path points. For example, the first 20 path points in the current remaining path can be determined as intermediate path points, or the first 50 path points in the current remaining path can be determined as intermediate path points.
[0081] Next, calculate the distance between the intermediate path points and the current position, and sort the intermediate path points according to the distances corresponding to each intermediate path point in ascending order, so as to facilitate subsequent determination of the intermediate path points closer to the current position according to the sorting. Then, according to the distances corresponding to each intermediate path point, select the first M intermediate path points with smaller distances from the N intermediate path points as candidate path points, where M is a positive integer and M is not greater than N, so as to obtain candidate path points closer to the current position. Among them, the values of M and N can be determined according to the length of the global path.
[0082] In this way, path points closer to the current position and with smaller identification numbers can be selected as candidate path points in the current remaining path according to the sorting of distances and identification numbers, so as to facilitate subsequent accurate determination of the current path point according to the candidate path points closer to the current position. At the same time, during the process of confirming the candidate path points, only the distances between the path points ranked in the top N in identification number and the current position need to be calculated, rather than the distances between all path points in the current remaining path and the current position, so as to reduce the calculation amount in the process of determining the candidate path points, thereby saving the computing resources of the robot and improving the rate of determining the candidate path points.
[0083] Please refer to Figure 9, To facilitate the better implementation of the path planning method of the embodiments of the present application, the embodiments of the present application further provide a path planning device 10. The path planning device 10 includes a first determination module 11, a first acquisition module 12, a second determination module 13, a third determination module 14, a deletion module 15, and an update module 16. The first determination module 11 is used to determine the current position of the robot. The first acquisition module 12 is used to acquire the current remaining path of the robot. The current remaining path is the path to be traveled in the global path of the robot. The global path includes multiple path points, and each path point is set with a corresponding identification number. The identification numbers are set in ascending order according to the order of passing of the path points in the global path. The second determination module 13 is used to determine at least one candidate path point according to the distance between the current position and the path points in the current remaining path. The third determination module 14 is used to determine a candidate path point as the current path point from at least one candidate path point according to the magnitude of the identification numbers of at least one candidate path point. The deletion module 15 is used to delete the path before the current path point from the current remaining path to obtain the target path. The update module 16 is used to update the current remaining path to the target path so that the robot moves according to the updated current remaining path.
[0084] The third determination module 14 is further used to determine the candidate path point with the smallest identification number as the reference path point from at least one candidate path point; determine the connection line between the current position and the reference path point, and determine the included angle α between the connection line and the path after the reference path point; in the case of 0° ≤ α ≤ 90°, delete the reference path point from at least one candidate path point, and re-enter the step of determining the candidate path point with the smallest identification number as the reference path point from at least one candidate path point; in the case of 90° < α ≤ 180°, determine the reference path point as the current path point.
[0085] The third determination module 14 is further used to determine the candidate path point with the smallest identification number as the current path point from at least one candidate path point.
[0086] Specifically, the third determination module 14 is used to determine the connection line between the current position and each candidate path point, and determine the included angle β between each connection line and the path after the corresponding candidate path point; determine the candidate path point with the smallest identification number as the current path point from the candidate path points with the included angle β in the range of (90°, 180°].
[0087] In the above, the path planning device 10 has been described from the perspective of functional modules in combination with the accompanying drawings. This functional module can be implemented in the form of hardware, can also be implemented by instructions in the form of software, or can also be implemented by a combination of hardware and software modules. Specifically, each step of the method embodiment in the embodiments of the present application can be completed by the integrated logic circuit in the hardware of the processor and / or instructions in the form of software. The steps of the method disclosed in combination with the embodiments of the present application can be directly embodied as being executed and completed by the hardware-encoded processor, or can be executed and completed by a combination of the hardware and software modules in the encoded processor. Optionally, the software module can be located in a mature storage medium in the art such as a random access memory, a flash memory, a read-only memory, a programmable read-only memory, an electrically erasable programmable memory, a register, etc. This storage medium is located in the memory, and the processor reads the information in the memory and combines its hardware to complete the steps in the above method embodiment.
[0088] Please refer to Figure 10 , the robot 100 of the embodiment of the present application includes a processor 20, a memory 30, and a computer program. Among them, the computer program is stored in the memory 30 and is executed by the processor 20. The computer program includes instructions for executing the path planning method of any one of the above embodiments.
[0089] Please refer to Figure 11 , the embodiment of the present application also provides a non-volatile computer-readable storage medium 300, on which a computer program 310 is stored. When the computer program 310 is executed by the processor 30, the steps of the path planning method of any one of the above embodiments are implemented. For the sake of brevity, it will not be elaborated here.
[0090] In the description of this specification, the descriptions referring to terms such as "certain embodiments", "in an example", "exemplarily", etc. mean that the specific features, structures, materials or characteristics described in combination with the embodiments or examples are included in at least one embodiment or example of the present application. In this specification, the schematic expressions of the above terms do not necessarily refer to the same embodiment or example. Moreover, the specific features, structures, materials or characteristics described can be combined in a suitable manner in any one or more embodiments or examples. In addition, without contradiction, those skilled in the art can combine and combine the different embodiments or examples described in this specification and the features of different embodiments or examples.
[0091] Any process or method description, whether in a flowchart or otherwise described herein, can be understood to represent a module, segment, or portion of code including one or more executable instructions for implementing a specific logical function or process. The scope of the preferred embodiments of the present application includes additional implementations, where the functions may be performed in a substantially simultaneous manner or in a reverse order according to the functions involved, rather than in the order shown or discussed. This should be understood by those skilled in the art to which the embodiments of the present application pertain.
[0092] Although the embodiments of the present application have been shown and described above, it can be understood that the above embodiments are exemplary and should not be construed as limiting the present application. Those of ordinary skill in the art can make changes, modifications, substitutions, and variations to the above embodiments within the scope of the present application.
Claims
1. A path planning method, characterized in that, The method includes: Determining the current position of the robot; Obtaining the current remaining path of the robot, where the current remaining path is the path to be traveled in the global path of the robot, the global path includes a plurality of path points, and each path point is set with a corresponding identification number, and the identification numbers are set from small to large according to the order of passing of the path points in the global path; Determining at least one candidate path point according to the distance between the current position and the path points in the current remaining path; Determining, from the at least one candidate path point, one of the candidate path points as the current path point according to the magnitude of the identification numbers of the at least one candidate path point; Deleting the path before the current path point from the current remaining path to obtain a target path; Updating the current remaining path to the target path so that the robot moves according to the updated current remaining path.
2. The path planning method according to claim 1, wherein The determining, from the at least one candidate path point, one of the candidate path points as the current path point according to the magnitude of the identification numbers of the at least one candidate path point includes: Determining, from the at least one candidate path point, the candidate path point with the smallest identification number as the reference path point; Determining the connection line between the current position and the reference path point, and determining the included angle α between this connection line and the path after the reference path point; In the case where 0° ≤ α ≤ 90°, deleting the reference path point from the at least one candidate path point, and re-entering the step of determining, from the at least one candidate path point, the candidate path point with the smallest identification number as the reference path point; In the case where 90° < α ≤ 180°, determining the reference path point as the current path point.
3. The path planning method according to claim 1, characterized in that The determining, from the at least one candidate path point, one of the candidate path points as the current path point according to the magnitude of the identification numbers of the at least one candidate path point includes: Determining, from the at least one candidate path point, the candidate path point with the smallest identification number as the current path point.
4. The path planning method according to claim 1, wherein The determining, from the at least one candidate path point, one of the candidate path points as the current path point according to the magnitude of the identification numbers of the at least one candidate path point includes: Determining the connection line between the current position and each candidate path point, and determining the included angle β between each connection line and the path after the corresponding candidate path point; Determining, from the candidate path points where the included angle β is within (90°, 180°], the candidate path point with the smallest identification number as the current path point.
5. The path planning method according to claim 1 or 3, characterized in that, The determining at least one candidate path point according to the distance between the current position and the path points in the current remaining path includes: Selecting the first N path points with smaller identification numbers from the path points in the current remaining path as intermediate path points, where N is a positive integer; Calculating the distance between each intermediate path point and the current position; Selecting the first M intermediate path points with smaller distances from the N intermediate path points as the candidate path points according to the distance corresponding to each intermediate path point, where M is a positive integer and M is not greater than N.
6. A path planning device, characterized in that, Includes: A first determination module for determining the current position of the robot; A first acquisition module, configured to acquire the current remaining path of the robot, where the current remaining path is the path to be traveled in the global path of the robot, the global path includes a plurality of path points, and each path point is set with a corresponding identification number, and the identification numbers are set in ascending order according to the order of passing of the path points in the global path; A second determination module, configured to determine at least one candidate path point according to the distance between the current position and the path points in the current remaining path; A third determination module, configured to determine, from the at least one candidate path point, one of the candidate path points as the current path point according to the magnitudes of the identification numbers of the at least one candidate path point; A deletion module, configured to delete the path before the current path point from the current remaining path to obtain a target path; An update module, configured to update the current remaining path to the target path, so that the robot moves according to the updated current remaining path.
7. The path planning device according to claim 6, wherein the third determination module is configured to determine, from the at least one candidate path point, the candidate path point with the smallest identification number as a reference path point; determine the connection line between the current position and the reference path point, and determine the included angle α between the connection line and the path after the reference path point; in the case where 0° ≤ α ≤ 90°, delete the reference path point from the at least one candidate path point, and re-enter the step of determining, from the at least one candidate path point, the candidate path point with the smallest identification number as the reference path point; in the case where 90° < α ≤ 180°, determine the reference path point as the current path point; or the third determination module is configured to determine, from the at least one candidate path point, the candidate path point with the smallest identification number as the current path point; or the third determination module is configured to determine the connection line between the current position and each candidate path point, determine the included angle β between each connection line and the path after the corresponding candidate path point, and determine, from the candidate path points with the included angle β in (90°, 180°], the candidate path point with the smallest identification number as the current path point.
8. The path planning device according to claim 6, wherein The second determination module is configured to select the first N path points with smaller identification numbers from the path points in the current remaining path as intermediate path points, where N is a positive integer; calculate the distance between each intermediate path point and the current position; and select the first M intermediate path points with smaller distances from the N intermediate path points as the candidate path points, where M is a positive integer and M is not greater than N.
9. A robot, characterized in that, Including: a processor and a memory; and a computer program, wherein the computer program is stored in the memory and executed by the processor, and the computer program includes instructions for executing the path planning method according to any one of claims 1 to 5.
10. A non-volatile computer-readable storage medium for a computer program, characterized in that, When the computer program is executed by one or more processors, the path planning method according to any one of claims 1-5 is implemented.