Road width determination method, device and robot
By using cost maps and offline maps in the robot navigation system, the road width is calculated in real time, and the problem of inaccurate road width calculation in the prior art is solved, and the accuracy and reliability of robot navigation is improved.
Patent Information
- Application Number
- CN202210193086.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2022-02-28
- Publication Date
- 2025-02-18
- Estimated Expiration
- 2042-02-28
AI Technical Summary
The prior art is difficult to accurately calculate the width of the road during the actual walking of the robot, especially when encountering temporary obstacles, which can easily lead to decision-making errors.
By obtaining the cost map, determine the front and rear areas of the robot, and extract the width of the road sections in the corresponding area, combine the information in the offline map to calculate the road width in real time, avoid temporary obstacles.
It improves the accuracy of road width, makes the robot's decision-making more accurate, adapts to temporary obstacles in real scenes, and improves the reliability of robot navigation.
Smart Images

Figure CN114625131B_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of robot navigation technology, and in particular to a method, device and robot for determining road width. Background Art
[0002] With the development of science and technology, robots are being used in more and more fields to replace manual work, which improves work efficiency and convenience. During the operation of the robot, the width of the road in front and behind the robot is particularly important to the robot's operation strategy. How to accurately calculate the width of the road in front and behind the robot has become an urgent problem to be solved.
[0003] In the prior art, the user can plan an operating path for the robot and divide the operating path into multiple first-level tracks, divide the multiple first-level tracks into multiple second-level segments, and for each second-level segment, grow it to both sides on the offline map to obtain the width of each second-level segment.
[0004] However, offline maps are constructed in relatively clean scenes without pedestrians or other temporary obstacles. In the actual walking process, the robot will inevitably encounter pedestrians or other obstacles that suddenly block the way. If the width is obtained according to the above method, it is easy to make wrong decisions. Summary of the invention
[0005] Based on this, it is necessary to provide a road width determination method, device and robot that can improve width accuracy in response to the above technical problems.
[0006] In a first aspect, the present application provides a method, device and robot for determining road width. The method comprises:
[0007] Obtaining a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot;
[0008] Determine a front area and a rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot;
[0009] Extracting a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area;
[0010] According to the cost map and the offline map, the width of the road section in the front area and the width of the road section in the rear area are obtained.
[0011] In one embodiment, the cost map is also used to display the orientation of the robot; determining the front area and the rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot includes:
[0012] Determine the current section of the road where the robot is located according to the current position of the robot and the path pre-planned for the robot;
[0013] The front area and the rear area are determined according to the orientation of the robot and the direction of the road section where the robot is currently located.
[0014] In one embodiment, determining the front area and the rear area according to the orientation of the robot and the direction of the road section where the robot is currently located includes:
[0015] Determining a direction vector of the robot according to the orientation of the robot;
[0016] Determining a direction vector of the road section currently located by the robot according to the direction of the road section currently located by the robot;
[0017] The front area and the rear area are determined according to the direction vector of the robot and the direction vector of the road section where the robot is currently located.
[0018] In one embodiment, determining the front area and the rear area according to the direction vector of the robot and the direction vector of the road section where the robot is currently located includes:
[0019] If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is greater than zero, the first rectangular area is used as the front area, and the second rectangular area is used as the rear area, a long side of the first rectangular area passes through the current position of the robot and is perpendicular to the road section where the robot is currently located, and the direction of the road section where the robot is currently located points to the first rectangular area; the second rectangular area and the first rectangular area share a long side, and the direction of the road section where the robot is currently located is away from the second rectangular area;
[0020] If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is less than zero, the first rectangular area is used as the rear area, and the second rectangular area is used as the front area.
[0021] In one embodiment, extracting a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area includes:
[0022] Determining a road section in the front area according to a boundary line of the front area and a road section included in the path pre-planned for the robot;
[0023] The road section in the rear area is determined according to the boundary line of the rear area and the road section included in the path pre-planned for the robot.
[0024] In one embodiment, obtaining the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map includes:
[0025] For a road section in the front area or a road section in the rear area, the road section is moved on the cost map and the offline map respectively with pixels as the moving unit, and a growth result on the cost map and the offline map is obtained when one pixel is moved, and the growth result is: encountering an obstacle or not encountering an obstacle;
[0026] The width of the road section is determined according to the growth results of the cost map and the offline map when each pixel is moved.
[0027] In one embodiment, determining the width of the road segment according to the growth results of the cost map and the offline map when each pixel is moved includes:
[0028] Each time a pixel is moved, if the growth result on the cost map is that an obstacle is encountered, and the growth result on the offline map is that no obstacle is encountered, then the first mark is filled in the pre-created empty array; if the growth result on the cost map is that no obstacle is encountered, and the growth result on the offline map is also that no obstacle is encountered, then the second mark is filled in the empty array, until the growth result on the offline map is that an obstacle is encountered, then the filling is stopped;
[0029] The width of the road section is determined according to the number of the second markings in the filled array.
[0030] In one embodiment, before determining the road section in the front area according to the boundary line of the front area and the road section included in the path pre-planned for the robot, the method further includes:
[0031] Get multiple road segments divided by the user;
[0032] For each road section, the road section is divided into a plurality of secondary road sections. For each secondary road section, the secondary road section is grown to both sides on the offline map to obtain the width of the secondary road section. A segmentation point is determined according to the widths of two adjacent secondary road sections. According to the segmentation point, the road section is re-segmented to obtain a result of the re-segmentation of the road section.
[0033] According to the result of re-segmentation of each road section, the road sections included in the path pre-planned for the robot are obtained.
[0034] In a second aspect, the present application also provides a road width determination device. The device comprises:
[0035] A first acquisition module is used to acquire a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot;
[0036] A determination module, configured to determine a front area and a rear area of the robot on the cost map according to a current position of the robot and a path pre-planned for the robot;
[0037] An extraction module, configured to extract a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area and the rear area;
[0038] The second acquisition module is used to acquire the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map.
[0039] In a third aspect, the present application further provides a robot. The robot includes a memory and a processor, the memory stores a computer program, and the processor implements the following steps when executing the computer program:
[0040] Obtaining a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot;
[0041] Determine a front area and a rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot;
[0042] Extracting a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area;
[0043] According to the cost map and the offline map, the width of the road section in the front area and the width of the road section in the rear area are obtained.
[0044] In a fourth aspect, the present application further provides a computer-readable storage medium. The computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0045] Obtaining a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot;
[0046] Determine a front area and a rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot;
[0047] Extracting a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area;
[0048] According to the cost map and the offline map, the width of the road section in the front area and the width of the road section in the rear area are obtained.
[0049] In a fifth aspect, the present application further provides a computer program product. The computer program product includes a computer program, and when the computer program is executed by a processor, the following steps are implemented:
[0050] Obtaining a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot;
[0051] Determine a front area and a rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot;
[0052] Extracting a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area;
[0053] According to the cost map and the offline map, the width of the road section in the front area and the width of the road section in the rear area are obtained.
[0054] The above road width determination method, device and robot first obtain a cost map, then determine the front area and rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot; then extract the road section in the front area and the road section in the rear area according to the path, front area and rear area pre-planned for the robot; finally, obtain the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map. The results obtained in the embodiments of the present application take into account the influence of temporary obstacles in real scenes, are closer to the real value, and improve the accuracy of decision making. BRIEF DESCRIPTION OF THE DRAWINGS
[0055] Figure 1 This is a schematic diagram of an offline map in a scenario;
[0056] Figure 2 A schematic diagram of width determination in one embodiment;
[0057] Figure 3 This is an example diagram of a real scene in an embodiment;
[0058] Figure 4 A schematic diagram of a flow chart of a method for determining road width in one embodiment;
[0059] Figure 5 A schematic diagram of determining a front area and a rear area in one embodiment;
[0060] Figure 6 A schematic diagram of determining a road section in a front area in one embodiment;
[0061] Figure 7 is a schematic diagram of the process of S408 in one embodiment;
[0062] Figure 8 A schematic diagram of an offline map;
[0063] Fig. 9 This is a schematic diagram of a cost map;
[0064] Fig.10 A schematic diagram of a road section;
[0065] Fig.11 A schematic diagram of a flow chart of a road section division method in one embodiment;
[0066] Fig.12 An example diagram of road segment division in one embodiment;
[0067] Fig.13 is a structural block diagram of a road width determination device in one embodiment;
[0068] Fig.14FIG. 4 is a diagram showing the internal structure of a computer device in one embodiment. DETAILED DESCRIPTION
[0069] In order to make the purpose, technical solution and advantages of the present application more clearly understood, the present application is further described in detail below in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain the present application and are not used to limit the present application.
[0070] Figure 1 For an offline map of a scene, Figure 1 The obstacles in the offline map are all static obstacles, which can be understood as obstacles with fixed positions. When there are no pedestrians or other moving obstacles, the robot can be controlled to move along the Figure 1 The dotted line in the figure can be the walking path planned by the user for the robot. During the walking process, the robot can collect local images through the RGB-D sensor. After the robot completes the journey, the images collected by the robot are spliced, and the walking path is added to the spliced image to obtain Figure 1 Offline maps shown.
[0071] In some embodiments, in order to obtain the width of the walking path, the walking path can be divided into multiple primary track segments, and each primary track segment can be divided into multiple secondary segments. For each segment, the segment is grown toward both sides on the offline map to obtain the width of each segment. Figure 2 As shown in the figure, after growing the second segment in the second track to both sides, the width is Figure 2 shown.
[0072] However, as described above, offline maps select relatively clean scenes when building maps, while the robot is actually walking. Figure 3 As shown, it is inevitable to encounter pedestrians or other obstacles that suddenly block the road. If the width is obtained according to the above method, it is easy to make wrong decisions and cause collisions with pedestrians.
[0073] In order to solve the above technical problems, the embodiment of the present application proposes a method for determining the road width. Taking the fact that the width determined based on the offline map cannot adapt to the real scene as the starting point, it is proposed to generate a cost map in real time during the robot's walking process. The cost map can be understood as a map generated by adding information such as the robot's position and orientation to the image after the robot collects the local image in real time. Based on the cost map, the width of the front and rear roads is calculated in real time. Since the local image collected in real time contains temporary obstacles around the robot, temporary obstacles can be avoided when calculating the width based on the cost map, so that the calculated width is closer to the real value, improving the accuracy of decision-making.
[0074] The road width determination method provided in the embodiment of the present application can be applied to any form of robot, such as a food delivery robot, a cleaning robot or a sorting robot, etc., and the embodiment of the present application does not limit this. The implementation process of the embodiment of the present application is described in detail below in conjunction with specific embodiments.
[0075] In one embodiment, Figure 4 As shown, a method for determining road width is provided, comprising the following steps:
[0076] S402: Obtain a cost map.
[0077] Optionally, the robot may collect images at preset intervals, and generate a corresponding cost map based on each image after collecting the image, that is, the cost map is updated in real time.
[0078] Optionally, the preset time may be 1 second, and the robot may collect images through an installed RGB-D sensor.
[0079] Optionally, after the robot captures the image, a cost map can be generated in the following manner: the current position of the robot, the orientation of the robot, and the path pre-planned for the robot are added to the image, and the added image can be used as a cost map.
[0080] The current position of the robot can be obtained by a positioning module installed on the robot, and the orientation of the robot can be obtained by a direction sensor installed on the robot. The working principle of the positioning module and the working principle of the direction sensor can be found in the prior art, and the embodiments of this application will not be repeated here.
[0081] Optionally, the user can plan a path for the robot in advance and divide the path into multiple tracks, divide each track into multiple segments, define a direction for each segment, and store the coordinates of each point on the path and the path division method into the robot, so that the robot can add the path to the image after collecting the image.
[0082] S404: Determine the front area and the rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot.
[0083] Optionally, the current section of the road where the robot is located can be determined according to the current position of the robot and the path pre-planned for the robot; the front area and the rear area can be determined according to the orientation of the robot and the direction of the current section of the road where the robot is located.
[0084] As described above, the path pre-planned for the robot includes multiple tracks, each track includes multiple segments, and the distance from the robot's current position to each segment can be calculated, and the segment with the closest distance is used as the robot's current section.
[0085] Optionally, after determining the current section of the road where the robot is located, on the one hand, the direction vector of the robot can be determined according to the orientation of the robot; on the other hand, the direction vector of the current section of the road where the robot is located can be determined according to the direction of the current section of the road where the robot is located, and the front area and the rear area can be determined based on the two direction vectors.
[0086] Optionally, the inner product of the robot's direction vector and the direction vector of the road section the robot is currently on can be calculated. If the inner product is greater than zero, it is considered that the robot's direction is consistent with the direction of the road section the robot is currently on, and the first rectangular area is used as the front area and the second rectangular area is used as the rear area; if the inner product is less than zero, it is considered that the robot's direction is opposite to the direction of the road section the robot is currently on, and the first rectangular area is used as the rear area and the second rectangular area is used as the front area. One long side of the first rectangular area passes through the robot's current position and is perpendicular to the road section the robot is currently on, and the direction of the road section the robot is currently on points to the first rectangular area; the second rectangular area and the first rectangular area share a long side, and the direction of the road section the robot is currently on points away from the second rectangular area.
[0087] Optionally, the sizes of the front area and the rear area can be flexibly set according to actual conditions, for example, they can be set to: 100 pixels in length and 50 pixels in width.
[0088] Here are some examples:
[0089] like Figure 5As shown, assuming that the robot's orientation angle is α and the direction of the robot's current section is β, then the robot's direction vector is (cosα, sinα), and the direction vector of the robot's current section is (cosβ, sinβ). Calculate the inner product of the two vectors (cosα*cosβ, sinα*sinβ). If (cosα*cosβ, sinα*sinβ)>0, it is considered that the robot's direction is consistent with the direction of the robot's current section, and the rectangular area R1 is used as the front area, and the rectangular area R2 is used as the rear area. If (cosα*cosβ, sinα*sinβ)<0, it is considered that the robot's direction is opposite to the direction of the robot's current section, and the rectangular area R1 is used as the rear area, and the rectangular area R2 is used as the front area. It should be noted that one of the long sides of the rectangular area R1 passes through the robot's current position and is perpendicular to the robot's current section, and the direction of the robot's current section points to the rectangular area R1. The rectangular area R2 and the rectangular area R1 share a long side, and the direction of the road section where the robot is currently located is away from the rectangular area R2.
[0090] S406: extracting a road section in the front area and a road section in the rear area according to the path, the front area and the rear area pre-planned for the robot.
[0091] Optionally, the road segment in the front area may be determined based on the boundary line of the front area and the road segment included in the path pre-planned for the robot; the road segment in the rear area may be determined based on the boundary line of the rear area and the road segment included in the path pre-planned for the robot. The road segment included in the path pre-planned for the robot mentioned in the above process may be a segment.
[0092] Taking the front area as an example, the following judgment can be made for each segment based on the coordinates of the front area boundary line and the coordinates of each segment included in the path pre-planned for the robot:
[0093] Determine whether the two endpoints of the segment are in the front area. If both endpoints are not in the front area, further determine whether the segment intersects with the front area. If they do not intersect, it is considered that the segment does not belong to the front area. If they intersect, it is considered that the segment and the front area have two intersections, and the road section with the two intersections as endpoints is used as the road section in the current area; if both endpoints are in the front area, the segment is directly used as the road section in the current area; if only one endpoint is in the front area, it is considered that the segment and the front area have an intersection, and the road section with the intersection and the endpoint falling in the front area as two endpoints is used as the road section in the front area. The intersection point of each segment and the front area is also referred to as the first intersection point in the embodiment of the present application. Similar to the front area, the same method can be used to extract the road section in the rear area. The intersection point of each segment and the rear area is also referred to as the second intersection point in the embodiment of the present application.
[0094] Here are some examples:
[0095] See also Figure 6 As shown, according to the coordinates of the front area boundary line and the coordinates of each segment, we can get Figure 6 In the figure, the segments (0, 2) and (2, 0) have only one endpoint in the front area, so they both have an intersection with the front area. The intersection of the segment (0, 2) and the front area is A, and the intersection of the segment (2, 0) and the front area is C. The endpoint of the segment (0, 2) in the front area is B, and the endpoint of the segment (2, 0) in the front area is also B. Then AB and BC are taken as the sections in the front area. Since both endpoints of the segment (3, 0) are in the front area, the segment (3, 0) is directly taken as the section in the front area. It can be obtained that the sections in the front area include AB, BC and the segment (3, 0).
[0096] It should be noted that in the above example, the identifier (a, b) used by the segment, a represents the track number corresponding to the segment, and b represents the number of the segment in the track. For example, (0, 2) represents the second segment in the 0th track.
[0097] S408. Obtain the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map.
[0098] Optionally, you can Figure 1 The offline map is obtained in a schematic manner, see the description above, the difference between the offline map and the cost map is that the offline map only has static obstacles, while the cost map is obtained based on real-time collected images, so there may be temporary obstacles on the cost map, such as pedestrians or temporarily placed tables and chairs. These two maps can be combined to calculate the width of the road section in the front area and the width of the road section in the rear area. The result takes into account the impact of temporary obstacles and is more realistic. Moreover, because temporary obstacles are dynamically changing in real scenarios, the area around the robot is circled in the embodiment of the present application, and only the width of the road section in the surrounding area is extracted, which can avoid the problem of large-scale width extraction and large amount of calculation.
[0099] Optionally, the coordinate system corresponding to the offline map is the original space coordinate system, and the coordinate system corresponding to the cost map is the online space coordinate system. The original space coordinate system and the real-world coordinate system have an affine transformation relationship H1, and the online space coordinate system and the real-world coordinate system have a radial transformation relationship H2. Before extracting the width, the coordinates of the offline map can be first converted to the real-world coordinate system through H1, and then converted to the online space coordinate system through the inverse matrix of H2. Let M1 be the matrix of the offline map in the original space coordinate system, and M2 be the matrix of the offline map in the online space coordinate system, then M2 = M1*H1*H2 T .
[0100] The road width determination method provided in the embodiment of the present application first obtains the cost map, and then determines the front area and rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot; then extracts the road section in the front area and the road section in the rear area according to the path, front area and rear area pre-planned for the robot; finally, obtains the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map. The result obtained in the embodiment of the present application takes into account the influence of temporary obstacles in real scenes, is closer to the real value, and improves the decision accuracy.
[0101] A possible implementation of S408 is described below. Specifically, Figure 7 As shown, S408 includes:
[0102] S701, for a road section in the front area or a road section in the rear area, the road section is moved on the cost map and the offline map respectively with pixels as the moving unit, and the growth result on the cost map and the offline map is obtained when one pixel is moved. The growth result is: encountering an obstacle or not encountering an obstacle.
[0103] It should be noted that: for any road section in the front area or any road section in the rear area, the method of S701-S702 can be used to determine its width. Figure 6 As shown, the road sections in the front area include: AB, BC and the segment numbered (3, 0). For AB, BC and the segment numbered (3, 0), the method of S701-S702 can be used to determine the width.
[0104] It should be noted that when the road section is moved on the two maps in units of pixels, the direction of movement is the same. For example, if the road section is moved one pixel upward on the cost map, it will also be moved one pixel upward on the offline map. In other words, although it is moving on different maps, the direction and pace of movement are consistent. The movement mentioned in the embodiments of the present application can also be called translation.
[0105] It should be noted that: whether on the offline map or on the cost map, when a road section moves one pixel, if the coordinates of the road section after the move coincide with the coordinates of some pixel points of the obstacle, it is considered that the growth result of this time encounters an obstacle; if the coordinates of the road section after the move do not coincide with the coordinates of all pixel points of the obstacle, it is considered that the growth result of this time does not encounter an obstacle.
[0106] S702: Determine the width of the road section according to the growth results of the cost map and the offline map when moving one pixel each time.
[0107] Optionally, when moving one pixel each time, if the growth result on the cost map is that an obstacle is encountered, and the growth result on the offline map is that no obstacle is encountered, then fill the first mark in the pre-created empty array; if the growth result on the cost map is that no obstacle is encountered, and the growth result on the offline map is also that no obstacle is encountered, then fill the second mark in the empty array until the growth result on the offline map is that an obstacle is encountered, then stop filling; determine the width of the road section according to the number of the second marks in the filled array. It can be understood that the first mark and the second mark can be 0 and 1 respectively, and of course can also be other symbols, etc., as long as the obstacles on the cost map can be identified, and the symbol types of the first mark and the second mark are not strictly limited here.
[0108] The following example takes the first mark as 0 and the second mark as 1 as an example:
[0109] For example, Figure 8 For offline maps, Fig. 9 The cost map is used as the example to illustrate the process of S701-S702. Figure 8 and Fig. 9As you can see, the costmap contains a temporary obstacle C. Taking the upward translation as an example, translate AB upward by one pixel on the offline map and the costmap respectively. If no obstacle is encountered on the offline map but an obstacle is encountered on the costmap, fill the array with 0. If no obstacle is encountered on the offline map and no obstacle is encountered on the costmap, fill the array with 1. Continue to translate upward and fill the array until an obstacle is encountered on the offline map, then stop filling. In the downward translation process, the array is filled in the same way. It should be noted that since there are two different translation directions, the numbers should be filled in the opposite direction. See Fig. 9 As shown, upward is 001111, downward is 011111. The longest continuous number of 1s in the filled array can be counted as the width of AB. Fig. 9 As shown, the obtained array is [111100011111], and the longest number of consecutive 1s is 5, so the width of AB is determined to be 5 pixels.
[0110] The embodiment of the present application provides an implementation method for determining the width based on the cost map and the offline map. The result obtained by the embodiment of the present application takes into account the impact of temporary obstacles in the real scene, is closer to the real value, and improves the decision accuracy.
[0111] In some embodiments, the segments included in the path pre-planned for the robot can be divided by the user. However, the widths of different locations on a segment may vary greatly, such as Fig.10 As shown. This causes the width extracted later to deviate from the true value. To this end, this application embodiment provides a division method, see Fig.11 As shown, the following steps are included:
[0112] S1101. Obtain multiple segments divided by the user, and for each segment, divide the segment into multiple sub_segments.
[0113] Optionally, the segment may be divided into multiple small segments with 3 adjacent pixels as a group, each small segment is called a sub_segment. In the embodiment of the present application, the sub_segment is also called a secondary segment.
[0114] S1102 . For each sub_segment, grow the sub_segment toward both sides on the offline map to obtain the width of the sub_segment.
[0115] Optionally, the sub_segment can be moved to both sides to obtain the width of both sides of the sub_segment. Specifically, taking upward as an example, the sub_segment can be moved upward in pixels until the sub_segment encounters an obstacle, and the number of pixels moved by the sub_segment is used as the width of the upper side. Similarly, the width of the lower side can be obtained.
[0116] S1103 . Determine a segmentation point according to the widths of two adjacent sub_segments.
[0117] Optionally, given a width difference threshold h, traverse each sub_segment, compare the width of the i-th sub_segment with the width of the i+1-th sub_segment, and if the absolute value of the width difference is greater than the width difference threshold h, the pixel point shared by the width of the i-th sub_segment and the i+1-th sub_segment is considered to be the segmentation point.
[0118] Optionally, the upper width of the i-th sub_segment and the upper width of the i+1-th sub_segment may be compared, or the lower width of the i-th sub_segment and the lower width of the i+1-th sub_segment may be compared, which is not limited in the embodiments of the present application.
[0119] S1104. Re-segment the segment according to the segmentation point to obtain a result of the segment re-segmentation.
[0120] Here are some examples:
[0121] See also Fig.12 As shown in the figure, AB is a segment, which is divided into multiple small segments with 3 pixels as a group, and multiple sub_segments are obtained, such as Fig.12 ab, bc and cd in . Shift ab upwards in pixels until it encounters an obstacle. The number of pixels shifted is m1, and the width above ab is m1. Similarly, the width below ab is m2, the width above bc is m3, and the width below bc is m4. Given a width difference threshold h, determine whether |m1-m3| or |m2-m4| is greater than h. If so, b is considered to be the segmentation point. Assuming that AB has only one segmentation point b, AB can be segmented into two segments, which are Ab and bB. Ab and bB are the results of AB re-segmentation.
[0122] The above operation is performed on all segments segmented by the user to obtain the result of re-segmentation of each segment. The results of re-segmentation of all segments constitute the road segments included in the path pre-planned for the robot mentioned above.
[0123] The method for dividing segments provided in the embodiment of the present application makes the segments more refined, and when width extraction is performed subsequently, the result is closer to the actual value.
[0124] It should be understood that, although the various steps in the flowcharts involved in the above-mentioned embodiments are displayed in sequence according to the indication of the arrows, these steps are not necessarily executed in sequence according to the order indicated by the arrows. Unless there is a clear explanation in this article, the execution of these steps does not have a strict order restriction, and these steps can be executed in other orders. Moreover, at least a part of the steps in the flowcharts involved in the above-mentioned embodiments can include multiple steps or multiple stages, and these steps or stages are not necessarily executed at the same time, but can be executed at different times, and the execution order of these steps or stages is not necessarily to be carried out in sequence, but can be executed in turn or alternately with other steps or at least a part of the steps or stages in other steps.
[0125] Based on the same inventive concept, the embodiment of the present application also provides a road width determination device for implementing the road width determination method involved above. The implementation scheme for solving the problem provided by the device is similar to the implementation scheme recorded in the above method, so the specific limitations in one or more embodiments of the road width determination device provided below can refer to the limitations of the road width determination method above, and will not be repeated here.
[0126] In one embodiment, Fig.13 As shown, a road width determination device is provided, comprising:
[0127] A first acquisition module 1301 is used to acquire a cost map, where the cost map is used to display the current position of the robot and the path pre-planned for the robot;
[0128] A determination module 1302 is used to determine the front area and the rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot;
[0129] An extraction module 1303 is used to extract a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area and the rear area;
[0130] The second acquisition module 1304 is used to acquire the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map.
[0131] Optionally, the cost map is also used to display the orientation of the robot; the determination module is specifically used to:
[0132] Determine the current section of the robot according to the current position of the robot and the path pre-planned for the robot;
[0133] The front area and the rear area are determined according to the orientation of the robot and the direction of the road section where the robot is currently located.
[0134] Optionally, the determination module 1302 is specifically configured to:
[0135] Determining a direction vector of the robot according to the orientation of the robot;
[0136] Determining a direction vector of the road section currently located by the robot according to the direction of the road section currently located by the robot;
[0137] The front area and the rear area are determined according to the direction vector of the robot and the direction vector of the road section where the robot is currently located.
[0138] Optionally, the determination module 1302 is specifically configured to:
[0139] If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is greater than zero, the first rectangular area is used as the front area, and the second rectangular area is used as the rear area, a long side of the first rectangular area passes through the current position of the robot and is perpendicular to the road section where the robot is currently located, and the direction of the road section where the robot is currently located points to the first rectangular area; the second rectangular area and the first rectangular area share a long side, and the direction of the road section where the robot is currently located is away from the second rectangular area;
[0140] If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is less than zero, the first rectangular area is used as the rear area, and the second rectangular area is used as the front area.
[0141] Optionally, the extraction module 1303 is specifically used for:
[0142] Determining a road section in the front area according to a boundary line of the front area and a road section included in the path pre-planned for the robot;
[0143] The road section in the rear area is determined according to the boundary line of the rear area and the road section included in the path pre-planned for the robot.
[0144] Optionally, the second acquisition module 1304 is specifically used for:
[0145] For a road section in the front area or a road section in the rear area, the road section is moved on the cost map and the offline map respectively with pixels as the moving unit, and a growth result on the cost map and the offline map is obtained when one pixel is moved, and the growth result is: encountering an obstacle or not encountering an obstacle;
[0146] The width of the road section is determined according to the growth results of the cost map and the offline map when each pixel is moved.
[0147] Optionally, the second acquisition module 1304 is specifically used for:
[0148] Each time a pixel is moved, if the growth result on the cost map is that an obstacle is encountered, and the growth result on the offline map is that no obstacle is encountered, then the first mark is filled in the pre-created empty array; if the growth result on the cost map is that no obstacle is encountered, and the growth result on the offline map is also that no obstacle is encountered, then the second mark is filled in the empty array, until the growth result on the offline map is that an obstacle is encountered, then the filling is stopped;
[0149] The width of the road section is determined according to the number of the second markings in the filled array.
[0150] Optionally, the extraction module 1303 is further used for:
[0151] Get multiple road segments divided by the user;
[0152] For each road section, the road section is divided into a plurality of secondary road sections. For each secondary road section, the secondary road section is grown to both sides on the offline map to obtain the width of the secondary road section. A segmentation point is determined according to the widths of two adjacent secondary road sections. According to the segmentation point, the road section is re-segmented to obtain a result of the re-segmentation of the road section.
[0153] According to the result of re-segmenting each road section, the road sections included in the path pre-planned for the robot are obtained.
[0154] Each module in the above-mentioned road width determination device can be implemented in whole or in part by software, hardware or a combination thereof. Each module can be embedded in or independent of a processor in a computer device in the form of hardware, or can be stored in a memory in a computer device in the form of software, so that the processor can call and execute operations corresponding to each module.
[0155] In one embodiment, a computer device is provided. The computer device may be a terminal, and its internal structure diagram may be as follows: Fig.14 As shown. The computer device includes a processor, a memory, a communication interface, a display screen and an input device connected through a system bus. Among them, the processor of the computer device is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system and a computer program. The internal memory provides an environment for the operation of the operating system and the computer program in the non-volatile storage medium. The communication interface of the computer device is used to communicate with an external terminal in a wired or wireless manner, and the wireless manner can be achieved through WIFI, a mobile cellular network, NFC (near field communication) or other technologies. When the computer program is executed by the processor, a method for determining the width of a road is implemented. The display screen of the computer device can be a liquid crystal display screen or an electronic ink display screen, and the input device of the computer device can be a touch layer covering the display screen, or a key, trackball or touchpad set on the computer device housing, or an external keyboard, touchpad or mouse, etc.
[0156] Those skilled in the art will understand that Fig.14 The structure shown in the figure is only a block diagram of a part of the structure related to the solution of the present application, and does not constitute a limitation on the computer device to which the solution of the present application is applied. The specific computer device may include more or fewer components than those shown in the figure, or combine certain components, or have a different arrangement of components.
[0157] In one embodiment, a robot is provided, including a memory and a processor, wherein a computer program is stored in the memory, and when the processor executes the computer program, the following steps are implemented:
[0158] Obtain a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot; determine the front area and the rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot; extract the road section in the front area and the road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area; obtain the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map.
[0159] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0160] The current section of the robot is determined according to the current position of the robot and the path pre-planned for the robot; the front area and the rear area are determined according to the orientation of the robot and the direction of the current section of the robot.
[0161] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0162] The direction vector of the robot is determined according to the orientation of the robot; the direction vector of the section of road where the robot is currently located is determined according to the direction of the section of road where the robot is currently located; the front area and the rear area are determined according to the direction vector of the robot and the direction vector of the section of road where the robot is currently located.
[0163] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0164] If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is greater than zero, the first rectangular area is used as the front area, and the second rectangular area is used as the rear area, one long side of the first rectangular area passes through the current position of the robot and is perpendicular to the road section where the robot is currently located, and the direction of the road section where the robot is currently located points to the first rectangular area; the second rectangular area and the first rectangular area share a long side, and the direction of the road section where the robot is currently located is away from the second rectangular area; if the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is less than zero, the first rectangular area is used as the rear area, and the second rectangular area is used as the front area.
[0165] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0166] The road section in the front area is determined according to the boundary line of the front area and the road section included in the path pre-planned for the robot; the road section in the rear area is determined according to the boundary line of the rear area and the road section included in the path pre-planned for the robot.
[0167] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0168] The obtaining, according to the cost map and the offline map, the width of the road section in the front area and the width of the road section in the rear area comprises: for the road section in the front area or the road section in the rear area, moving the road section on the cost map and the offline map respectively with pixels as the moving unit, and obtaining the growth result on the cost map and the offline map when moving one pixel each time, and the growth result is: encountering an obstacle or not encountering an obstacle; and determining the width of the road section according to the growth result on the cost map and the offline map when moving one pixel each time.
[0169] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0170] Each time a pixel is moved, if the growth result on the cost map is that an obstacle is encountered, and the growth result on the offline map is that no obstacle is encountered, then a first mark is filled in a pre-created empty array; if the growth result on the cost map is that no obstacle is encountered, and the growth result on the offline map is also that no obstacle is encountered, then a second mark is filled in the empty array until the growth result on the offline map is that an obstacle is encountered, then the filling is stopped; the width of the road section is determined according to the number of the second marks in the filled array.
[0171] In one embodiment, when the processor executes the computer program, the processor further implements the following steps:
[0172] Acquire multiple road sections segmented by the user; for each road section, divide the road section into multiple sub-road sections; for each sub-road section, grow the sub-road section to both sides on the offline map to obtain the width of the sub-road section; determine the segmentation point according to the width of two adjacent sub-road sections; re-segment the road section according to the segmentation point to obtain the result of the re-segmentation of the road section; and obtain the road section included in the path pre-planned for the robot according to the result of the re-segmentation of each road section.
[0173] In one embodiment, a computer readable storage medium is provided, on which a computer program is stored, and when the computer program is executed by a processor, the following steps are implemented:
[0174] Obtain a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot; determine the front area and the rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot; extract the road section in the front area and the road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area; obtain the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map.
[0175] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0176] The current section of the robot is determined according to the current position of the robot and the path pre-planned for the robot; the front area and the rear area are determined according to the orientation of the robot and the direction of the current section of the robot.
[0177] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0178] The direction vector of the robot is determined according to the orientation of the robot; the direction vector of the section of road where the robot is currently located is determined according to the direction of the section of road where the robot is currently located; the front area and the rear area are determined according to the direction vector of the robot and the direction vector of the section of road where the robot is currently located.
[0179] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0180] If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is greater than zero, the first rectangular area is used as the front area, and the second rectangular area is used as the rear area, one long side of the first rectangular area passes through the current position of the robot and is perpendicular to the road section where the robot is currently located, and the direction of the road section where the robot is currently located points to the first rectangular area; the second rectangular area and the first rectangular area share a long side, and the direction of the road section where the robot is currently located is away from the second rectangular area; if the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is less than zero, the first rectangular area is used as the rear area, and the second rectangular area is used as the front area.
[0181] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0182] The road section in the front area is determined according to the boundary line of the front area and the road section included in the path pre-planned for the robot; the road section in the rear area is determined according to the boundary line of the rear area and the road section included in the path pre-planned for the robot.
[0183] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0184] For a road section in the front area or a road section in the rear area, the road section is moved on the cost map and the offline map respectively with pixels as the moving unit, and a growth result on the cost map and the offline map is obtained when one pixel is moved, and the growth result is: encountering an obstacle or not encountering an obstacle; according to the growth result on the cost map and the offline map when one pixel is moved, the width of the road section is determined.
[0185] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0186] Each time a pixel is moved, if the growth result on the cost map is that an obstacle is encountered, and the growth result on the offline map is that no obstacle is encountered, then a first mark is filled in a pre-created empty array; if the growth result on the cost map is that no obstacle is encountered, and the growth result on the offline map is also that no obstacle is encountered, then a second mark is filled in the empty array until the growth result on the offline map is that an obstacle is encountered, then the filling is stopped; the width of the road section is determined according to the number of the second marks in the filled array.
[0187] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0188] Acquire multiple road sections segmented by the user; for each road section, divide the road section into multiple sub-road sections; for each sub-road section, grow the sub-road section to both sides on the offline map to obtain the width of the sub-road section; determine the segmentation point according to the width of two adjacent sub-road sections; re-segment the road section according to the segmentation point to obtain the result of the re-segmentation of the road section; and obtain the road section included in the path pre-planned for the robot according to the result of the re-segmentation of each road section.
[0189] In one embodiment, a computer program product is provided, including a computer program, which, when executed by a processor, implements the steps in the above-mentioned method embodiments. When the computer program is executed by a processor, the following steps are implemented:
[0190] Obtain a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot; determine the front area and the rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot; extract the road section in the front area and the road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area; obtain the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map.
[0191] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0192] The current section of the robot is determined according to the current position of the robot and the path pre-planned for the robot; the front area and the rear area are determined according to the orientation of the robot and the direction of the current section of the robot.
[0193] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0194] The direction vector of the robot is determined according to the orientation of the robot; the direction vector of the section of road where the robot is currently located is determined according to the direction of the section of road where the robot is currently located; the front area and the rear area are determined according to the direction vector of the robot and the direction vector of the section of road where the robot is currently located.
[0195] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0196] If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is greater than zero, the first rectangular area is used as the front area, and the second rectangular area is used as the rear area, one long side of the first rectangular area passes through the current position of the robot and is perpendicular to the road section where the robot is currently located, and the direction of the road section where the robot is currently located points to the first rectangular area; the second rectangular area and the first rectangular area share a long side, and the direction of the road section where the robot is currently located is away from the second rectangular area; if the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is less than zero, the first rectangular area is used as the rear area, and the second rectangular area is used as the front area.
[0197] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0198] The road section in the front area is determined according to the boundary line of the front area and the road section included in the path pre-planned for the robot; the road section in the rear area is determined according to the boundary line of the rear area and the road section included in the path pre-planned for the robot.
[0199] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0200] For a road section in the front area or a road section in the rear area, the road section is moved on the cost map and the offline map respectively with pixels as the moving unit, and a growth result on the cost map and the offline map is obtained when one pixel is moved, and the growth result is: encountering an obstacle or not encountering an obstacle; according to the growth result on the cost map and the offline map when one pixel is moved, the width of the road section is determined.
[0201] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0202] Each time a pixel is moved, if the growth result on the cost map is that an obstacle is encountered, and the growth result on the offline map is that no obstacle is encountered, then a first mark is filled in a pre-created empty array; if the growth result on the cost map is that no obstacle is encountered, and the growth result on the offline map is also that no obstacle is encountered, then a second mark is filled in the empty array until the growth result on the offline map is that an obstacle is encountered, then the filling is stopped; the width of the road section is determined according to the number of the second marks in the filled array.
[0203] In one embodiment, when the computer program is executed by a processor, the following steps are also implemented:
[0204] Acquire multiple road sections segmented by the user; for each road section, divide the road section into multiple sub-road sections; for each sub-road section, grow the sub-road section to both sides on the offline map to obtain the width of the sub-road section; determine the segmentation point according to the width of two adjacent sub-road sections; re-segment the road section according to the segmentation point to obtain the result of the re-segmentation of the road section; and obtain the road section included in the path pre-planned for the robot according to the result of the re-segmentation of each road section.
[0205] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by instructing the relevant hardware through a computer program, and the computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above-mentioned methods. Among them, any reference to the memory, database or other medium used in the embodiments provided in the present application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetoresistive random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. As an illustration and not limitation, RAM can be in various forms, such as static random access memory (SRAM) or dynamic random access memory (DRAM). The database involved in each embodiment provided in this application may include at least one of a relational database and a non-relational database. Non-relational databases may include distributed databases based on blockchains, etc., but are not limited to this. The processor involved in each embodiment provided in this application may be a general-purpose processor, a central processing unit, a graphics processor, a digital signal processor, a programmable logic device, a data processing logic device based on quantum computing, etc., but are not limited to this.
[0206] The technical features of the above embodiments may be combined arbitrarily. To make the description concise, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.
[0207] The above-described embodiments only express several implementation methods of the present application, and the descriptions thereof are relatively specific and detailed, but they cannot be understood as limiting the scope of the present application. It should be pointed out that, for a person of ordinary skill in the art, several variations and improvements can be made without departing from the concept of the present application, and these all belong to the protection scope of the present application. Therefore, the protection scope of the present application shall be subject to the attached claims.
Claims
1. A method for determining road width, for use with a robot, characterized in that: The method comprises: Obtaining a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot; Determine a front area and a rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot; Extracting a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area, and the rear area; According to the cost map and the offline map, obtaining the width of the road section in the front area and the width of the road section in the rear area; The step of obtaining the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map includes: For a road section in the front area or a road section in the rear area, the road section is moved on the cost map and the offline map respectively with pixels as the moving unit, and a growth result on the cost map and the offline map is obtained when one pixel is moved, and the growth result is: encountering an obstacle or not encountering an obstacle; The width of the road section is determined according to the growth results of the cost map and the offline map when each pixel is moved.
2. The method according to claim 1, characterized in that The cost map is also used to display the orientation of the robot; the process of determining the front area and the rear area of the robot on the cost map according to the current position of the robot and the path pre-planned for the robot includes: Determine the current section of the road where the robot is located according to the current position of the robot and the path pre-planned for the robot; The front area and the rear area are determined according to the orientation of the robot and the direction of the road section where the robot is currently located.
3. The method according to claim 2, characterized in that The determining the front area and the rear area according to the orientation of the robot and the direction of the road section where the robot is currently located includes: Determining a direction vector of the robot according to the orientation of the robot; Determining a direction vector of the road section currently located by the robot according to the direction of the road section currently located by the robot; The front area and the rear area are determined according to the direction vector of the robot and the direction vector of the road section where the robot is currently located.
4. The method according to claim 3, characterized in that The determining the front area and the rear area according to the direction vector of the robot and the direction vector of the road section where the robot is currently located comprises: If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is greater than zero, the first rectangular area is used as the front area, and the second rectangular area is used as the rear area, a long side of the first rectangular area passes through the current position of the robot and is perpendicular to the road section where the robot is currently located, and the direction of the road section where the robot is currently located points to the first rectangular area; the second rectangular area and the first rectangular area share a long side, and the direction of the road section where the robot is currently located is away from the second rectangular area; If the inner product of the direction vector of the robot and the direction vector of the road section where the robot is currently located is less than zero, the first rectangular area is used as the rear area, and the second rectangular area is used as the front area.
5. The method according to claim 1, characterized in that The extracting, according to the path pre-planned for the robot, the front area and the rear area, a road section in the front area and a road section in the rear area, comprises: Determining a road section in the front area according to a boundary line of the front area and a road section included in the path pre-planned for the robot; The road section in the rear area is determined according to the boundary line of the rear area and the road section included in the path pre-planned for the robot.
6. The method according to claim 1, characterized in that The determining the width of the road section according to the growth results of the cost map and the offline map when each pixel is moved includes: Each time a pixel is moved, if the growth result on the cost map is that an obstacle is encountered, and the growth result on the offline map is that no obstacle is encountered, then the first mark is filled in the pre-created empty array; if the growth result on the cost map is that no obstacle is encountered, and the growth result on the offline map is also that no obstacle is encountered, then the second mark is filled in the empty array, until the growth result on the offline map is that an obstacle is encountered, then the filling is stopped; The width of the road section is determined according to the number of the second markings in the filled array.
7. The method according to claim 5, characterized in that Before determining the road section in the front area according to the boundary line of the front area and the road section included in the path pre-planned for the robot, the method further includes: Get multiple road segments divided by the user; For each road section, the road section is divided into a plurality of secondary road sections. For each secondary road section, the secondary road section is grown to both sides on the offline map to obtain the width of the secondary road section. A segmentation point is determined according to the widths of two adjacent secondary road sections. According to the segmentation point, the road section is re-segmented to obtain a result of the re-segmentation of the road section. According to the result of re-segmentation of each road section, the road sections included in the path pre-planned for the robot are obtained.
8. A road width determination device, characterized in that: The device comprises: A first acquisition module is used to acquire a cost map, wherein the cost map is used to display the current position of the robot and the path pre-planned for the robot; A determination module, configured to determine a front area and a rear area of the robot on the cost map according to a current position of the robot and a path pre-planned for the robot; An extraction module, configured to extract a road section in the front area and a road section in the rear area according to the path pre-planned for the robot, the front area and the rear area; A second acquisition module, used for acquiring the width of the road section in the front area and the width of the road section in the rear area according to the cost map and the offline map; The second acquisition module is used to move the road section in the front area or the road section in the rear area on the cost map and the offline map respectively with pixels as the moving unit, and obtain the growth result of the cost map and the offline map when each pixel is moved, and the growth result is: encountering an obstacle or not encountering an obstacle; according to the growth result of the cost map and the offline map when each pixel is moved, the width of the road section is determined.
9. A robot comprising a memory and a processor, wherein the memory stores a computer program, wherein: The processor is configured to implement the steps of the method according to any one of claims 1 to 7 when executing the computer program.
10. A computer-readable storage medium having a computer program stored thereon, characterized in that: When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
11. A computer program product, comprising a computer program, characterized in that When the computer program is executed by a processor, the steps of the method according to any one of claims 1 to 7 are implemented.
Citation Information
Patent Citations
Trajectory planning method and device, storage medium and electronic equipment
CN113799797A
Apparatus and method for detecting obstacle for on-line electric vehicle based on GPU
KR1020110073917A