Cost map generation method and apparatus, and electronic device
By acquiring and updating lane lines and road boundary information in the robot map, a cost map is generated, which solves the problem of not considering boundaries and lane lines in traditional robot navigation and achieves safe navigation.
Patent Information
- Application Number
- CN202211597740.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-12-13
- Publication Date
- 2025-11-07
- Estimated Expiration
- 2042-12-13
AI Technical Summary
Traditional robot navigation maps do not take into account road boundaries and lane lines, which makes it easy for robots to cross boundaries or bump into obstacles, resulting in losses.
Acquire lane lines and road boundary information from the target map, determine lane lines and road boundary grids, update the grid data structure information, and generate a cost map to clearly represent obstacles, passable roads, and lane lines.
By clearly defining the data structure information of the grid, the generated cost map clearly represents the road boundaries and lane lines, helping the robot to drive within a safe range and avoid unnecessary losses.
Smart Images

Figure CN118189986B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] Embodiments of the present application relate to the technical field of robotics, and in particular to a cost map generation method and device and electronic equipment. BACKGROUND
[0002] In the field of mobile robots, the map used for navigation is usually an inflated occupancy grid map. When inflating the original occupancy grid, the range of the obstacle region is expanded according to certain rules to improve the safety of the robot navigation process.
[0003] In a traditional map, black grids usually represent obstacles, and white grids represent passable roads. The traditional map does not take into account the existence of road boundaries and lane lines. Then, the robot is likely to cross the road boundary when navigating according to the map, which can easily lead to danger during driving. Moreover, if the robot does not drive within the range defined by the lane line or along the road boundary line, it is also easy to cross the boundary line and knock into obstacles, causing damage to the robot. SUMMARY
[0004] The present application provides a cost map generation method and device and electronic equipment to solve some or all of the above technical problems in the prior art.
[0005] In a first aspect, the present application provides a cost map generation method, which comprises:
[0006] obtaining lane line information and road boundary information of a target map;
[0007] determining a first type of grid where the lane line is located and a second type of grid where the road boundary encloses a region; updating the initialization data structure information of the first type of grid to first type of data structure information, and updating the initialization data structure information of the second type of grid to second type of data structure information;
[0008] updating the initialization data structure information corresponding to the grids other than the first type of grid and the second type of grid in the target map according to the first type of data structure information and the second type of data structure information, to obtain final data structure information corresponding to all grids in the target map;
[0009] fusing the pre-obtained original data structure information corresponding to each grid in the target map with the final data structure information to obtain a cost map.
[0010] In a second aspect, the present application provides a cost map generation device, which comprises:
[0011] an acquisition module for obtaining lane line information and road boundary information of a target map;
[0012] a processing module configured to determine a first type of grid in which the lane line is located, and a second type of grid in which the area surrounded by the road boundary is located;
[0013] an updating module configured to update the initialization data structure information of the first type of grid into first type of data structure information, and update the initialization data structure information of the second type of grid into second type of data structure information; update the initialization data structure information corresponding to the grid other than the first type of grid and the second type of grid in the target map according to the first type of data structure information and the second type of data structure information, to obtain final data structure information corresponding to all grids in the target map; and a fusion module configured to fuse the original data structure information corresponding to each grid in the target map and the final data structure information, to obtain the cost map.
[0014] In a third aspect, an electronic device is provided, which includes a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory complete communication with each other through the communication bus.
[0015] The memory is configured to store a computer program.
[0016] The processor is configured to execute the program stored in the memory, to implement the steps of the cost map generation method according to any one of the embodiments of the first aspect.
[0017] In a fourth aspect, a computer readable storage medium is provided, which stores a computer program, and the computer program is executed by a processor to implement the steps of the cost map generation method according to any one of the embodiments of the first aspect.
[0018] The above technical solutions provided by the embodiments of the present application have the following advantages compared with the prior art:
[0019] The method provided by the embodiment of the application comprises the following steps: acquiring lane line information and road boundary information of a target map; determining a first type of grid where the lane line is located and a second type of grid where a region surrounded by the road boundary is located; then updating initial structure information of the grids respectively; and further updating data structure information of other grids in the target map according to the updated data structure information, so as to acquire final data structure information corresponding to each grid in the target map respectively. Based on the above process, the data structure information of each grid can be determined more clearly, and then the positions of the road boundary and the lane line can be determined through the data structure information of each grid. Then, the original data structure information of each grid in the target map and the final data structure information are fused, and the original data structure information has already determined the division of obstacles and passable lanes. In combination with the lane line and the road boundary which have been determined, the cost map formed will be more clear in indicating the obstacles, the passable road, the road boundary and the lane line. Therefore, the robot can travel within the range surrounded by the road boundary or along the lane line, and the situation that the robot bumps into the obstacles due to crossing the road boundary and causes unnecessary loss can be avoided. BRIEF DESCRIPTION OF DRAWINGS
[0020] Figure 1 A cost map generation method flowchart provided by the embodiment of the application;
[0021] Figure 2 Another cost map generation method flowchart provided by the embodiment of the application;
[0022] Figure 3 Another cost map generation method flowchart provided by the embodiment of the application;
[0023] Figure 4 A cost map generation device structure diagram provided by the embodiment of the application;
[0024] Figure 5 An electronic device structure diagram provided by the embodiment of the application. DETAILED DESCRIPTION
[0025] In order to make the purpose, technical scheme and advantages of the embodiments of the application clearer, the technical scheme in the embodiments of the application will be described clearly and completely below with reference to the drawings in the embodiments of the application. Obviously, the described embodiments are some but not all of the embodiments of the application. Based on the embodiments in the application, all other embodiments obtained by those skilled in the art without creative work fall within the protection scope of the application.
[0026] In order to facilitate the understanding of the embodiments of the present application, specific embodiments will be further explained and described below with reference to the accompanying drawings, which do not constitute limitations to the embodiments of the present application.
[0027] For the technical problems mentioned in the background art, the embodiments of the present application provide a cost map generation method, which is specifically described in Figure 1 , as shown in Figure 1 A cost map generation method flowchart is provided for the embodiments of the present application. The method steps include:
[0028] Step 110, obtaining lane line information and road boundary information of the target map.
[0029] Specifically, the acquisition process can include: labeling road boundaries and lane lines in the APP, cloud service platform, and other operation interfaces. The road boundary is a closed area, which describes the activity range of the robot. The lane line is the track where the robot is expected to travel. In an optional example, the road boundary information and lane line information can be read from the hard disk or other software programs.
[0030] Step 120, determining the first type of grid where the lane line is located, and the second type of grid where the area surrounded by the road boundary is located. Optionally, the target map can be a semantic map. In the semantic map, there are multiple lane lines, and the road boundary is composed of multiple closed lines. In an optional example, when determining the first type of grid where the lane line is located, and the second type of grid where the area surrounded by the road boundary is located, the following method can be used, which specifically includes:
[0031] Determining the first grid to which each of the multiple first type of vertices of each lane line belongs, and the second grid to which each of the first type of sampling points other than the first type of vertices in the lane line belongs, the first grid and the second grid belong to the first type of grid;
[0032] And, determining the third grid to which each of the multiple second type of vertices of each closed line belongs, and the fourth grid to which each of the second type of sampling points other than the second type of vertices in the closed line belongs, the third grid and the fourth grid belong to the second type of grid.
[0033] Specifically, for each lane line, there are n first type of vertices p1, p2,..., pn, and each first type of vertex belongs to a first grid. In addition, there are n first type of sampling points p1, p2,..., pn in the lane line, and each first type of sampling point belongs to a second grid. m For each closed line in the road boundary, there are m second type of vertices p1, p2,..., pm, and each second type of vertex belongs to a third grid. In addition, there are m second type of sampling points p1, p2,..., pm in the closed line, and each second type of sampling point belongs to a fourth grid. mThen, each of the first type of vertices of each lane line corresponds to a grid. And, connecting two vertices respectively can form a line segment. After sampling each line segment according to a preset sampling mode, a second grid to which each first type of sampling point belongs is obtained. In an optional example, the sampling interval can be the resolution of the grid map, and the second grid is obtained by sampling.
[0034] In a similar way, a third grid to which each of the second type of vertices of the road boundary belongs and a fourth grid to which each second type of sampling point of the closed line belongs are obtained.
[0035] Step 130, respectively updating the initialization data structure information of the first type of grid to the first type of data structure information, and updating the initialization data structure information of the second type of grid to the second type of data structure information.
[0036] Specifically, before performing this step, some preprocessing work needs to be done for the road boundary and the lane line, which can be referred to as follows:
[0037] A new grid data structure cell_t is created, and the data structure cell_t includes six member variables: occ_state, which is used to represent the state of the grid occupied by the lane line, and is referred to as the occupancy state in this embodiment; occ_dist, which is used to represent the distance of the grid from the nearest grid occupied by the lane line, and is referred to as the occupancy distance in this embodiment; occ_value, which is used to represent the occupancy grid value; coordinate data of the nearest grid to the target grid in the grid occupied by the lane line, wherein the coordinate data can include the horizontal coordinate src_x and the vertical coordinate src_y; and the update state bUpdated, which is referred to as the state update parameter in this embodiment.
[0038] A data structure of a target map is newly created, and stores nx×ny cell_t. nx multiplied by ny is the length and width of the target map. For all cell_t in map_t, the update state bUpdated is set to false in initialization.
[0039] In an optional example, the data structure information of the current grid includes the occupancy state, the occupancy distance, the coordinate data of the nearest grid to the current grid in the grid occupied by the lane line, the occupancy grid value, and the state update parameter, wherein the current grid is any grid in the target map. The data structure information is the data structure information corresponding to any grid in the target map.
[0040] That is, the first type of data structure information and the second type of data structure information also include the above content. In an optional example, when the initialization data structure information of the first type of grid is updated to the first type of data structure information, and the initialization data structure information of the second type of grid is updated to the second type of data structure information, the following method can be referred to:
[0041] The initialization data structure information of the first grid is updated to the first data structure information, the initialization data structure information of the second grid is updated to the second data structure information, the initialization data structure information of the third grid is updated to the third data structure information, and the initialization data structure information of the fourth grid is updated to the fourth data structure information, wherein the first data structure information and the second data structure information belong to the first type of data structure information, and the third data structure information and the fourth data structure information belong to the second type of data structure information.
[0042] Specifically, when updating the first data structure information to the fourth data structure information, the updating can be performed according to a preconfigured updating rule.
[0043] For example, the occupancy state in the first data structure information and the second data structure information is updated to a first state value, the occupancy distance is updated to a first distance value, and the state update parameter is updated to a parameter value indicating that the state has been updated.
[0044] The occupancy state in the third data structure information and the fourth data structure information is updated to a second state value, the occupancy distance is updated to a second distance value, and the state update parameter is updated to a parameter value indicating that the state has been updated.
[0045] In a specific example, occ_state included in the first data structure information and the second data structure information is set to +1, occ_dist is set to 0, and bUpdated is set to true. Occ_state included in the third data structure information and the fourth data structure information is set to -1, occ_dist is set to 1e6, and bUpdated is set to true. True indicates that the state has been updated.
[0046] Optionally, considering that the occ_state in the first data structure information and the second data structure information is set to the first state value + 1, it means that the first grid and the second grid belong to the grids occupied by the obstacle, and therefore the coordinate data corresponding to the first grid and the second grid should also be updated to the coordinate data of the grid closest to the target grid in the grid occupied by the lane line. That is, the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure data is updated to the coordinate data of the first grid, and the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the second data structure data is updated to the coordinate data of the second grid.
[0047] In step 140, the initialization data structure information corresponding to the grids other than the first grid and the second grid in the target map is updated according to the first type of data structure information and the second type of data structure information, and the final data structure information corresponding to all grids in the target map is obtained.
[0048] Specifically, as introduced above, the first type of data structure information includes the first data structure information and the second data structure information, and the second type of data structure information includes the third data structure information and the fourth data structure information.
[0049] The first data structure information to the fourth data structure information are all data structure information of the grids corresponding to the points in the lane line and the road boundary. In order to clearly define the blank grids in the target map and the grids with obstacles (including the grids to which the points in the lane line belong, which are also the obstacle grids), it is necessary to update the initialization data structure information corresponding to the grids other than the first grid to the fourth grid in the target map, so as to obtain the final data structure information corresponding to all grids in the target map.
[0050] In specific implementation, one of the first grid to the fourth grid can be taken as a measurement standard to update the data structure information of the grids around it.
[0051] Optionally, in a specific example, referring to FIG. 8, the method steps can include the following contents: Figure 2
[0052] In step 210, the first data structure information, the second data structure information, the third data structure information, and the fourth data structure information are added to a preset queue respectively.
[0053] In step 220, in the i-th round of training, the fifth grid containing the data structure information with the minimum occupied distance in the preset queue is extracted.
[0054] Wherein, i is a positive integer.
[0055] Step 230, in the target map, all grids in a preset range are selected with the fifth grid as the center.
[0056] Step 240, when the sixth grid in the preset range does not meet the data structure information stop updating condition, the initialization data structure information of the sixth grid is updated according to the data structure information of the fifth grid, and the fifth data structure information is obtained.
[0057] Step 250, the fifth data structure information corresponding to the sixth grid is added to the preset queue for the next round of data structure information updating operation.
[0058] Specifically, for example, in the first round of training, the grids in the preset queue include four types of grids, i.e., the first grid to the fourth grid. The occupancy distance of each grid has been updated. The grid with an occupancy distance of 0 is taken out. At this time, the grid with an occupancy distance of 0 can include two types of grids, i.e., the first grid and the second grid, that is, multiple, that is, in the first round, the fifth grid includes multiple. The operation of steps 330 to 350 is performed on each first grid / second grid.
[0059] Next, taking a certain first grid as an example, for example, the first grid is C0, all grids in a preset range are selected with the first grid C0 as the center. The preset range can be a 9-grid range, a 16-grid range, or a range formed by extracting the upper, lower, left and right four grids.
[0060] In this embodiment, taking a 9-grid as an example, the eight grids at the left, right, top, bottom, upper left, lower left, upper right, and lower right positions of C0 in the target map are traversed.
[0061] And determine whether each of the eight grids does not meet the data structure information stop updating condition. Only when the sixth grid (any one of the eight grids) does not meet the data structure information stop updating condition, the initialization data structure information of the sixth grid is updated according to the data structure information of the fifth grid, and the fifth data structure information is obtained.
[0062] Among them, the data structure information stop updating condition specifically includes one or more of the following:
[0063] The sixth grid does not exceed the boundary of the target map, the occupancy distance of the sixth grid is the first state value, the state update parameter of the sixth grid is a parameter value indicating that the state has been updated, or the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is greater than or equal to the occupancy distance of the seventh grid, wherein the seventh grid is the obstacle grid closest to the fifth grid.
[0064] Specifically, whether the sixth grid exceeds the boundary of the target map can be determined by comparing the coordinate data of the sixth grid with the coordinate data corresponding to the boundary in the target map. The coordinate data of the sixth grid and the coordinate data corresponding to the boundary in the target map can be obtained by existing technologies, which will not be explained here.
[0065] The determination of the occupancy distance of the seventh grid and the occupancy distance of the sixth grid has been described above, and these data can also be directly determined by existing technical means, so this will not be explained here. When the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is greater than or equal to the occupancy distance of the seventh grid, it means that the distance between the sixth grid and C0 is relatively far, and it is meaningless to update the sixth grid according to the data structure information of C0. Therefore, this case still stops updating.
[0066] In a specific example of the present application, when the sixth grid in the preset range does not meet the data structure information stop updating condition, the initialization data structure information of the sixth grid is updated according to the data structure information of the fifth grid, and the fifth data structure information is obtained. This can be implemented according to the following method embodiment, specifically including:
[0067] After updating the obstacle grid coordinate data closest to the sixth grid, updating the state update parameter of the sixth grid, and updating the occupancy distance of the sixth grid in the initialization data structure information of the sixth grid, the fifth data structure information is obtained.
[0068] Among them, the coordinate data of the seventh grid is taken as the obstacle grid coordinate data closest to the sixth grid; the state update parameter of the sixth grid is updated to a parameter value indicating that the state has been updated; and the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is taken as the updated occupancy distance of the sixth grid.
[0069] In a specific example, assuming that the seventh grid is Cx, the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is d, then d is assigned to the occ_dist of the grid C_r and the bUpdated of the grid C_r is set to true, the src_x of C_0 is assigned to the src_x of the grid C_r, and the src_y of C_0 is assigned to the src_y of the grid C_r. In this way, the fifth data structure information is obtained.
[0070] After the above operation, the fifth data structure information corresponding to the sixth grid is added to the preset queue, and the next round of data structure information updating operation is performed.
[0071] In the next round of data structure information updating operation, the grid containing the data structure information corresponding to the minimum occupancy distance in the preset queue is found, and similar steps 330 to 350 are performed.
[0072] Step 260, until the preset queue is empty, the parameter value of the state update parameter corresponding to each grid in the target map is traversed.
[0073] Step 270, according to the parameter value of the state update parameter corresponding to each grid, the update mode of the occupancy grid value of each grid is determined.
[0074] Step 280, according to the update mode of the occupancy grid value of each grid, after updating the occupancy grid value of each grid, the final data structure information corresponding to all grids in the target map is obtained.
[0075] Specifically, because the data structure information corresponding to a grid is taken out from the preset queue each time, and the above-mentioned operations are performed. For example, when no new grid is added to the queue after a certain execution, the grid elements in the queue will be reduced, and after multiple cycles, the elements in the preset queue will be empty. When the preset queue is empty, the parameter value of the state update parameter corresponding to each grid in the target map is traversed. The parameter value of the state update parameter includes two cases: the parameter value true indicating that the state has been updated and the parameter value false indicating that the state has not been updated.
[0076] In an optional example, when the parameter value of the state update parameter corresponding to the seventh grid in the target map is the parameter value indicating that the state has not been updated, the update mode includes: directly updating the occupancy grid value corresponding to the seventh grid to the first occupancy grid value;
[0077] Or, when the parameter value of the state update parameter corresponding to the seventh grid is the parameter value indicating that the state has been updated, the update mode includes: updating the occupancy grid value corresponding to the seventh grid according to the occupancy distance of the seventh grid, wherein the seventh grid is any grid in the target map.
[0078] That is, when bUpdated of the seventh grid is false, the occ_value of the cell_t is set to 0. Otherwise, the occupancy grid value corresponding to the seventh grid is updated according to the occupancy distance of the seventh grid. Specifically, the occ_value of the seventh grid can be calculated according to the following formula:
[0079]
[0080] Where p(x i ) is the occ_value of the seventh grid, occ_dist for the seventh grid, and sigma is the standard deviation of the Gaussian distribution.
[0081] Step 150, fuse the pre-acquired original data structure information corresponding to each grid in the target map with the final data structure information to obtain the cost map.
[0082] Specifically, the method steps can be implemented in the following way, please refer to Figure 3 as shown, including:
[0083] Step 310, compare the occupancy grid value in the original data structure information of each grid in the target map with the occupancy grid value in the final data structure information corresponding to the original data structure information, and select the maximum value as the occupancy grid value in the data structure information of the grid in the cost map.
[0084] Step 320, generate a cost map according to the data structure information of all grids in the cost map, wherein the information other than the occupancy grid value in the data structure information of all grids in the cost map adopts the data structure information of the corresponding grid in the target map.
[0085] The cost map generation method provided by the embodiment of the application obtains lane line information and road boundary information of a target map. The first type of grid where the lane line is located and the second type of grid where the area surrounded by the road boundary is located are determined. Then the initialization structure information of these grids is updated respectively, and then the data structure information of other grids in the target map is updated according to the updated data structure information, so as to obtain the final data structure information corresponding to each grid in the target map. Based on the above process, the data structure information of each grid can be more clearly determined, and then the position of the road boundary and the lane line can be determined through the data structure information of each grid. Then the original data structure information of each grid in the target map and the final data structure information are fused, and the original data structure information has been clearly divided into obstacles and passable lanes. In combination with the clearly determined lane line and road boundary, the cost map formed will more clearly represent obstacles, passable roads, road boundaries, and lane lines. Thus, the robot can travel within the range surrounded by the road boundary or along the lane line, avoiding unnecessary loss caused by the robot knocking into obstacles due to crossing the road boundary.
[0086] The above is several method embodiments of the cost map provided by the application, and the following describes other embodiments of the cost map provided by the application, please refer to the following.
[0087] Figure 4The cost map generation device provided by the embodiment of the application comprises an acquisition module 401, a processing module 402, an updating module 403, and a fusion module 404.
[0088] The acquisition module 401 is configured to acquire lane line information and road boundary information of a target map.
[0089] The processing module 402 is configured to determine first-type grids in which lane lines are located, and second-type grids in which areas surrounded by road boundaries are located.
[0090] The updating module 403 is configured to update the initial data structure information of the first-type grids into first-type data structure information, and update the initial data structure information of the second-type grids into second-type data structure information; and update the initial data structure information corresponding to grids other than the first-type grids and the second-type grids in the target map according to the first-type data structure information and the second-type data structure information, to obtain final data structure information corresponding to all grids in the target map.
[0091] The fusion module 404 is configured to fuse the pre-acquired original data structure information corresponding to each grid in the target map with the final data structure information, to obtain a cost map.
[0092] Optionally, the lane lines comprise a plurality of lane lines, and the road boundaries comprise a plurality of closed lines; the processing module 402 is specifically configured to determine a first grid to which each vertex of a plurality of first-type vertices of each lane line belongs, and a second grid to which each first-type sampling point other than the first-type vertices in the lane line belongs, the first grid and the second grid belonging to the first-type grids.
[0093] In addition, the processing module 402 is specifically configured to determine a third grid to which each vertex of a plurality of second-type vertices of each closed line belongs, and a fourth grid to which each second-type sampling point other than the second-type vertices in the closed line belongs, the third grid and the fourth grid belonging to the second-type grids.
[0094] Optionally, the updating module 403 is specifically configured to update the initial data structure information of the first grid into first-type data structure information, update the initial data structure information of the second grid into second-type data structure information, update the initial data structure information of the third grid into third-type data structure information, and update the initial data structure information of the fourth grid into fourth-type data structure information, wherein the first-type data structure information and the second-type data structure information belong to the first-type data structure information, and the third-type data structure information and the fourth-type data structure information belong to the second-type data structure information.
[0095] Optionally, the data structure information comprises: an occupancy state, an occupancy distance, coordinate data of a grid closest to a target grid in a grid occupied by a lane line, an occupancy grid value, and a state update parameter, wherein the target grid is any grid in a target map, and the data structure information is data structure information corresponding to any grid in the target map.
[0096] The updating module 403 is specifically configured to update the occupancy state in the first data structure information and the second data structure information to a first state value, update the occupancy distance to a first distance value, and update the state update parameter to a parameter value indicating that the state has been updated.
[0097] The updating module 403 is specifically configured to update the occupancy state in the third data structure information and the fourth data structure information to a second state value, update the occupancy distance to a second distance value, and update the state update parameter to a parameter value indicating that the state has been updated.
[0098] Optionally, the updating module 403 is further configured to update the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information to the coordinate data of the first grid, and update the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information to the coordinate data of the second grid.
[0099] Optionally, the updating module 403 is specifically configured to add the first data structure information, the second data structure information, the third data structure information, and the fourth data structure information to a preset queue, respectively.
[0100] In the i-th round of training, a fifth grid corresponding to data structure information with the smallest occupancy distance in the preset queue is extracted.
[0101] In the target map, all grids within a preset range centered on the fifth grid are selected.
[0102] When a sixth grid within the preset range does not meet the data structure information stop update condition, the updating of the initialization data structure information of the sixth grid is completed according to the data structure information of the fifth grid, and a fifth data structure information is obtained, wherein the sixth grid is any grid within the preset range.
[0103] The fifth data structure information corresponding to the sixth grid is added to the preset queue for the next round of data structure information updating operation.
[0104] Until the preset queue is empty, the parameter value of the state update parameter corresponding to each grid in the target map is traversed.
[0105] According to the parameter value of the state update parameter corresponding to each grid, the updating mode of the occupancy grid value of each grid is determined.
[0106] According to the updating manner of the occupancy grid value of each grid, after updating the occupancy grid value of each grid, the final data structure information corresponding to all grids in the target map is obtained, where i is a positive integer.
[0107] Optionally, the data structure information stopping updating condition specifically includes one or more of the following:
[0108] The sixth grid does not exceed the boundary of the target map, the occupancy distance of the sixth grid is the first state value, the state update parameter of the sixth grid is a parameter value indicating that the state has been updated, or the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is greater than or equal to the occupancy distance of the seventh grid, where the seventh grid is the closest obstacle grid to the fifth grid.
[0109] Optionally, the updating module 403 is specifically configured to, when the sixth grid in the preset range does not meet the data structure information stopping updating condition, update the closest obstacle grid coordinate data of the sixth grid in the initial data structure information of the sixth grid, update the state update parameter of the sixth grid, and after updating the occupancy distance of the sixth grid, obtain the fifth data structure information, where the coordinate data of the seventh grid is taken as the closest obstacle grid coordinate data of the sixth grid; the state update parameter of the sixth grid is updated to a parameter value indicating that the state has been updated; and the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is taken as the updated occupancy distance of the sixth grid.
[0110] Optionally, the updating module 403 is specifically configured to, when the parameter value of the state update parameter corresponding to the seventh grid in the target map is a parameter value indicating that the state has not been updated, determine that the updating manner includes directly updating the occupancy grid value corresponding to the seventh grid to the first occupancy grid value.
[0111] Or, when the parameter value of the state update parameter corresponding to the seventh grid is a parameter value indicating that the state has been updated, it is determined that the updating manner includes updating the occupancy grid value corresponding to the seventh grid according to the occupancy distance of the seventh grid, where the seventh grid is any grid in the target map.
[0112] Optionally, the fusion module 404 is specifically configured to compare the occupancy grid value in the original data structure information of each grid in the target map with the occupancy grid value in the final data structure information corresponding to the original data structure information, and select the maximum value as the occupancy grid value in the data structure information of the grid in the cost map.
[0113] According to the data structure information of all the grids in the cost map, the cost map is generated, wherein the data structure information of all the grids in the cost map, except the occupied grid value, adopts the data structure information of the corresponding grid in the target map.
[0114] The functions performed by the components in the cost map generation device provided in the embodiments of the present application have been described in detail in any of the method embodiments above, and thus will not be described again here.
[0115] The cost map generation device provided in the embodiments of the present application acquires the lane line information and the road boundary information of the target map. The first type of grid where the lane line is located and the second type of grid where the area surrounded by the road boundary are determined. Then, the initialization structure information of these grids is updated respectively, and then the data structure information of other grids in the target map is updated according to the updated data structure information, so as to acquire the final data structure information corresponding to each grid in the target map respectively. Based on the above process, the data structure information of each grid can be more clearly determined, and then the positions of the road boundary and the lane line can be determined through the data structure information of each grid. Then, the original data structure information and the final data structure information of each grid in the target map are fused. The original data structure information has clearly divided the obstacles and the passable lanes. In combination with the lane line and the road boundary which have been clearly determined, the cost map formed will more clearly represent the obstacles, the passable road, the road boundary and the lane line. Therefore, the robot can travel within the range surrounded by the road boundary or along the lane line, avoiding the situation that the robot bumps into the obstacle due to crossing the road boundary, causing unnecessary loss.
[0116] As shown in Figure 5 The embodiments of the present application provide an electronic device, which comprises a processor 111, a communication interface 112, a memory 113 and a communication bus 114, wherein the processor 111, the communication interface 112 and the memory 113 complete mutual communication through the communication bus 114.
[0117] The memory 113 is used for storing a computer program.
[0118] In an embodiment of the present application, the processor 111 is used for executing the program stored in the memory 113, and realizes the cost map generation method provided in any of the method embodiments described above, which comprises the following steps.
[0119] acquiring the lane line information and the road boundary information of the target map;
[0120] determine the first type of grid where the lane line is located and the second type of grid where the area surrounded by the road boundary is located; update the initialization data structure information of the first type of grid to the first type of data structure information and update the initialization data structure information of the second type of grid to the second type of data structure information;
[0121] update the initialization data structure information corresponding to the grid other than the first type of grid and the second type of grid in the target map according to the first type of data structure information and the second type of data structure information, and obtain the final data structure information corresponding to all grids in the target map;
[0122] fuse the original data structure information corresponding to each grid in the target map obtained in advance with the final data structure information to obtain the cost map.
[0123] Optionally, the lane line includes a plurality of lane lines, and the road boundary includes a plurality of closed lines; the determination of the first type of grid where the lane line is located and the second type of grid where the area surrounded by the road boundary is located specifically includes:
[0124] determination of the first grid to which each vertex of a plurality of first type of vertices of each lane line belongs and the second grid to which each first type of sampling point other than the first type of vertices in the lane line belongs, the first grid and the second grid belong to the first type of grid;
[0125] and determination of the third grid to which each vertex of a plurality of second type of vertices of each closed line belongs and the fourth grid to which each second type of sampling point other than the second type of vertices in the closed line belongs, the third grid and the fourth grid belong to the second type of grid.
[0126] Optionally, the update of the initialization data structure information of the first type of grid to the first type of data structure information and the update of the initialization data structure information of the second type of grid to the second type of data structure information specifically include:
[0127] updating the initialization data structure information of the first grid to the first data structure information, updating the initialization data structure information of the second grid to the second data structure information, updating the initialization data structure information of the third grid to the third data structure information, and updating the initialization data structure information of the fourth grid to the fourth data structure information, wherein the first data structure information and the second data structure information belong to the first type of data structure information, and the third data structure information and the fourth data structure information belong to the second type of data structure information.
[0128] Optionally, the data structure information comprises an occupancy state, an occupancy distance, coordinate data of a grid closest to a target grid in a grid occupied by a lane line, an occupancy grid value, and a state update parameter, wherein the target grid is any grid in the target map, and the data structure information is data structure information corresponding to any grid in the target map.
[0129] updating the initial data structure information of the first grid to the first data structure information, updating the initial data structure information of the second grid to the second data structure information, updating the initial data structure information of the third grid to the third data structure information, and updating the initial data structure information of the fourth grid to the fourth data structure information, respectively, comprises:
[0130] updating the occupancy state in the first data structure information and the second data structure information to a first state value, updating the occupancy distance to a first distance value, and updating the state update parameter to a parameter value indicating that the state has been updated;
[0131] updating the occupancy state in the third data structure information and the fourth data structure information to a second state value, updating the occupancy distance to a second distance value, and updating the state update parameter to a parameter value indicating that the state has been updated.
[0132] Optionally, the method further comprises:
[0133] updating the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information to the coordinate data of the first grid, and updating the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information to the coordinate data of the second grid.
[0134] Optionally, according to the first type of data structure information and the second type of data structure information, the initial data structure information corresponding to the grids other than the first type of grid and the second type of grid in the target map is updated to obtain the final data structure information corresponding to all grids in the target map, and the method comprises:
[0135] adding the first data structure information, the second data structure information, the third data structure information, and the fourth data structure information to the preset queue, respectively;
[0136] in the i-th round of training, extracting a fifth grid corresponding to the data structure information with the smallest occupancy distance from the preset queue;
[0137] in the target map, selecting all grids within a preset range centered on the fifth grid;
[0138] when the sixth grid in the preset range does not meet the data structure information stop updating condition, updating the initialization data structure information of the sixth grid according to the data structure information of the fifth grid, and obtaining the fifth data structure information, wherein the sixth grid is any grid in the preset range;
[0139] adding the fifth data structure information corresponding to the sixth grid into the preset queue for the next round of data structure information updating operation;
[0140] until the preset queue is empty, traversing the parameter value of the state update parameter corresponding to each grid in the target map;
[0141] determining the update mode of the occupied grid value of each grid according to the parameter value of the state update parameter corresponding to each grid;
[0142] updating the occupied grid value of each grid according to the update mode of the occupied grid value of each grid, and obtaining the final data structure information corresponding to all grids in the target map, wherein i is a positive integer.
[0143] Optionally, the data structure information stop updating condition specifically includes one or more of the following:
[0144] the sixth grid does not exceed the boundary of the target map, the occupancy distance of the sixth grid is the first state value, the state update parameter of the sixth grid is a parameter value indicating that the state has been updated, or the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is greater than or equal to the occupancy distance of the seventh grid, wherein the seventh grid is the closest obstacle grid to the fifth grid.
[0145] Optionally, when the sixth grid in the preset range does not meet the data structure information stop updating condition, the initialization data structure information of the sixth grid is updated according to the data structure information of the fifth grid, and the fifth data structure information is obtained, specifically including:
[0146] updating the coordinate data of the closest obstacle grid to the sixth grid in the initialization data structure information of the sixth grid, updating the state update parameter of the sixth grid, and updating the occupancy distance of the sixth grid, and obtaining the fifth data structure information, wherein the coordinate data of the seventh grid is taken as the coordinate data of the closest obstacle grid to the sixth grid; the state update parameter of the sixth grid is updated to a parameter value indicating that the state has been updated; and the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is taken as the updated occupancy distance of the sixth grid.
[0147] Optionally, the update mode of the occupied grid value of each grid is determined according to the parameter value of the state update parameter corresponding to each grid, specifically including:
[0148] When the parameter value of the state update parameter corresponding to the seventh grid in the target map is a parameter value used to indicate that the state is not updated, it is determined that the update manner includes directly updating the occupancy grid value corresponding to the seventh grid to the first occupancy grid value.
[0149] Or, when the parameter value of the state update parameter corresponding to the seventh grid is a parameter value used to indicate that the state has been updated, it is determined that the update manner includes updating the occupancy grid value corresponding to the seventh grid according to the occupancy distance of the seventh grid, wherein the seventh grid is any grid in the target map.
[0150] Optionally, the pre-acquired original data structure information corresponding to each grid in the target map is fused with the final data structure information to obtain a cost map, specifically including:
[0151] The occupancy grid value in the original data structure information of each grid in the target map is compared with the occupancy grid value in the final data structure information corresponding to the original data structure information, and the maximum value is selected as the occupancy grid value in the data structure information of the grid in the cost map;
[0152] According to the data structure information of all grids in the cost map, a cost map is generated, wherein all the data structure information of the grids in the cost map adopts the data structure information of the corresponding grid in the target map, except for the occupancy grid value.
[0153] The embodiment of the application further provides a computer readable storage medium, which stores a computer program, and the computer program is executed by a processor to implement the steps of the cost map generation method provided by any one of the preceding method embodiments.
[0154] It should be noted that, in this document, relational terms such as“first” and“second”, and the like, are used solely to distinguish one entity or action from another entity or action, without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms“comprises”,“comprising”, or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but can include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element preceded by“comprises... a” does not, without more constraints, foreclose the existence of additional identical elements in the process, method, article, or apparatus that comprises the element.
[0155] The foregoing is considered as illustrative of the principles of the application. Numerous modifications and changes will readily occur to those skilled in the art, and it is intended to embody these modifications and changes into the scope of the application insofar as they fall within the scope of the appended claims.
Claims
1. A cost map generation method characterized by comprising: The method comprises: acquiring lane line information and road boundary information of a target map; determining a first type of grid where the lane line is located and a second type of grid where the area surrounded by the road boundary is located; updating the initial data structure information of the first type of grid to first type of data structure information and updating the initial data structure information of the second type of grid to second type of data structure information; updating the initial data structure information corresponding to the grid other than the first type of grid and the second type of grid in the target map according to the first type of data structure information and the second type of data structure information, to obtain the final data structure information corresponding to all grids in the target map; fusing the original data structure information corresponding to each grid in the target map obtained in advance with the final data structure information to obtain the cost map.
2. The method of claim 1, wherein, The lane line comprises a plurality of lane lines, and the road boundary comprises a plurality of closed lines; the determination of the first type of grid where the lane line is located and the second type of grid where the area surrounded by the road boundary is located comprises: determining the first grid to which each vertex of a plurality of first type of vertices of each lane line belongs and the second grid to which each first type of sampling point other than the first type of vertices in the lane line belongs, the first grid and the second grid belonging to the first type of grid; and determining the third grid to which each vertex of a plurality of second type of vertices of each closed line belongs and the fourth grid to which each second type of sampling point other than the second type of vertices in the closed line belongs, the third grid and the fourth grid belonging to the second type of grid. The updating of the initial data structure information of the first type of grid to the first type of data structure information and the updating of the initial data structure information of the second type of grid to the second type of data structure information comprise:
3. The method of claim 2, wherein, updating the initial data structure information of the first grid to the first data structure information, updating the initial data structure information of the second grid to the second data structure information, updating the initial data structure information of the third grid to the third data structure information, and updating the initial data structure information of the fourth grid to the fourth data structure information, wherein the first data structure information and the second data structure information belong to the first type of data structure information, and the third data structure information and the fourth data structure information belong to the second type of data structure information. The data structure information comprises occupancy state, occupancy distance, coordinate data of the grid closest to the target grid in the grid occupied by the lane line, occupancy grid value, and state update parameter, wherein the target grid is any grid in the target map, and the data structure information comprises data structure information corresponding to any grid in the target map; 4. The method of claim 3, wherein, The method further comprises: updating the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information as the coordinate data of the first grid, and updating the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information as the coordinate data of the second grid. The method further comprises:
5. The method of claim 4, wherein, updating the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information as the coordinate data of the first grid, and updating the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information as the coordinate data of the second grid. The method further comprises:
6. The method of claim 4, wherein, updating the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information as the coordinate data of the first grid, and updating the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information as the coordinate data of the second grid. The method further comprises: updating the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information as the coordinate data of the first grid, and updating the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information as the coordinate data of the second grid. The method further comprises: updating the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information as the coordinate data of the first grid, and updating the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information as the coordinate data of the second grid. The method further comprises: updating the coordinate data of the grid closest to the first grid in the grid occupied by the lane line in the first data structure information as the coordinate data of the first grid, and updating the coordinate data of the grid closest to the second grid in the grid occupied by the lane line in the second data structure information as the coordinate data of the second grid. The data structure information stop updating condition comprises one or more of the following: The data structure information stop updating condition comprises one or more of the following:
7. The method of claim 6, wherein, The sixth grid does not exceed the boundary of the target map, the occupancy distance of the sixth grid is the first state value, the state update parameter of the sixth grid is a parameter value indicating that the state has been updated, or the distance between the occupancy distance of the sixth grid and the occupancy distance of a seventh grid is greater than or equal to the occupancy distance of the seventh grid, wherein the seventh grid is the closest obstacle grid to the fifth grid.
8. The method of claim 7, wherein, When the sixth grid in the preset range does not meet the data structure information stop updating condition, the initialization data structure information of the sixth grid is updated according to the data structure information of the fifth grid to obtain fifth data structure information, and the updating specifically includes: After updating the closest obstacle grid coordinate data of the sixth grid in the initialization data structure information of the sixth grid, updating the state update parameter of the sixth grid, and updating the occupancy distance of the sixth grid, the fifth data structure information is obtained, wherein the coordinate data of the seventh grid is taken as the closest obstacle grid coordinate data of the sixth grid; the state update parameter of the sixth grid is updated to a parameter value indicating that the state has been updated; and the distance between the occupancy distance of the sixth grid and the occupancy distance of the seventh grid is taken as the updated occupancy distance of the sixth grid.
9. The method according to any one of claims 6-8, characterized in that, The updating mode of the occupancy grid value of each grid is determined according to the parameter value of the state update parameter corresponding to each grid, and the updating mode specifically includes: When the parameter value of the state update parameter corresponding to the seventh grid in the target map is a parameter value indicating that the state has not been updated, it is determined that the updating mode includes directly updating the occupancy grid value corresponding to the seventh grid to a first occupancy grid value. Or, when the parameter value of the state update parameter corresponding to the seventh grid is a parameter value indicating that the state has been updated, it is determined that the updating mode includes updating the occupancy grid value corresponding to the seventh grid according to the occupancy distance of the seventh grid, wherein the seventh grid is any grid in the target map.
10. The method according to any one of claims 6-8, characterized in that, The pre-obtained original data structure information corresponding to each grid in the target map is fused with the final data structure information to obtain the cost map, and the fusion specifically includes: The occupancy grid value in the original data structure information of each grid in the target map is compared with the occupancy grid value in the final data structure information corresponding to the original data structure information, and the maximum value is selected as the occupancy grid value in the data structure information of the grid in the cost map. The cost map is generated according to the data structure information of all grids in the cost map, wherein all the data structure information of the grids in the cost map adopts the data structure information of the corresponding grid in the target map except for the occupancy grid value.
11. A cost map generation device, characterized by, The device includes: An acquisition module is configured to acquire lane line information and road boundary information of a target map; A processing module is configured to determine a first type of grid where a lane line is located and a second type of grid where a road boundary surrounding area is located. An updating module is configured to update the initial data structure information of the first type of grid to first type of data structure information, and update the initial data structure information of the second type of grid to second type of data structure information; update the initial data structure information corresponding to the grids other than the first type of grid and the second type of grid in the target map according to the first type of data structure information and the second type of data structure information, and obtain final data structure information corresponding to all grids in the target map; and a fusion module is configured to fuse the original data structure information corresponding to each grid in the target map and the final data structure information, and obtain the cost map.
12. An electronic device, comprising: The device comprises a processor, a communication interface, a memory and a communication bus, wherein the processor, the communication interface and the memory communicate with each other through the communication bus; The memory is configured to store a computer program. The processor is configured to execute the program stored in the memory, and implement the steps of the cost map generation method according to any one of claims 1-10.
13. A computer readable storage medium having stored thereon a computer program, characterized in that, The computer program is executed by the processor to implement the steps of the cost map generation method according to any one of claims 1-10.
Citation Information
Patent Citations
Path planning method and device and vehicle-mounted terminal
CN108983763A
Updating method and device of high-precision map and electronic equipment
CN114625822A