CN113791616A - Path planning method, device, robot and storage medium - Google Patents

Path planning method, device, robot and storage medium Download PDF

Info

Publication number
CN113791616A
CN113791616A CN202110983633.9A CN202110983633A CN113791616A CN 113791616 A CN113791616 A CN 113791616A CN 202110983633 A CN202110983633 A CN 202110983633A CN 113791616 A CN113791616 A CN 113791616A
Authority
CN
China
Prior art keywords
path
position point
local
point
robot
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202110983633.9A
Other languages
Chinese (zh)
Inventor
卢鹰
张炜晨
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Uditech Co Ltd
Original Assignee
Uditech Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Uditech Co Ltd filed Critical Uditech Co Ltd
Priority to CN202110983633.9A priority Critical patent/CN113791616A/en
Publication of CN113791616A publication Critical patent/CN113791616A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0212Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory
    • G05D1/0214Control of position or course in two dimensions specially adapted to land vehicles with means for defining a desired trajectory in accordance with safety or protection criteria, e.g. avoiding hazardous areas
    • GPHYSICS
    • G05CONTROLLING; REGULATING
    • G05DSYSTEMS FOR CONTROLLING OR REGULATING NON-ELECTRIC VARIABLES
    • G05D1/00Control of position, course, altitude or attitude of land, water, air or space vehicles, e.g. using automatic pilots
    • G05D1/02Control of position or course in two dimensions
    • G05D1/021Control of position or course in two dimensions specially adapted to land vehicles
    • G05D1/0276Control of position or course in two dimensions specially adapted to land vehicles using signals provided by a source external to the vehicle

Landscapes

  • Engineering & Computer Science (AREA)
  • Aviation & Aerospace Engineering (AREA)
  • Radar, Positioning & Navigation (AREA)
  • Remote Sensing (AREA)
  • Physics & Mathematics (AREA)
  • General Physics & Mathematics (AREA)
  • Automation & Control Theory (AREA)
  • Control Of Position, Course, Altitude, Or Attitude Of Moving Bodies (AREA)
  • Manipulator (AREA)

Abstract

The application discloses a path planning method, a path planning device, a robot and a storage medium, and belongs to the technical field of robots. The method comprises the following steps: if an obstacle is detected in the process of moving according to the global path, a local map is constructed according to the detected environmental information: acquiring a first position point in a local map, wherein the first position point is the current position point of the robot; taking a position point, which is located in a section of the path of the global path in the local map and has a first preset distance from the first position point, as a second position point; and acquiring a first local path of the local map according to the A star algorithm, wherein the first local path is a path from a first position point to a target position point, and the target position point is a position point which is determined according to a second position point and has no barrier. The method and the device can successfully acquire the first local path according to the A star algorithm, ensure the normal movement of the robot, improve the speed of planning the local path of the robot and meet the high-frequency requirement of the robot in planning the local path.

Description

