US-12623687-B2 - Method and apparatus for planning obstacle avoidance path of traveling apparatus
Abstract
The planning method includes: obtaining a distance map; determining a first horizontal background cost potential field in a near-field range based on the distance map, where the first horizontal background cost potential field is a first repulsion field formed by an obstacle at a horizontal location on the traveling apparatus, the first horizontal background cost potential field includes a target minimum-value point, background costs on two horizontal sides of the target minimum-value point feature monotonicity, and the background cost represents a near-field horizontal collision cost caused by the obstacle at the horizontal location in the near-field range to the traveling apparatus; and determining a current obstacle avoidance path based on the first horizontal background cost potential field. The method for planning an obstacle avoidance path in embodiments of this application enables the traveling apparatus to avoid an obstacle safely and stably in a complex and narrow traffic scenario.
Inventors
- Siyuan CHENG
- Chao Wang
- Xinyu Wang
Assignees
- HUAWEI TECHNOLOGIES CO., LTD.
Dates
- Publication Date
- 20260512
- Application Date
- 20230119
- Priority Date
- 20200720
Claims (20)
- 1 . A planning method for planning an obstacle avoidance path of a traveling apparatus, comprising: determining a first horizontal background cost potential field in a near-field range based on a distance map, wherein the near-field range is a range in which a longitudinal distance from the traveling apparatus is less than or equal to a first threshold, the first horizontal background cost potential field is a first repulsion field formed by an obstacle at a horizontal location on the traveling apparatus, the first horizontal background cost potential field comprises a target minimum-value point, background costs on two horizontal sides of the target minimum-value point feature monotonicity, and the background cost represents a near-field horizontal collision cost caused by the obstacle at the horizontal location in the near-field range to the traveling apparatus; and determining a current obstacle avoidance path based on the first horizontal background cost potential field, wherein the traveling apparatus navigates to avoid the obstacle according to the current obstacle avoidance path.
- 2 . The planning method according to claim 1 , wherein the determining a first horizontal background cost potential field in a near-field range based on the distance map comprises: determining a second horizontal background cost potential field in the near-field range based on the distance map, wherein the second horizontal background cost potential field is a second repulsion field formed by the obstacle at the horizontal location on the traveling apparatus, and the second horizontal background cost potential field comprises at least one minimum-value point; determining the target minimum-value point from the at least one minimum-value point; and performing monotonicity processing on the background costs on the two horizontal sides of the target minimum-value point, to generate the first horizontal background cost potential field, wherein a slope of the monotonicity processing is greater than or equal to a second threshold.
- 3 . The planning method according to claim 2 , further comprising: before the determining a second horizontal background cost potential field in the near-field range based on the distance map, generating a feature vector, wherein the feature vector comprises a path start point and a sampling goal point; and generating a plurality of candidate paths based on a reference path, a historical path, and the feature vector; and the determining a second horizontal background cost potential field in the near-field range based on the distance map comprises: shifting the reference path horizontally based on the sampling goal point, to generate a plurality of virtual parallel paths; calculating, based on the distance map, a distance from each road point on each of the plurality of virtual parallel paths in the near-field range to a closest obstacle; calculating a background cost of each virtual parallel path based on a minimum value of the distance on the virtual parallel path; and generating the second horizontal background cost potential field in the near-field range based on the background costs of the plurality of virtual parallel paths in the near-field range.
- 4 . The planning method according to claim 3 , further comprising: before the determining a current obstacle avoidance path based on the first horizontal background cost potential field, calculating, based on the distance map, one or more of a collision cost, a constraint cost, a switching cost, a horizontal shift cost, or a smoothness cost on each of the plurality of candidate paths, wherein the collision cost is used to evaluate whether the traveling apparatus collides when traveling on the candidate path, the constraint cost is used to evaluate whether each road point on the candidate path is in an obstacle avoidable range, the switching cost is used to evaluate a deviation between the candidate path and the historical path, the horizontal shift cost is used to evaluate a degree of a horizontal shift of the candidate path from a road centerline, and the smoothness cost is used to evaluate smoothness of the candidate path; and the determining a current obstacle avoidance path based on the first horizontal background cost potential field comprises: calculating a final cost for each candidate path based on a background cost in the first horizontal background cost potential field, or based on a background cost in the first horizontal background cost potential field and one or more of the collision cost, the constraint cost, the switching cost, the horizontal shift cost, or the smoothness cost; and determining the current obstacle avoidance path based on the final cost.
- 5 . The planning method according to claim 1 , wherein there is no obstacle between the target minimum-value point and the traveling apparatus.
- 6 . The planning method according to claim 1 , further comprising: obtaining the distance map, wherein the distance map comprises a plurality of first grids, each of the plurality of first grids is used to record a distance from the first grid to a closest first grid occupied by an obstacle; before the obtaining a distance map, obtaining an occupied map, wherein the occupied map comprises a plurality of second grids, and each of the plurality of second grids is used to record a probability that there is an obstacle in the second grid; and the obtaining a distance map comprises: obtaining the distance map based on the occupied map.
- 7 . The planning method according to claim 6 , wherein the obtaining the distance map based on the occupied map comprises: filtering out the second grid located in a first zone in the occupied map, wherein the first zone is located in front of the traveling apparatus, and if there is an obstacle in the first zone, the traveling apparatus is incapable of avoiding the obstacle in the first zone; and obtaining the distance map based on the occupied map obtained after the filtering out is performed.
- 8 . The planning method according to claim 1 , further comprising: determining a final obstacle avoidance path based on an arbitration result between a historical path and the current obstacle avoidance path.
- 9 . The planning method according to claim 8 , wherein the determining a final obstacle avoidance path based on an arbitration result between the historical path and the current obstacle avoidance path comprises: using the current obstacle avoidance path as the final obstacle avoidance path if collision occurs on the historical path but not on the current obstacle avoidance path; or using a path with a larger collision distance in the current obstacle avoidance path and the historical path as the final obstacle avoidance path if collision occurs on both the historical path and the current obstacle avoidance path and an absolute value of a difference between a collision distance of the current obstacle avoidance path and a collision distance of the historical path is greater than or equal to a third threshold; or using the historical path as the final obstacle avoidance path if collision occurs on both the historical path and the current obstacle avoidance path and an absolute value of a difference between a collision distance of the current obstacle avoidance path and a collision distance of the historical path is less than a third threshold; or using the current obstacle avoidance path as the final obstacle avoidance path if no collision occurs on the historical path and a ratio of a final cost of the current obstacle avoidance path to a cost of the historical path is less than or equal to a fourth threshold; or using the historical path as the final obstacle avoidance path if no collision occurs on the historical path and the ratio of the final cost of the current obstacle avoidance path to the cost of the historical path is greater than a fourth threshold, wherein the collision distance is a shortest longitudinal distance in longitudinal distances of all road points in a collision state on each candidate path.
- 10 . A non-transitory computer-readable medium, wherein the computer-readable medium stores computer program code; and when the computer program code is run on a computer, the computer is enabled to perform the planning method according to claim 1 .
- 11 . A planning apparatus for planning an obstacle avoidance path of a traveling apparatus, wherein the apparatus comprises: one or more processors; and a memory coupled to the one or more processors and storing instructions, which when executed by the one or more processors, configures the planning apparatus to: obtain a distance map, wherein the distance map comprises a plurality of first grids, each of the plurality of first grids is used to record a distance from the first grid to a closest first grid occupied by an obstacle; and determine a first horizontal background cost potential field in a near-field range based on the distance map, wherein the near-field range is a range in which a longitudinal distance from the traveling apparatus is less than or equal to a first threshold, the first horizontal background cost potential field is a first repulsion field formed by an obstacle at a horizontal location on the traveling apparatus, the first horizontal background cost potential field comprises a target minimum-value point, background costs on two horizontal sides of the target minimum-value point feature monotonicity, and the background cost represents a near-field horizontal collision cost caused by the obstacle at the horizontal location in the near-field range to the traveling apparatus; and determine a current obstacle avoidance path based on the first horizontal background cost potential field, wherein the traveling apparatus navigates to avoid the obstacle according to the current obstacle avoidance path.
- 12 . The planning apparatus according to claim 11 , wherein the determining a first horizontal background cost potential field in a near-field range based on the distance map comprises: determining a second horizontal background cost potential field in the near-field range based on the distance map, wherein the second horizontal background cost potential field is a second repulsion field formed by the obstacle at the horizontal location on the traveling apparatus, and the second horizontal background cost potential field comprises at least one minimum-value point; determining the target minimum-value point from the at least one minimum-value point; and performing monotonicity processing on the background costs on the two horizontal sides of the target minimum-value point, to generate the first horizontal background cost potential field, wherein a slope of the monotonicity processing is greater than or equal to a second threshold.
- 13 . The planning apparatus according to claim 12 , wherein before the determining a second horizontal background cost potential field in the near-field range based on the distance map, the planning apparatus is further configured to: generate a feature vector, wherein the feature vector comprises a path start point and a sampling goal point; and generate a plurality of candidate paths based on a reference path, a historical path, and the feature vector; and the determining a second horizontal background cost potential field in the near-field range based on the distance map comprises: shifting the reference path horizontally based on the sampling goal point, to generate a plurality of virtual parallel paths; calculating, based on the distance map, a distance from each road point on each of the plurality of virtual parallel paths in the near-field range to a closest obstacle; calculating a background cost of each virtual parallel path based on a minimum value of the distance on the virtual parallel path; and generating the second horizontal background cost potential field in the near-field range based on the background costs of the plurality of virtual parallel paths in the near-field range.
- 14 . The planning apparatus according to claim 13 , wherein before the determining a current obstacle avoidance path based on the first horizontal background cost potential field, the planning apparatus is further configured to: calculate, based on the distance map, one or more of a collision cost, a constraint cost, a switching cost, a horizontal shift cost, or a smoothness cost on each of the plurality of candidate paths, wherein the collision cost is used to evaluate whether the traveling apparatus collides when traveling on the candidate path, the constraint cost is used to evaluate whether each road point on the candidate path is in an obstacle avoidable range, the switching cost is used to evaluate a deviation between the candidate path and the historical path, the horizontal shift cost is used to evaluate a degree of a horizontal shift of the candidate path from a road centerline, and the smoothness cost is used to evaluate smoothness of the candidate path; and the determining a current obstacle avoidance path based on the first horizontal background cost potential field comprises: calculating a final cost for each candidate path based on a background cost in the first horizontal background cost potential field, or based on a background cost in the first horizontal background cost potential field and one or more of the collision cost, the constraint cost, the switching cost, the horizontal shift cost, or the smoothness cost; and determining the current obstacle avoidance path based on the final cost.
- 15 . The planning apparatus according to claim 11 , wherein there is no obstacle between the target minimum-value point and the traveling apparatus.
- 16 . The planning apparatus according to claim 11 , wherein before the obtaining a distance map, the planning apparatus is further configured to: obtain an occupied map, wherein the occupied map comprises a plurality of second grids, and each of the plurality of second grids is used to record a probability that there is an obstacle in the second grid; and obtain the distance map based on the occupied map.
- 17 . The planning apparatus according to claim 16 , wherein the obtaining the distance map based on the occupied map comprises: filtering out the second grid located in a first zone in the occupied map, wherein the first zone is located in front of the traveling apparatus, and if there is an obstacle in the first zone, the traveling apparatus is incapable of avoiding the obstacle in the first zone; and obtaining the distance map based on the occupied map obtained after the filtering out is performed.
- 18 . The planning apparatus according to claim 11 , wherein the planning apparatus is further configured to: determine a final obstacle avoidance path based on an arbitration result between a historical path and the current obstacle avoidance path.
- 19 . The planning apparatus according to claim 18 , wherein the determining a final obstacle avoidance path based on an arbitration result between the historical path and the current obstacle avoidance path comprises: using the current obstacle avoidance path as the final obstacle avoidance path if collision occurs on the historical path but not on the current obstacle avoidance path; or using a path with a larger collision distance in the current obstacle avoidance path and the historical path as the final obstacle avoidance path if collision occurs on both the historical path and the current obstacle avoidance path and an absolute value of a difference between a collision distance of the current obstacle avoidance path and a collision distance of the historical path is greater than or equal to a third threshold; or using the historical path as the final obstacle avoidance path if collision occurs on both the historical path and the current obstacle avoidance path and an absolute value of a difference between a collision distance of the current obstacle avoidance path and a collision distance of the historical path is less than a third threshold; or using the current obstacle avoidance path as the final obstacle avoidance path if no collision occurs on the historical path and a ratio of a final cost of the current obstacle avoidance path to a cost of the historical path is less than or equal to a fourth threshold; or using the historical path as the final obstacle avoidance path if no collision occurs on the historical path and the ratio of the final cost of the current obstacle avoidance path to the cost of the historical path is greater than a fourth threshold, wherein the collision distance is a shortest longitudinal distance in longitudinal distances of all road points in a collision state on each candidate path.
- 20 . A vehicle, comprising a planning apparatus for planning an obstacle avoidance path of the vehicle, wherein the planning apparatus comprises: one or more processors; and a memory coupled to the one or more processors and storing instructions, which when executed by the one or more processors, configures the planning apparatus to: obtain a distance map, wherein the distance map comprises a plurality of first grids, each of the plurality of first grids is used to record a distance from the first grid to a closest first grid occupied by an obstacle; and determine a first horizontal background cost potential field in a near-field range based on the distance map, wherein the near-field range is a range in which a longitudinal distance from the vehicle is less than or equal to a first threshold, the first horizontal background cost potential field is a first repulsion field formed by an obstacle at a horizontal location on the vehicle, the first horizontal background cost potential field comprises a target minimum-value point, background costs on two horizontal sides of the target minimum-value point feature monotonicity, and the background cost represents a near-field horizontal collision cost caused by the obstacle at the horizontal location in the near-field range to the vehicle; and determine a current obstacle avoidance path based on the first horizontal background cost potential field, wherein the vehicle navigates to avoid the obstacle according to the current obstacle avoidance path.
Description
CROSS-REFERENCE TO RELATED APPLICATIONS This application is a continuation of International Application No. PCT/CN2021/090523, filed on Apr. 28, 2021, which claims priority to Chinese Patent Application No. 202010699919.X, filed on Jul. 20, 2020. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties. TECHNICAL FIELD This application relates to the field of autonomous driving technologies, and more specifically, to a method and an apparatus for planning an obstacle avoidance path of a traveling apparatus. BACKGROUND In an autonomous driving technology, navigation information is obtained by using a map and a positioning module, an ambient environment is sensed by using a sensing device, and autonomous vehicle navigation is implemented in combination with decision-making, planning, and control modules. In recent years, with rapid development of computer vision, artificial intelligence, and sensing devices, the autonomous driving technology has been developed rapidly, and has been widely used in both military and civil fields. In an autonomous driving apparatus, a path planning module is responsible for outputting a correct and effective traveling path based on upper-layer navigation information, a decision instruction, and an environment perception result, to guide correct driving of the autonomous driving apparatus. In addition, the path planning module can further implement planning of an obstacle avoidance path based on obstacle information, to enable the autonomous driving apparatus to travel safely in a dynamic environment. This is also a work focus of path planning. Existing methods for planning an obstacle avoidance path mainly include methods respectively based on sampling, optimization, searching, potential fields, feature points, and the like. These methods for planning an obstacle avoidance path usually have a relatively good planning effect in a simple scenario, but encounter path shaking in a real dynamic traffic scenario, especially a complex and narrow scenario, and therefore cannot ensure safe and stable traveling of a vehicle. Therefore, in case of a complex and narrow traffic scenario, how to output a safe and stable obstacle avoidance path by using a same planning method is a problem that urgently needs to be resolved at present. SUMMARY This application provides a method and an apparatus for planning an obstacle avoidance path of a traveling apparatus, to enable the traveling apparatus to avoid an obstacle safely and stably in a complex and narrow traffic scenario. According to a first aspect, a method for planning an obstacle avoidance path of a traveling apparatus is provided, including: obtaining a distance map, where the distance map includes a plurality of first grids, each of the plurality of first grids is used to record a distance from the first grid to a closest first grid occupied by an obstacle; determining a first horizontal background cost potential field in a near-field range based on the distance map, where the near-field range is a range in which a longitudinal distance from the traveling apparatus is less than or equal to a first threshold, the first horizontal background cost potential field is a first repulsion field formed by an obstacle at a horizontal location on the traveling apparatus, the first horizontal background cost potential field includes a target minimum-value point, background costs on two horizontal sides of the target minimum-value point feature monotonicity, and the background cost represents a near-field horizontal collision cost caused by the obstacle at the horizontal location in the near-field range to the traveling apparatus; and determining a current obstacle avoidance path based on the first horizontal background cost potential field. In an embodiment, the foregoing traveling apparatus may be an autonomous vehicle, a robot, or another autonomous traveling apparatus. It should be understood that, a repulsion field is formed by an obstacle at a horizontal location on the traveling apparatus, can indicate a trend of collision by the obstacle with the traveling apparatus, can guide the traveling apparatus to avoid the obstacle, and may also be referred to as a collision field or a risk field. The first horizontal background cost potential field includes the target minimum-value point. The background costs on the two horizontal sides of the target minimum-value point feature monotonicity. To be specific, this means that the background costs on the two horizontal sides of the target minimum-value point in the first repulsion field feature monotonicity. It should be understood that the background costs on the two sides of the target minimum-value point feature monotonicity. Specifically, a potential field on a left side of the target minimum-value point is monotonically decreasing, and a potential field on a right side of the target minimum-value point is monotonically increasing. It should be underst