Path planning method, device, robot and storage medium
Technical Field
The present application relates to the field of robot technologies, and in particular, to a path planning method, an apparatus, a robot, and a storage medium.
Background
Generally, obstacles such as tables, chairs, beds, etc. exist in the environment, and the obstacles prevent the robot from walking, so it is very important how the robot acquires a path that can avoid the obstacles.
In the related art, after a robot acquires a global map, a global path is planned according to the global map, the surrounding environment is detected in real time when the robot walks according to the global path, if obstacles exist in the surrounding environment, a local map is constructed, a position is selected from the global path, and then a local path from the current position to the selected position is planned in the local map by using an A-star algorithm.
However, it is highly likely that the situation of the obstacle in the surrounding environment has changed when the robot moves compared to the environment when the global map is constructed, and thus the position selected from the global path may fall within the obstacle region, and at this time, the local path from the current position to the selected position is ruleless drawn using the a-star algorithm.
Disclosure of Invention
The application provides a path planning method, a path planning device, a robot and a storage medium, wherein a first local path can be successfully acquired according to an A star algorithm under the condition that an obstacle exists at a second position point, so that a follow-up robot can move according to the first local path, the normal movement of the robot is ensured, the search range can be reduced, the rate of planning the local path by the robot is improved, and the high-frequency requirement when the robot plans the local path is met. The technical scheme is as follows:
in a first aspect, a path planning method is provided, which is applied to a robot, and includes:
if an obstacle is detected in the process of moving according to the global path, constructing a local map according to the detected environmental information;
acquiring a first position point in the local map, wherein the first position point is a position point where the robot is located currently;
taking a position point, which is located in a section of the local map of the global path and is a first preset distance away from the first position point, as a second position point;
and acquiring a first local path in the local map according to an A star algorithm, wherein the first local path is a path from the first position point to a target position point, and the target position point is a position point which is determined according to the second position point and has no obstacle.
In the application, if the robot detects an obstacle in the process of moving according to the global path, a local map is constructed according to detected environment information, then a first position point in the local map is obtained, a position point, located in a section of path of the global path in the local map, of which the distance from the first position point is a first preset distance is used as a second position point, and then a path from the first position point to a target position point in the local map is obtained according to an A star algorithm. The second position point is a position point of which the distance between the global path and the first position point in the section of the path in the local map is a first preset distance, namely, the second position point is a position point of which the distance between the global path and the first position point is a first preset distance, namely, a target point which is close to the robot is selected from the section of the path of which the global path is in the local map as the terminal point of the local path, so that the search range can be reduced, the speed of planning the local path by the robot is improved, the high-frequency requirement when the robot plans the local path is met, and the robot is prevented from being stuck due to untimely local path planning. Secondly, the target position point is a position point which is determined according to the second position point and has no obstacle, so that the path from the first position point to the target position point can be successfully acquired according to the A star algorithm, namely the first local path can be successfully acquired, so that the subsequent robot can move according to the first local path, and the normal movement of the robot is ensured.
Optionally, the global path is a path planned in a global map;
if an obstacle is detected in the process of moving according to the global path, constructing a local map according to the detected environmental information, wherein the local map comprises the following steps:
and if an obstacle which is not in the global map is detected in the process of moving according to the global path, constructing the local map according to the detected environment information.
Optionally, the obtaining a first local path in the local map according to the a-star algorithm includes:
planning a second local path in the local map using the A-star algorithm, the second local path being a path from the first location point to the second location point;
in the process of planning the second local path by using the a-star algorithm, one path point is selected from planned path points according to the second position point to serve as the target position point, and the planned path from the first position point to the target position point is taken as the first local path.
Optionally, in the process of planning the second local path by using the a-star algorithm, selecting one path point from the planned path points as the target position point according to the second position point includes:
and in the process of planning the second local path by using the A-star algorithm, if the distance between the newly planned path point and the second position point is less than or equal to a second preset distance, taking the path point as the target position point.
Optionally, in the process of planning the second local path by using the a-star algorithm, selecting one path point from the planned path points as the target position point according to the second position point includes:
in the process of planning the second local path by using the a-star algorithm, if all planned path points include all position points in an obstacle-free area in the local map and do not include the second position point, the path point closest to the second position point among all planned path points is taken as the target position point.
Optionally, in the process of planning the second local path by using the a-star algorithm, selecting one path point from the planned path points as the target position point according to the second position point includes:
in the process of planning the second local path by using the a-star algorithm, if distances between n continuous planned path points and the second position point are sequentially increased, a path point closest to the second position point in all the planned path points is taken as the target position point, and n is an integer greater than or equal to 2.
Optionally, after the obtaining the first local path in the local map according to the a-star algorithm, the method further includes:
predicting a target speed corresponding to the first local path by using a dynamic window algorithm;
if the target speed is not 0, moving according to the first local path at the target speed;
and if the target speed is 0, stopping moving, and re-executing the step of constructing the local map according to the detected environmental information and the subsequent steps.
In a second aspect, a path planning apparatus is provided, which is applied to a robot, and comprises:
the building module is used for building a local map according to the detected environmental information if an obstacle is detected in the process of moving according to the global path;
the first acquisition module is used for acquiring a first position point in the local map, wherein the first position point is a position point where the robot is located currently;
a second obtaining module, configured to use, as a second location point, a location point, where a distance between the global path and the first location point in a section of the path in the local map is a first preset distance;
a third obtaining module, configured to obtain a first local path in the local map according to an a-star algorithm, where the first local path is a path from the first location point to a target location point, and the target location point is a location point where no obstacle is located and is determined according to the second location point.
Optionally, the global path is a path planned in a global map;
the building module is further configured to:
and if an obstacle which is not in the global map is detected in the process of moving according to the global path, constructing the local map according to the detected environment information.
Optionally, the third obtaining module includes:
a planning unit, configured to plan a second local path in the local map using the a-star algorithm, where the second local path is a path from the first location point to the second location point;
and the selecting unit is used for selecting one path point from the planned path points as the target position point according to the second position point in the process of planning the second local path by using the A star algorithm, and taking the planned path from the first position point to the target position point as the first local path.
Optionally, the selecting unit is configured to:
and in the process of planning the second local path by using the A-star algorithm, if the distance between the newly planned path point and the second position point is less than or equal to a second preset distance, taking the path point as the target position point.
Optionally, the selecting unit is configured to:
in the process of planning the second local path by using the a-star algorithm, if all planned path points include all position points in an obstacle-free area in the local map and do not include the second position point, the path point closest to the second position point among all planned path points is taken as the target position point.
Optionally, the selecting unit is configured to:
in the process of planning the second local path by using the a-star algorithm, if distances between n continuous planned path points and the second position point are sequentially increased, a path point closest to the second position point in all the planned path points is taken as the target position point, and n is an integer greater than or equal to 2.
Optionally, the apparatus further comprises:
the prediction module is used for predicting the target speed corresponding to the first local path by using a dynamic window algorithm;
a moving module, configured to move according to the first local path at the target speed if the target speed is not 0;
and the first triggering module is used for stopping moving under the condition that the target speed is 0 and triggering the constructing module to construct a local map according to the detected environment information.
In a third aspect, a robot is provided, comprising a memory, a processor and a computer program stored in the memory and executable on the processor, the computer program, when executed by the processor, implementing the path planning method described above.
In a fourth aspect, a computer-readable storage medium is provided, which stores a computer program, which when executed by a processor implements the path planning method described above.
In a fifth aspect, a computer program product is provided comprising instructions which, when run on a computer, cause the computer to perform the steps of the path planning method described above.
It is to be understood that, for the beneficial effects of the second aspect, the third aspect, the fourth aspect and the fifth aspect, reference may be made to the description of the first aspect, and details are not described herein again.
Drawings
In order to more clearly illustrate the technical solutions in the embodiments of the present application, the drawings needed to be used in the description of the embodiments are briefly introduced below, and it is obvious that the drawings in the following description are only some embodiments of the present application, and it is obvious for those skilled in the art to obtain other drawings based on these drawings without creative efforts.
Fig. 1 is a flowchart of a path planning method according to an embodiment of the present application;
fig. 2 is a schematic structural diagram of a path planning provided in an embodiment of the present application;
fig. 3 is a schematic structural diagram of a robot according to an embodiment of the present application.
Detailed Description
To make the objects, technical solutions and advantages of the present application more clear, embodiments of the present application will be described in further detail below with reference to the accompanying drawings.
It should be understood that reference to "a plurality" in this application means two or more. In the description of the present application, "/" means "or" unless otherwise stated, for example, a/B may mean a or B; "and/or" herein is only an association relationship describing an associated object, and means that there may be three relationships, for example, a and/or B, which may mean: a exists alone, A and B exist simultaneously, and B exists alone. In addition, for the convenience of clearly describing the technical solutions of the present application, the terms "first", "second", and the like are used to distinguish the same items or similar items having substantially the same functions and actions. Those skilled in the art will appreciate that the terms "first," "second," etc. do not denote any order or quantity, nor do the terms "first," "second," etc. denote any order or importance.
Before explaining the embodiments of the present application in detail, an application scenario of the embodiments of the present application will be described.
The a-star algorithm is a classic path planning algorithm and is applied to robots for planning paths in an environment map. Specifically, the a-star algorithm may include the following steps (1) to (7):
(1) dividing an environment map into a plurality of grids, wherein the environment map comprises a current position point of the robot and a terminal point which the robot needs to reach;
(2) adding the grid where the current position point of the robot is located as a first target grid to the path list;
(3) determining at least one second target grid which is adjacent to the first target grid and is not the grid where the obstacle is located in the plurality of grids;
(4) traversing all second target grids of the at least one second target grid to obtain a movement cost from the first target grid to each second target grid of the at least one second target grid; wherein the step of calculating all grids of all second target grids of the at least one second target grid comprises: taking one second target grid of the at least one second target grid as a calculation object and recording as a calculation grid; adding the distance from the calculation grid to the grid where the terminal point required to be reached by the robot is located and the distance from the first target grid to the calculation grid to obtain the movement cost of moving from the first target grid to the calculation grid;
(5) adding a second target mesh with the minimum moving cost in the at least one second target mesh to the path list;
(6) if the second target grid newly added to the path list is not the grid where the terminal point which the robot needs to reach is located, taking the second target grid newly added to the path list as the first target grid, and returning to the step (3);
(7) if the second target grid newly added to the path list is the grid where the terminal point that the robot needs to reach is located, the central points of all grids in the path list are sequentially connected according to the adding sequence of the grids in the path list, and a path from the current position point of the robot to the terminal point that the robot needs to reach is obtained.
The A star algorithm determines grids which can be used for forming paths in the environment map from a plurality of grids which are not grids where the obstacles are located in the environment map, so that the A star algorithm does not regularly draw the paths from the current position point of the robot to the end point where the robot needs to reach under the condition that the grids where the end point where the robot needs to reach exist obstacles.
For this reason, the embodiment of the present application provides a path planning method, which can be applied to a robot, for example, a mobile service type robot, and the like, and can also be applied to other types of robots, and the embodiment of the present application is not limited thereto. The path planning method provided by the embodiment of the application can successfully acquire the first local path according to the A star algorithm, so that the follow-up robot can move according to the first local path, the normal movement of the robot is ensured, the search range can be reduced, the speed of planning the local path by the robot is improved, and the high-frequency requirement of the robot in planning the local path is met.
The path planning method provided in the embodiments of the present application is explained in detail below.
Fig. 1 is a flowchart of a path planning method according to an embodiment of the present application. Referring to fig. 1, the method includes the following steps.
Step 101: and if the robot detects an obstacle in the process of moving according to the global path, constructing a local map according to the detected environmental information.
The environment information is information that can reflect the environment in which the robot is currently located. The environmental information can be acquired by the robot through a sensor of the robot, the sensor can comprise a camera, a laser radar, a collision sensor, a distance sensor, a falling sensor and the like, and the embodiment of the application does not limit the sensor.
The global map is a map capable of representing environment information of the overall layout of the environment where the robot is currently located. Optionally, the manager may store the constructed global map in advance in the robot, so that the robot may obtain the global map. Or, after entering a new environment, the robot detects the environment and constructs a global map according to the detected environment information, so that the robot can acquire the global map. For example, the robot may construct a global map using SLAM (Simultaneous Localization and Mapping) technology according to the detected environment information.
A global path is a path planned according to a global map. Alternatively, after the robot acquires the global map, the global path may be planned using a path planning algorithm. For example, after the robot acquires the global map, the global path may be planned by using an a-star algorithm, but the robot may also plan the global path by using path planning algorithms such as Dijkstra (Dijkstra) algorithm, BFS (break 3-First-Search) algorithm, and the like, which is not limited in this embodiment of the present application.
The local map is a map constructed according to the environment around the current position of the robot when the robot moves according to the global path in the global map. The area size of the local map is smaller than the area size of the global map. Because the local map is built in real time in the process that the robot walks according to the global path, in order to ensure the speed of path planning, the robot can only build the local map with a fixed area size, and the fixed area size can be set to be smaller so as to quickly plan the local path and prevent the machine from being blocked due to untimely local path planning caused by overlarge local map.
Obstacle information may be included in both the global map and the local map. The obstacle may be a tea table, a carpet, a table, a chair, a person, etc., and the obstacle information may include a position, a boundary, a height, etc. of the obstacle.
The environment in which the robot is located may be constantly changing. That is, the environment may have changed while the robot is actually moving, as compared to the environment when the global map is constructed. For example, when the robot moves according to the global path in the global map, a chair is placed in front of the movement of the robot, and the robot directly bumps into the chair if the robot continues to move according to the global path on the global path. Therefore, in the process of moving according to the global path, the robot needs to detect the environment of the robot, construct a local map according to the detected environment information, plan a local path according to the local map, and then move according to the local path, so that the robot avoids the obstacle. Since the local map is constructed based on the environmental information that can be detected by the robot at the current position at the current time, the environmental information included in the local map is more accurate than that of a partial map indicating the same area as the local map in the global map, and thus the obstacle can be avoided based on the local path planned by the local map.
If the obstacle is detected in the process of moving according to the global path, a local map is built according to the detected environment information, which indicates that the robot detects the environment in the process of moving according to the global path, and if the detected environment information comprises the obstacle, the local map is built according to the detected environment information.
The operation of detecting the environmental information during the movement of the robot according to the global path may be: in the process of moving according to the global path in the global map, the sensor provided by the mobile terminal is used for detecting the environment to obtain the environment information. For example, the robot can utilize the laser radar that self has to survey self environment of locating, and laser radar generally sets up at the top of robot, and at the during operation, laser radar carries out 360 rotations to the environment transmission laser signal of locating at present through laser radar's transmitter, laser signal is reflected when meetting the barrier, thereby laser radar's receiver receives the laser signal who reflects. The laser radar analyzes the received laser signal to acquire environmental information. Of course, the robot can also detect the environment of the robot through a camera mounted on the robot body, specifically, an image of the environment can be collected through the camera, and then the collected image is analyzed to obtain environment information.
The operation of the robot for constructing the local map according to the detected environment information may be: and constructing a local map by utilizing SLAM technology according to the detected environment information. Of course, the robot may also generate the local map in other ways, which is not limited in this application.
Further, if the robot detects an obstacle that is not on the global map while moving according to the global path in the global map, a local map is constructed according to the detected environmental information. The robot detects the environment in the process of moving according to the global path in the global map, and if the detected environment information includes an obstacle that is not in the global map, that is, the obstacle blocks the global path, the robot needs to bypass the obstacle to continue to move forward, a local map is constructed according to the detected environment information. That is, the local map is constructed only when an obstacle that is not on the global map is detected.
Step 102: the robot acquires a first location point in a local map.
The first position point is a position point where the robot is currently located, that is, the first position point is a starting point of a local path in the local map.
In some embodiments, the robot may divide the local map into a plurality of grids, each grid of the plurality of grids being a location point. That is, the location points described in the embodiments of the present application are actually meshes in the local map. Specifically, the robot may divide the local map into a plurality of meshes according to a preset rule. The preset rule may be set in advance. For example, the preset rule may be to divide the local map into a plurality of grids according to a preset area size (including but not limited to a square size that may be 4cm (centimeter) × 4 cm), in which case, the area sizes of the plurality of grids are the same and are fixed area sizes. Of course, the preset rule may also be set as another rule according to a specific scenario, which is not limited in the embodiment of the present application.
Step 103: and the robot takes a position point, which is located in a section of the path of the global path in the local map and has a first preset distance from the first position point, as a second position point.
The second location point is an end point of the local path in the local map.
The first preset distance may be preset. For example, the first preset distance may be 1m (meter), and in this case, a position point of the global path in the section of the path in the local map, which is 1m away from the first position point, is taken as the second position point, that is, a position point of the global path in the section of the path in the local map, which is 1m away from the first position point, is taken as the end point of the local path in the local map. The first preset distance can be set according to the calculation power and the actual requirement of the robot, and the embodiment of the application does not limit the first preset distance.
The method comprises the steps of taking a position point of a global path, which is located in a section of path in a local map and has a first preset distance from a first position point, as a second position point, namely, taking a position point of the global path, which is located in the section of path in the local map and has a first preset distance from a current position point of a robot, as an end point of the local path, namely, selecting a target point, which is closer to the robot, in the section of path of the global path in the local map as the end point of the local path, so that the search range can be reduced, the speed of planning the local path by the robot can be increased, the high-frequency requirement of the robot in planning the local path can be met, and the robot can be prevented from being stuck due to the fact that the local path is not planned in time.
It is noted that the environment in which the robot is located may vary. That is, the environment may have changed while the robot is actually moving, as compared to the environment when the global map is constructed. Therefore, there is a possibility that an obstacle exists at a second position point selected from a section of the global route located within the local map.
Step 104: the robot acquires a first local path in a local map according to an A star algorithm.
The first local path is a path from the first location point to the target location point.
The target position point is a position point which is determined according to the second position point and has no obstacle, and the method shows that the A star algorithm can successfully acquire a path from the first position point to the target position point according to the first position point and the target position point, namely can successfully acquire the first local path, so that the subsequent robot can move according to the first local path, and the normal movement of the robot is ensured.
Specifically, the operation of step 104 may be: the robot plans a second local path in the local map by using an A star algorithm; in the process of planning the second local path by using the A star algorithm, one path point is selected from the planned path points as a target position point according to the second position point, and the planned path from the first position point to the target position point is used as the first local path.
The second local path is a path from the first location point to the second location point. Since there is a possibility that an obstacle exists at the second location point, and the a-star algorithm plans the path in the obstacle-free area in the map, the a-star algorithm is used to plan the second local path without regulation in the case that an obstacle exists at the second location point.
The target location point is a path point selected from the planned path points based on the second location point. In the embodiment of the present application, the second position point is no longer taken as the end point of the local path, but the target position point is taken as the end point of the local path.
The path points planned in the process of planning the second local path by using the a-star algorithm are meshes added to the path list in the process of executing the a-star algorithm, that is, path points that can be used for determining the local path in the local map.
One route point is selected from the planned route points according to the second position point as a target position point, the planned route from the first position point to the target position point is taken as a first local route, the target position point is taken as an end point of the local route at this time, the obtained first local route is taken as the local route in the local map, and the subsequent robot also walks according to the first local route.
Since the a-star algorithm plans a path in an obstacle-free area in a map, a target position point selected from the planned path points is a position point where no obstacle exists. Then, if the target position point is one path point selected from the planned path points according to the second position point, it means that all the path points from the first position point to the target position point have been determined in the process of planning the path from the first position point to the second position point (i.e., the second local path) using the a-star algorithm, and therefore the planned path from the first position point to the target position point can be directly used as the first local path at this time.
In some embodiments, if there is no obstacle in the second location point, the robot may directly acquire the path from the first location point to the second location point (i.e., the second local path) according to the a-star algorithm.
In other embodiments, the environment in which the robot is located is constantly changing, and compared with the environment in which the global map is constructed, the situation of the obstacle in the environment when the robot actually moves is likely to have changed, so that there is a possibility that the obstacle exists in the second position point selected from the global path, and at this time, the path from the first position point to the second position point cannot be planned by using the a-star algorithm. In this case, the local path may be acquired in several possible ways:
in a first possible mode, in the process that the robot plans the second local path by using the a-star algorithm, if the distance between the newly planned path point and the second position point is less than or equal to a second preset distance, the path point is taken as a target position point; and taking the planned path from the first position point to the target position point as a first local path.
The second preset distance may be preset. For example, the second preset distance may be set to 20cm (centimeter). The second preset distance can be set according to the size of the local map, and if the local map is smaller, the second preset distance can be set smaller; if the local map is larger, the second preset distance may be set to be larger, which is not limited in the embodiment of the present application.
The newly planned path point may be the mesh newly added to the path list.
And if the distance between the newly planned path point and the second position point is less than or equal to a second preset distance, the robot takes the path point as a target position point, and then takes the planned path from the first position point to the target position point as a first local path. That is, in the case where the distance between the newly planned route point and the second position point is less than or equal to the second preset distance, the newly planned route point is taken as the end point of the local route, and then the planned route from the first position point to the target position point is taken as the first local route, which is taken as the local route in the local map. In the case that the distance between the newly planned path point and the second position point is less than or equal to the second preset distance, the newly planned path point is taken as the end point of the local path, that is, in the embodiment of the present application, in the process of planning the second local path according to the a-star algorithm, the local path does not need to be determined when the newly planned path point is the second position point, but the local path can be determined when the distance between the newly planned path point and the second position point is less than or equal to the second preset distance, so that the speed of planning the local path by the robot can be increased to meet the high frequency requirement of the robot in planning the local path, and the robot is prevented from being stuck due to the untimely planning of the local path. In this case, even if an obstacle exists at the second position point, the local path can be output according to the a-star algorithm.
The operation of the robot regarding the planned path from the first position point to the target position point as the first local path may be: and connecting all the planned path points from the first position point to the target position point in sequence according to the planned sequence to obtain a path from the first position point to the target position point (namely a first local path).
And connecting all the planned path points from the first position point to the target position point in sequence according to the planning sequence, namely connecting the central points of all grids in the path list in sequence according to the adding sequence to obtain a first local path.
In a second possible mode, in the process of planning a second local path by using the a-star algorithm, if all planned path points include all position points in an obstacle-free area in a local map and do not include a second position point, taking a path point closest to the second position point among all planned path points as a target position point; and taking the planned path from the first position point to the target position point as a first local path.
All the planned path points include all the position points in the obstacle-free area in the local map, and the planned path points do not include the second position point, which indicates that all the obstacle-free areas in the local map have been traversed currently, but the path points which are the second position points are not acquired, that is, the robot uses the a star algorithm to draw the second local path without regulation, and indicates that the second position points are likely to have obstacles. In this case, the end point of the first local route can be located as close as possible to the second position point by setting the closest route point to the second position point among all the planned route points as the target position point and setting the planned route from the first position point to the target position point as the first local route. In this way, in the case where there is a high possibility that an obstacle exists at the second position point, the local path can still be output according to the a-star algorithm.
The operation of the robot regarding the planned path from the first position point to the target position point as the first local path may be: and connecting all the planned path points from the first position point to the target position point in sequence according to the planning sequence to obtain a first local path.
In a third possible mode, in the process that the robot plans the second local path by using the star A algorithm, if the distances between the planned continuous n path points and the second position point are sequentially increased, the path point closest to the second position point in all the planned path points is taken as a target position point; and taking the planned path from the first position point to the target position point as a first local path.
Distances between the planned continuous n path points and the second position point are sequentially increased, which indicates that the planned continuous n path points are gradually far away from the second position point, that is, the distance between the planned path points and the second position point is increasingly larger, which indicates that the second position point is likely to have an obstacle, and the second local path is likely not planned by using the a-star algorithm. In this case, the end point of the first local route can be located as close as possible to the second position point by setting the closest route point to the second position point among all the planned route points as the target position point and setting the planned route from the first position point to the target position point as the first local route. In this way, in the case where there is a high possibility that an obstacle exists at the second position point, the local path can still be output according to the a-star algorithm.
n is an integer greater than or equal to 2, and n may be set in advance, for example, n may be set to 5, which is not limited in the embodiment of the present application.
For example, if n is 5, in the process of planning the second local path by using the a-star algorithm, if distances between 5 consecutive planned path points and the second position point sequentially increase, a path point closest to the second position point among all planned path points is taken as a target position point, and then all planned path points from the first position point to the target position point are sequentially connected in the planning order to obtain a path from the first position point to the target position point (i.e., the first local path).
Optionally, after the first local path is determined, the robot predicts a target speed corresponding to the local path by using a DWA (Dynamic Window Approach, Dynamic Window algorithm) algorithm; if the target speed is not 0, moving according to the local path at the target speed; if the target speed is 0, the movement is stopped and the above step 101 is executed again.
The DWA algorithm is used for predicting the moving speed of the robot, so that the robot can walk according to the moving speed, and can also stop before encountering an obstacle, so that the effect of avoiding the obstacle urgently is achieved, and the robot is prevented from being damaged.
The DWA algorithm specifically determines a moving speed range according to the influences of the maximum speed, the minimum speed, the motor performance and the like which can be reached by the robot, and then determines a target speed corresponding to a local path from the moving speed range according to the obstacle information and the local path so that the robot moves according to the local path at the target speed. Because the sensor that the robot has can detect the environmental information of the environment that is located in real time, and this environmental information that the DWA algorithm can detect in real time of robot, therefore when an obstacle appears suddenly in the place ahead of the direction of motion of robot, DWA algorithm can be according to the distance between present moving speed and present position and this obstacle of self, predicts the target speed, makes the robot can stop before touchhing the obstacle when moving according to the target speed to reach the effect of promptly keeping away the obstacle.
The target speed is 0, which means that the moving speed predicted by the DWA algorithm is 0, and at this time, the robot needs to be controlled to stop moving, in this case, the robot needs to perform the step 101 again, so that the robot collects current environment information, constructs a local map according to the collected current environment information, and replans a local path, so that the robot continues to walk in the current environment until the robot walks to the end position of the global path.
In the embodiment of the application, if the robot detects an obstacle in the process of moving according to the global path, a local map is constructed according to detected environment information, then a first position point in the local map is obtained, a position point, located in a section of path of the global path in the local map, of which the distance from the first position point is a first preset distance is used as a second position point, and then a path from the first position point to a target position point in the local map is obtained according to an a-star algorithm. The second position point is a position point of which the distance between the global path and the first position point in the section of the path in the local map is a first preset distance, namely, the second position point is a position point of which the distance between the global path and the first position point is a first preset distance, namely, a target point which is close to the robot is selected from the section of the path of which the global path is in the local map as the terminal point of the local path, so that the search range can be reduced, the speed of planning the local path by the robot is improved, the high-frequency requirement when the robot plans the local path is met, and the robot is prevented from being stuck due to untimely local path planning. Secondly, the target position point is a position point which is determined according to the second position point and has no obstacle, so that the path from the first position point to the target position point can be successfully acquired according to the A star algorithm, namely the first local path can be successfully acquired, so that the subsequent robot can move according to the first local path, and the normal movement of the robot is ensured.
Fig. 2 is a schematic structural diagram of a path planning apparatus according to an embodiment of the present application. The path planning means may be implemented by software, hardware or a combination of both as part or all of a robot, which may be the robot shown in fig. 3 below. Referring to fig. 2, the apparatus includes: a building module 301, a first obtaining module 302, a second obtaining module 303, and a third obtaining module 304.
A building module 301, configured to build a local map according to the detected environmental information if an obstacle is detected in the process of moving according to the global path;
a first obtaining module 302, configured to obtain a first location point in a local map, where the first location point is a location point where the robot is currently located;
a second obtaining module 303, configured to use, as a second location point, a location point, where a distance between the global path and the first location point in a section of the path in the local map is a first preset distance;
the third obtaining module 304 is configured to obtain a first local path in the local map according to the a-star algorithm, where the first local path is a path from a first location point to a target location point, and the target location point is a location point determined according to the second location point and where no obstacle exists.
Optionally, the global path is a path planned in a global map;
the building block 301 is further configured to:
and if the obstacle which is not in the global map is detected in the process of moving according to the global path, constructing a local map according to the detected environment information.
Optionally, the third obtaining module 304 includes:
the planning unit is used for planning a second local path in the local map by using an A star algorithm, wherein the second local path is a path from the first position point to the second position point;
and the selection unit is used for selecting one path point from the planned path points as a target position point according to the second position point in the process of planning the second local path by using the A star algorithm, and taking the planned path from the first position point to the target position point as the first local path.
Optionally, the selection unit is configured to:
and in the process of planning the second local path by using the A star algorithm, if the distance between the newly planned path point and the second position point is less than or equal to a second preset distance, taking the path point as a target position point.
Optionally, the selection unit is configured to:
in the process of planning the second local path by using the a-star algorithm, if all planned path points include all position points in the obstacle-free area in the local map and do not include the second position point, the path point closest to the second position point in all planned path points is taken as the target position point.
Optionally, the selecting unit is configured to:
in the process of planning the second local path by using the a-star algorithm, if distances between n continuous planned path points and the second position point are sequentially increased, the path point closest to the second position point in all the planned path points is taken as a target position point, and n is an integer greater than or equal to 2.
Optionally, the apparatus further comprises:
the prediction module is used for predicting a target speed corresponding to the first local path by using a dynamic window algorithm after the first local path is obtained;
the moving module is used for moving according to the first local path at the target speed under the condition that the target speed is not 0;
the first triggering module is used for stopping moving under the condition that the target speed is 0, triggering the constructing module to detect the environment where the robot is located, and constructing a local map according to the detected environment information.
In the embodiment of the application, if the robot detects an obstacle in the process of moving according to the global path, a local map is constructed according to detected environment information, then a first position point in the local map is obtained, a position point, located in a section of path of the global path in the local map, of which the distance from the first position point is a first preset distance is used as a second position point, and then a path from the first position point to a target position point in the local map is obtained according to an a-star algorithm. The second position point is a position point of which the distance between the global path and the first position point in the section of the path in the local map is a first preset distance, namely, the second position point is a position point of which the distance between the global path and the first position point is a first preset distance, namely, a target point which is close to the robot is selected from the section of the path of which the global path is in the local map as the terminal point of the local path, so that the search range can be reduced, the speed of planning the local path by the robot is improved, the high-frequency requirement when the robot plans the local path is met, and the robot is prevented from being stuck due to untimely local path planning. Secondly, the target position point is a position point which is determined according to the second position point and has no obstacle, so that the path from the first position point to the target position point can be successfully acquired according to the A star algorithm, namely the first local path can be successfully acquired, so that the subsequent robot can move according to the first local path, and the normal movement of the robot is ensured.
It should be noted that: the path planning apparatus provided in the foregoing embodiment is only illustrated by dividing the functional modules when planning a path, and in practical applications, the function distribution may be completed by different functional modules according to needs, that is, the internal structure of the apparatus is divided into different functional modules, so as to complete all or part of the functions described above.
Each functional unit and module in the above embodiments may be integrated into one processing unit, or each unit may exist alone physically, or two or more units are integrated into one unit, and the integrated unit may be implemented in a form of hardware, or in a form of software functional unit. In addition, specific names of the functional units and modules are only for convenience of distinguishing from each other, and are not used to limit the protection scope of the embodiments of the present application.
The embodiment of the path planning apparatus and the embodiment of the path planning method provided by the above embodiments belong to the same concept, and the specific working processes and the brought technical effects of the units and modules in the above embodiments can be referred to the part of the embodiment of the method, which is not described herein again.
Fig. 3 is a schematic structural diagram of a robot according to an embodiment of the present application. As shown in fig. 3, the robot 3 includes: a processor 30, a memory 31 and a computer program 32 stored in the memory 31 and executable on the processor 30, the steps in the path planning method in the above embodiments being implemented when the processor 30 executes the computer program 32.
In a specific implementation, fig. 3 is only an example of the robot 3, and does not constitute a limitation to the robot 3, and may include more or less components than those shown, or combine some components, or different components, such as an input/output device, a network access device, and the like.
The Processor 30 may be a Central Processing Unit (CPU), and the Processor 30 may also be other general purpose Processor, a Digital Signal Processor (DSP), an Application Specific Integrated Circuit (ASIC), an off-the-shelf Programmable Gate Array (FPGA) or other Programmable logic device, discrete Gate or transistor logic, discrete hardware components, etc. A general purpose processor may be a microprocessor or any conventional processor.
The storage 31 may in some embodiments be an internal storage unit of the robot 3, such as a hard disk or a memory of the robot 3. The memory 31 may also be an external storage device of the robot 3 in other embodiments, such as a plug-in hard disk provided on the robot 3, a Smart Media Card (SMC), a Secure Digital (SD) Card, a Flash memory Card (Flash Card), and the like. Further, the memory 31 may also include both an internal storage unit and an external storage device of the robot 3. The memory 31 is used for storing an operating system, an application program, a BootLoader (BootLoader), data, and other programs, such as program codes of a computer program. The memory 31 may also be used to temporarily store data that has been output or is to be output.
An embodiment of the present application further provides a robot, including: at least one processor, a memory, and a computer program stored in the memory and executable on the at least one processor, the processor implementing the steps of any of the various method embodiments described above when executing the computer program.
The embodiments of the present application also provide a computer-readable storage medium, where a computer program is stored, and when the computer program is executed by a processor, the steps in the above-mentioned method embodiments can be implemented.
The embodiments of the present application provide a computer program product, which when run on a computer causes the computer to perform the steps of the above-described method embodiments.
The integrated unit, if implemented in the form of a software functional unit and sold or used as a stand-alone product, may be stored in a computer readable storage medium. Based on such understanding, all or part of the processes in the above method embodiments may be implemented by a computer program, which may be stored in a computer readable storage medium and used by a processor to implement the steps of the above method embodiments. Wherein the computer program comprises computer program code, which may be in the form of source code, object code, an executable file or some intermediate form, etc. The computer readable medium may include at least: any entity or apparatus capable of carrying computer program code to a photographing apparatus/terminal device, a recording medium, computer Memory, ROM (Read-Only Memory), RAM (Random Access Memory), CD-ROM (Compact Disc Read-Only Memory), magnetic tape, floppy disk, optical data storage device, etc. The computer-readable storage medium referred to herein may be a non-volatile storage medium, in other words, a non-transitory storage medium.
It should be understood that all or part of the steps for implementing the above embodiments may be implemented by software, hardware, firmware or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The computer instructions may be stored in the computer-readable storage medium described above.
In the above embodiments, the descriptions of the respective embodiments have respective emphasis, and reference may be made to the related descriptions of other embodiments for parts that are not described or illustrated in a certain embodiment.
Those of ordinary skill in the art will appreciate that the various illustrative elements and algorithm steps described in connection with the embodiments disclosed herein may be implemented as electronic hardware or combinations of computer software and electronic hardware. Whether such functionality is implemented as hardware or software depends upon the particular application and design constraints imposed on the implementation. Skilled artisans may implement the described functionality in varying ways for each particular application, but such implementation decisions should not be interpreted as causing a departure from the scope of the present application.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus/robot and method may be implemented in other ways. For example, the above-described apparatus/robot embodiments are merely illustrative, and for example, a module or a unit may be divided into only one logical function, and may be implemented in other ways, for example, a plurality of units or components may be combined or integrated into another system, or some features may be omitted or not executed. In addition, the shown or discussed mutual coupling or direct coupling or communication connection may be an indirect coupling or communication connection through some interfaces, devices or units, and may be in an electrical, mechanical or other form.
Units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the units can be selected according to actual needs to achieve the purpose of the solution of the embodiment.
The above-mentioned embodiments are only used for illustrating the technical solutions of the present application, and not for limiting the same; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical solutions described in the foregoing embodiments may still be modified, or some technical features may be equivalently replaced; such modifications and substitutions do not substantially depart from the spirit and scope of the embodiments of the present application and are intended to be included within the scope of the present application.

Claims (10)

1. A path planning method, applied to a robot, the method comprising:
if an obstacle is detected in the process of moving according to the global path, constructing a local map according to the detected environmental information;
acquiring a first position point in the local map, wherein the first position point is a position point where the robot is located currently;
taking a position point, which is located in a section of the local map of the global path and is a first preset distance away from the first position point, as a second position point;
and acquiring a first local path in the local map according to an A star algorithm, wherein the first local path is a path from the first position point to a target position point, and the target position point is a position point which is determined according to the second position point and has no obstacle.
2. The method of claim 1, wherein the global path is a path planned in a global map;
if an obstacle is detected in the process of moving according to the global path, constructing a local map according to the detected environmental information, wherein the local map comprises the following steps:
and if an obstacle which is not in the global map is detected in the process of moving according to the global path, constructing the local map according to the detected environment information.
3. The method of claim 1 or 2, wherein the obtaining a first local path in the local map according to an a-star algorithm comprises:
planning a second local path in the local map using the A-star algorithm, the second local path being a path from the first location point to the second location point;
in the process of planning the second local path by using the a-star algorithm, one path point is selected from planned path points according to the second position point to serve as the target position point, and the planned path from the first position point to the target position point is taken as the first local path.
4. The method of claim 3, wherein selecting a waypoint from the planned waypoints as the target waypoint based on the second waypoint during the planning of the second local path using the A-star algorithm comprises:
and in the process of planning the second local path by using the A-star algorithm, if the distance between the newly planned path point and the second position point is less than or equal to a second preset distance, taking the path point as the target position point.
5. The method of claim 3, wherein selecting a waypoint from the planned waypoints as the target waypoint based on the second waypoint during the planning of the second local path using the A-star algorithm comprises:
in the process of planning the second local path by using the a-star algorithm, if all planned path points include all position points in an obstacle-free area in the local map and do not include the second position point, the path point closest to the second position point among all planned path points is taken as the target position point.
6. The method of claim 3, wherein selecting a waypoint from the planned waypoints as the target waypoint based on the second waypoint during the planning of the second local path using the A-star algorithm comprises:
in the process of planning the second local path by using the a-star algorithm, if distances between n continuous planned path points and the second position point are sequentially increased, a path point closest to the second position point in all the planned path points is taken as the target position point, and n is an integer greater than or equal to 2.
7. The method of any one of claims 1-6, wherein after obtaining the first local path in the local map according to the A-star algorithm, further comprising:
predicting a target speed corresponding to the first local path by using a dynamic window algorithm;
if the target speed is not 0, moving according to the first local path at the target speed;
and if the target speed is 0, stopping moving, and re-executing the step of constructing the local map according to the detected environmental information and the subsequent steps.
8. A path planning apparatus, applied to a robot, the apparatus comprising:
the building module is used for building a local map according to the detected environmental information if an obstacle is detected in the process of moving according to the global path;
the first acquisition module is used for acquiring a first position point in the local map, wherein the first position point is a position point where the robot is located currently;
a second obtaining module, configured to use, as a second location point, a location point, where a distance between the global path and the first location point in a section of the path in the local map is a first preset distance;
a third obtaining module, configured to obtain a first local path in the local map according to an a-star algorithm, where the first local path is a path from the first location point to a target location point, and the target location point is a location point where no obstacle is located and is determined according to the second location point.
9. A robot, characterized in that the robot comprises a memory, a processor and a computer program stored in the memory and executable on the processor, which computer program, when executed by the processor, implements the method according to any of claims 1 to 7.
10. A computer-readable storage medium, characterized in that the computer-readable storage medium stores a computer program which, when executed by a processor, implements the method of any one of claims 1 to 7.
CN202110983633.9A 2021-08-25 2021-08-25 Path planning method, device, robot and storage medium Pending CN113791616A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202110983633.9A CN113791616A (en) 2021-08-25 2021-08-25 Path planning method, device, robot and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202110983633.9A CN113791616A (en) 2021-08-25 2021-08-25 Path planning method, device, robot and storage medium

Publications (1)

Publication Number Publication Date
CN113791616A true CN113791616A (en) 2021-12-14

Family

ID=79182216

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202110983633.9A Pending CN113791616A (en) 2021-08-25 2021-08-25 Path planning method, device, robot and storage medium

Country Status (1)

Country Link
CN (1) CN113791616A (en)

Cited By (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500526A (en) * 2021-12-27 2022-05-13 天翼云科技有限公司 Path calculation system and control method thereof
CN114571460A (en) * 2022-03-22 2022-06-03 达闼机器人股份有限公司 Robot control method, device and storage medium
CN114594761A (en) * 2022-01-05 2022-06-07 美的集团(上海)有限公司 Path planning method for robot, electronic device and computer-readable storage medium
CN116952250A (en) * 2023-09-18 2023-10-27 之江实验室 Robot path guiding method and device based on semantic map
WO2024041464A1 (en) * 2022-08-22 2024-02-29 先临三维科技股份有限公司 Loop-back path prediction method and apparatus, nonvolatile storage medium, and processor

Cited By (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114500526A (en) * 2021-12-27 2022-05-13 天翼云科技有限公司 Path calculation system and control method thereof
CN114500526B (en) * 2021-12-27 2023-08-04 天翼云科技有限公司 Path computing system and control method thereof
CN114594761A (en) * 2022-01-05 2022-06-07 美的集团(上海)有限公司 Path planning method for robot, electronic device and computer-readable storage medium
CN114571460A (en) * 2022-03-22 2022-06-03 达闼机器人股份有限公司 Robot control method, device and storage medium
WO2024041464A1 (en) * 2022-08-22 2024-02-29 先临三维科技股份有限公司 Loop-back path prediction method and apparatus, nonvolatile storage medium, and processor
CN116952250A (en) * 2023-09-18 2023-10-27 之江实验室 Robot path guiding method and device based on semantic map
CN116952250B (en) * 2023-09-18 2024-01-05 之江实验室 Robot path guiding method and device based on semantic map

Similar Documents

Publication Publication Date Title
CN113791616A (en) Path planning method, device, robot and storage medium
EP3974778B1 (en) Method and apparatus for updating working map of mobile robot, and storage medium
US11161246B2 (en) Robot path planning method and apparatus and robot using the same
JP5685380B2 (en) Route generation apparatus using grid map and operation method thereof
CN113219992B (en) Path planning method and cleaning robot
CN111813101A (en) Robot path planning method and device, terminal equipment and storage medium
CN110858075A (en) Mobile robot cross-region method, device and scheduling system
CN116088503B (en) Dynamic obstacle detection method and robot
CN110470308A (en) A kind of obstacle avoidance system and method
CN113219995A (en) Path planning method and cleaning robot
KR20180089417A (en) Stochastic map recognition stereoscopic vision sensor model
CN113390417A (en) Robot and navigation method, device and computer readable storage medium thereof
CN112013840A (en) Sweeping robot and map construction method and device thereof
CN113867356A (en) Robot path planning method and device and robot
CN113806455B (en) Map construction method, device and storage medium
CN113741439B (en) Path planning method, path planning device, robot and storage medium
CN111854757A (en) Navigation method, navigation device, electronic equipment and storage medium
CN110340935B (en) Robot fusion positioning method and robot
CN116533987A (en) Parking path determination method, device, equipment and automatic driving vehicle
CN116358528A (en) Map updating method, map updating device, self-mobile device and storage medium
CN110554697A (en) Travel method, travel-enabled device, and storage medium
CN113485372B (en) Map searching method and device, storage medium and electronic device
CN114690771A (en) Path planning method and device for robot
CN114740844A (en) Path planning method and device, computer readable storage medium and electronic equipment
CN111136689B (en) Self-checking method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination