Positioning determination method and device and electronic equipment
Patent Information
- Application Number
- CN202411269548.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-09-10
- Publication Date
- 2024-12-13
AI Technical Summary
When the sweeper enters under the bed, under the sofa or under the curtain, the lidar is blocked, resulting in abnormal data being received. The positioning results obtained by the SLAM algorithm are offset, and accurate positioning results cannot be obtained.
The laser points in the target laser frame are obtained through distance downsampling, the position distribution of the laser points is analyzed, and whether they are in a scene where the lidar is blocked, and the corresponding positioning method is adopted according to the recognition results to avoid the positioning results of the SLAM algorithm. Ensure accurate positioning is obtained in the concealed scenario.
Effectively identify and handle the situation where the lidar is blocked, avoid positioning offsets, ensure accurate positioning results are obtained in the masked scene, and prevent maps from being stacked.
Smart Images

Figure CN119126131A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of positioning technology, and in particular to a positioning determination method, device and electronic equipment. Background Art
[0002] When the robot vacuum cleaner enters places such as under beds, sofas, and curtains to clean, the cloth covering these scenes will droop and block the laser radar on the top of the robot vacuum cleaner, that is, the laser radar is covered. This will cause the laser radar to receive abnormal data, which will lead to positioning deviation based on the data obtained by the SLAM (Simultaneous Localization and Mapping) algorithm. Summary of the invention
[0003] The embodiments of the present application provide a positioning determination method, device, electronic device and readable storage medium, which can identify whether the scene is covered by a laser radar, and determine the corresponding target positioning result in a corresponding manner based on the scene recognition result, thereby avoiding the positioning deviation caused by ignoring the scene and directly using the positioning result obtained by the SLAM algorithm as the target positioning result.
[0004] The embodiments of the present application can be implemented as follows:
[0005] In a first aspect, an embodiment of the present application provides a positioning determination method, the method comprising:
[0006] According to a first preset distance and a distance between two first laser points in a target laser frame, distance downsampling is performed on the first laser point in the target laser frame to obtain a target set, wherein the laser point in the target laser frame is the first laser point;
[0007] Performing scene recognition according to the position distribution of the second laser point in the target set to obtain a scene recognition result, wherein the laser point in the target set is the second laser point, and the scene recognition result is used to indicate whether the laser radar that obtains the target laser frame is covered;
[0008] According to the positioning determination method corresponding to the scene recognition result, the target positioning result corresponding to the target laser frame is obtained, wherein different positioning determination methods correspond to different scene recognition results.
[0009] In a second aspect, an embodiment of the present application provides a positioning determination device, the device comprising:
[0010] a sampling module, configured to perform distance downsampling on the first laser points in the target laser frame according to a first preset distance and a distance between two first laser points in the target laser frame, so as to obtain a target set, wherein the laser points in the target laser frame are the first laser points;
[0011] an analysis module, configured to perform scene recognition according to the position distribution of the second laser point in the target set to obtain a scene recognition result, wherein the laser point in the target set is the second laser point, and the scene recognition result is used to indicate whether a laser radar that obtains the target laser frame is covered;
[0012] The positioning module is used to obtain the target positioning result corresponding to the target laser frame according to the positioning determination method corresponding to the scene recognition result, wherein different scene recognition results correspond to different positioning determination methods.
[0013] In a third aspect, an embodiment of the present application provides an electronic device, including a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the positioning determination method described in the aforementioned embodiment.
[0014] In a fourth aspect, an embodiment of the present application provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the positioning determination method as described in the aforementioned embodiment is implemented.
[0015] The positioning determination method, device, electronic device and readable storage medium provided by the embodiment of the present application perform distance downsampling of the laser points in the target laser frame to obtain a target set according to the first preset distance and the distance between the two laser points in the target laser frame; then, perform scene recognition according to the position distribution of the laser points in the target set to obtain a scene recognition result indicating whether the laser radar that obtains the target laser frame is covered; finally, obtain the target positioning result corresponding to the target laser frame according to the positioning determination method corresponding to the scene recognition result, wherein the positioning determination methods corresponding to different scene recognition results are different. In this way, it is possible to identify whether the scene is covered by the laser radar, and determine the corresponding target positioning result in a corresponding manner based on the scene recognition result, thereby avoiding the positioning deviation caused by ignoring the scene and directly using the positioning result obtained by the SLAM algorithm as the target positioning result, and making it possible to obtain accurate positioning results when the scene is covered by the laser radar. BRIEF DESCRIPTION OF THE DRAWINGS
[0016] In order to more clearly illustrate the technical solutions of the embodiments of the present application, the drawings required for use in the embodiments will be briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present application and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without paying creative work.
[0017] Figure 1 Set up a location diagram for the LiDAR;
[0018] Figure 2 This is a schematic diagram of the drooping position of the fabric;
[0019] Figure 3 Schematic diagram of laser points indicated by laser frames obtained when the laser radar is covered;
[0020] Figure 4 A block diagram of an electronic device provided in an embodiment of the present application;
[0021] Figure 5 A flowchart of a positioning determination method provided in an embodiment of the present application;
[0022] Figure 6 for Figure 5 A schematic flow chart of the sub-steps included in step S110;
[0023] Figure 7 for Figure 5 One of the flowchart diagrams of the sub-steps included in step S120;
[0024] Figure 8 for Figure 5 2 is a flow chart of the sub-steps included in step S120;
[0025] Fig. 9 for Figure 8 A schematic flow chart of the sub-steps included in sub-step S125;
[0026] Fig.10 A block diagram of a positioning determination device provided in an embodiment of the present application.
[0027] Icons: 100 - electronic device; 110 - memory; 120 - processor; 130 - communication unit; 200 - positioning determination device; 210 - sampling module; 220 - analysis module; 230 - positioning module. DETAILED DESCRIPTION
[0028] In order to make the purpose, technical solution and advantages of the embodiments of the present application clearer, the technical solution in the embodiments of the present application will be clearly and completely described below in conjunction with the drawings in the embodiments of the present application. Obviously, the described embodiments are part of the embodiments of the present application, rather than all the embodiments. The components of the embodiments of the present application described and shown in the drawings here can be arranged and designed in various different configurations.
[0029] Therefore, the following detailed description of the embodiments of the present application provided in the accompanying drawings is not intended to limit the scope of the present application for which protection is sought, but merely represents selected embodiments of the present application. Based on the embodiments of the present application, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present application.
[0030] It should be noted that relational terms such as "first" and "second" are used only to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0031] like Figure 1 As shown in the figure, the laser radar is usually located on the top of the sweeper. When the sweeper enters places such as under the bed, under the sofa, under the curtain, etc. to clean, the cloth covering these scenes will sag, and the laser radar on the top of the sweeper will be blocked, that is, the laser radar will be covered, which will cause the laser radar to receive abnormal data. For example, the lining cloth under the bed is Figure 2 The circular position shown in FIG. 1 is drooped, which will cause the position of the laser point indicated by the laser frame obtained by the laser radar to be as follows: Figure 3 Shown as thick white lines in the figure.
[0032] In general, the positioning result obtained by using the SLAM algorithm based on the obtained laser frame is directly used as the target positioning result corresponding to the above laser frame. Among them, the method of obtaining the positioning result based on the SLAM algorithm is as follows: the laser frame is aligned with the constructed map to obtain the positioning result. However, when the laser frame is obtained in a scene where the laser radar is covered, the positioning result obtained by the SLAM algorithm will be offset, that is, the positioning result obtained by the SLAM algorithm is inaccurate, which will cause overlapping of the subsequently constructed map.
[0033] In response to the above situation, the embodiments of the present application provide a positioning determination method, device and electronic device, which can identify whether the scene is blocked by the laser radar, and determine the corresponding target positioning result in a corresponding manner based on the scene recognition result, thereby avoiding the positioning deviation caused by ignoring the scene and directly using the positioning result obtained by the SLAM algorithm as the target positioning result, and making it possible to obtain accurate positioning results when the scene is blocked by the laser radar.
[0034] In conjunction with the accompanying drawings, some embodiments of the present application are described in detail below. In the absence of conflict, the following embodiments and features in the embodiments can be combined with each other.
[0035] Please refer to Figure 4 , Figure 4 A block diagram of an electronic device 100 provided in an embodiment of the present application. The electronic device 100 may be, but is not limited to, a sweeper, a server, etc. The electronic device 100 may include a memory 110, a processor 120, and a communication unit 130. The memory 110, the processor 120, and the communication unit 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these components can be electrically connected to each other via one or more communication buses or signal lines.
[0036] The memory 110 is used to store programs or data. The memory 110 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable programmable read-only memory (EEPROM), etc.
[0037] The processor 120 is used to read / write data or programs stored in the memory 110 and execute corresponding functions. For example, the memory 110 stores a positioning determination module 200, and the positioning determination module 200 includes at least one software function module that can be stored in the memory 110 in the form of software or firmware. The processor 120 executes various functional applications and data processing by running software programs and modules stored in the memory 110, such as the positioning determination module 200 in the embodiment of the present application, that is, implementing the positioning determination method in the embodiment of the present application.
[0038] The communication unit 130 is used to establish a communication connection between the electronic device 100 and other communication terminals through a network, and to send and receive data through the network.
[0039] It should be understood that Figure 4 The structure shown is only a schematic diagram of the structure of the electronic device 100. The electronic device 100 may also include Figure 4 More or fewer components as shown, or with Figure 4 Different configurations are shown. Figure 4 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0040] Please refer to Figure 5 , Figure 5 The present invention provides a flowchart of a positioning determination method according to an embodiment of the present invention. The method can be applied to the above positioning determination method. The specific flow of the positioning determination method is described in detail below. In this embodiment, the method may include steps S110 to S130.
[0041] Step S110, according to the first preset distance and the distance between two first laser points in the target laser frame, distance downsampling is performed on the first laser points in the target laser frame to obtain a target set.
[0042] In this embodiment, the target laser frame is a laser frame that needs to be scene-recognized, which can be determined in combination with actual needs. Scene recognition is used to determine whether the target laser frame is obtained in a scene where the laser radar is covered with cloth. Among them, the laser point in the target laser frame is the first laser point. According to the first preset distance and the distance between the two first laser points in the target laser frame, the first laser point included in the target laser frame can be distance-downsampled, and the sampling result is used as the target set. The laser point in the target set is the second laser point. It can be understood that the second laser point is a laser point sampled from the laser points included in the target laser frame. In this way, interference can be reduced while reducing the amount of calculation.
[0043] The target laser frame includes the position of each first laser point. The representation method of the position of the first laser point in the target laser frame can be determined in combination with actual needs. For example, it directly includes the two-dimensional coordinates representing the position of the first laser point, or includes the two-dimensional coordinates of the laser radar center and the distance and relative angle between the first laser point and the laser radar center.
[0044] Step S120, performing scene recognition according to the position distribution of the second laser points in the target set to obtain a scene recognition result.
[0045] In this embodiment, scene recognition can be performed based on the position distribution of the second laser points in the target set, combined with the position distribution of the laser points obtained when the laser radar is covered with a cloth, to obtain a scene recognition result. The scene recognition result is used to indicate whether the laser radar that obtains the target laser frame is covered, that is, whether the target laser frame is a laser frame obtained when the laser radar is covered. The specific scene recognition method can be determined in combination with actual needs.
[0046] Step S130, obtaining a target positioning result corresponding to the target laser frame according to a positioning determination method corresponding to the scene recognition result.
[0047] In this embodiment, when the scene recognition result is obtained, a positioning result can be determined as the target positioning result corresponding to the target laser frame according to the positioning determination method corresponding to the scene recognition result. Different scene recognition results correspond to different positioning determination methods.
[0048] In this way, the scene where the lidar is blocked by soft cloth can be identified, and accurate positioning results can be obtained in this scene, avoiding the positioning deviation caused by ignoring the scene and directly taking the positioning result obtained by the SLAM algorithm as the target positioning result.
[0049] When the robot vacuum cleaner is working, when each frame of laser radar data arrives, the SLAM module will locate and build maps in real time.
[0050] Optionally, in this embodiment, when each laser frame is obtained, an initial positioning result and a positioning score corresponding to the initial positioning result can be obtained based on the laser frame through the SLAM algorithm. Among them, the positioning score is used to indicate accuracy. It can be determined whether the positioning score is less than a preset score. If the positioning score is greater than or equal to the preset score, it can be determined that the laser frame does not need to be identified by the laser radar covered scene, and the laser frame is not used as the target laser frame. The initial positioning result corresponding to the laser frame can be directly used as the target positioning result corresponding to the laser frame. If the positioning score is less than the preset score, it can be determined that the laser frame needs to be identified by the laser radar covered scene, and the laser frame can be used as the target laser frame. Among them, the preset score can be specifically set in combination with actual needs. For example, if the positioning score ranges from 0 to 1, the preset score can be set to 0.8.
[0051] In this embodiment, when the target laser frame is determined, the laser radar data in the target laser frame can be read, and the distance downsampling can be performed, and the downsampled points can be added to the initial set, and the final initial set is the target set. Among them, one target laser frame corresponds to one initial set, and the initial set is cleared before each frame detection. That is, an initial set is established, and after the downsampling is completed for the first frame of the target laser frame, many laser points are added to the initial set; when the positioning is completed for the first frame of the target laser frame, before the downsampling is performed for the second frame of the target laser frame, the laser points in the initial set are cleared first, so as to add the laser points in the second frame of the target laser frame; and so on.
[0052] In this embodiment, Figure 6 The distance downsampling is performed in the manner shown to obtain the target set. Please refer to Figure 6 , Figure 6 for Figure 5 Schematic diagram of the flow of sub-steps included in step S110. In this embodiment, step S110 may include sub-steps S111 to S113.
[0053] Sub-step S111, traversing the first laser point in the target laser frame, and determining whether the distance between the first laser point and the laser radar is within a preset distance range.
[0054] Sub-step S112, if the distance between the first laser point and the laser radar is within the preset distance range and the initial set is empty, directly add the first laser point to the initial set.
[0055] Sub-step S113, if the distance between the first laser point and the laser radar is within the preset distance range and the initial set is not empty, then the distance between the first laser point and the first laser point last added to the initial set is calculated, and if the calculated distance is not less than the first preset distance, the first laser point is added to the initial set.
[0056] In this embodiment, a preset distance range may be pre-set, and the preset distance range is used to indicate the detection range of the laser radar, that is, to indicate the effective detection distance range of the laser radar, which is specifically determined by the actual model of the laser radar used. For example, the preset distance range is 0.1 to 4.9 meters.
[0057] According to the arrangement order of the first laser points in the target laser frame, the first laser points in the target laser frame are traversed. The traversal order can be sequential or reverse order. For the first first laser point traversed, it is determined whether the distance between the first first laser point and the laser radar is within the preset distance range. If the distance between the first first laser point and the laser radar is not within the preset distance range, for example, less than 0.1 meters or greater than 4.9 meters, the first first laser point is not added to the initial set.
[0058] If the distance between the first laser point and the laser radar is within the preset distance range, the first laser point is directly added to the initial set. Wherein, when no laser point has been added to the initial set based on the target laser frame, the initial set is empty.
[0059] Continue traversing, and determine whether the distance between the first laser point traversed and the laser radar is within the preset distance range. If the distance between the first laser point and the laser radar is not within the preset distance range, the first laser point is not added to the initial set. If the distance between the first laser point and the laser radar is within the preset distance range and the initial set is not empty at this time, the distance between the first laser point and the first laser point added to the initial set last time is calculated, and it is determined whether the distance is less than the first preset distance. If it is not less than, the first laser point is added to the initial set, and if it is less than, the first laser point is not added to the initial set. After the target laser frame is traversed, the initial set obtained after the traversal is completed is used as the target set. Among them, the first preset distance is used to determine whether the laser point is close, which can be determined in combination with actual needs, such as 0.05 meters.
[0060] The above distance downsampling method is described below with an example. In the following example, the preset distance range is 0.1 to 4.9 meters, and the first preset distance is 0.05 meters. Assume that the target laser frame includes the first laser points A, B, and C, and the traversal order is A first, then B, and finally C.
[0061] The initial set is empty. Determine whether the distance between the first laser point A and the laser radar is less than 0.1 meters or greater than 4.9 meters. If so, skip the first laser point A and do not add the first laser point A to the initial set. After skipping the first laser point A, determine whether the distance between the first laser point B and the laser radar is less than 0.1 meters or greater than 4.9 meters. If not, directly add the first laser point as a second laser point to the empty initial set. Next, determine whether the distance between the first laser point C and the laser radar is less than 0.1 meters or greater than 4.9 meters. If not, determine whether the distance between the last added first laser point B and the first laser point C is less than 0.05 meters. If not, add the first laser point C to the initial set. At this time, the initial set includes the first laser points B and C.
[0062] If the distance between the first laser point A and the laser radar is between 0.1 and 4.9 meters, the first laser point A is added as a second laser point to the initial set which is empty at this time. Next, determine whether the distance between the first laser point B and the laser radar is less than 0.1 meters or greater than 4.9 meters. If not, determine whether the distance between the last added first laser point A and the first laser point B is less than 0.05 meters. If not, add the first laser point B to the initial set. Then, determine whether the distance between the first laser point C and the laser radar is less than 0.1 meters or greater than 4.9 meters. If not, determine whether the distance between the last added first laser point B and the first laser point C is less than 0.05 meters. If not, add the first laser point C to the initial set.
[0063] As a possible implementation method, when the target set is obtained, the total number of laser points included in the target set can be counted as the first total number, that is, the total number of second laser points included in the target set can be counted as the first total number; then, it is determined whether the first total number is less than the second preset number. If the first total number is less than the second preset number, it can be determined that the information is insufficient and the detection is exited. In this case, the initial positioning result obtained by the SLAM algorithm corresponding to the target laser frame can be used as the target positioning result. If the first total number is greater than or equal to the second preset number, step S120 can be executed. Among them, the first preset number can be specifically determined in combination with actual needs, for example, it can be set to 30.
[0064] As a possible implementation, Figure 7 Please refer to Figure 7 , Figure 7 for Figure 5 One of the flowchart diagrams of the sub-steps included in step S120. In this embodiment, step S120 may include sub-steps S121 to S124.
[0065] Sub-step S121, determining, from the target set, a second laser point whose distance to the target centroid is less than a third preset distance as the third laser point.
[0066] In this embodiment, a one- or two-dimensional rectangular coordinate system can be established as the target coordinate system, and the position coordinates of each second laser point in the target set under the target coordinates can be obtained. Among them, the origin of the target coordinate system can be the center of the laser radar. According to the position coordinates of each second laser point in the target set under the target coordinates, the center of mass of the second laser point in the target set whose distance from the laser radar is less than the second preset distance can be calculated as the target center of mass Pc. That is, the center of mass Pc of the point in the target set whose ranging value (i.e., the distance between the laser point and the laser radar) is less than the second preset distance is calculated. It can be understood that the above-mentioned acquisition of the target center of mass means obtaining the two-dimensional coordinates of the target center of mass in the target coordinate system. The second preset distance can be set specifically in combination with actual needs, for example, set to 1 meter.
[0067] When the target mass center Pc is determined, the distance between each second laser point in the target set and the target mass center Pc can be calculated, and the second laser point whose distance is less than the third preset distance is used as the third laser point. The third preset distance can be set according to actual needs, for example, set to 1 meter. The third laser point is a short-distance point.
[0068] Sub-step S122: Calculate and obtain a ratio of a first number of the third laser points to a first total number of the second laser points as a first ratio.
[0069] Sub-step S123, determining whether the first ratio is smaller than a first preset ratio.
[0070] If the first ratio is smaller than the first preset ratio, sub-step S124 is executed.
[0071] Sub-step S124, determining that the laser radar is not covered.
[0072] After all the third laser points are determined, the number of the third laser points can be statistically obtained as the first number. The first total number of second laser points in the target set can also be statistically obtained. Then, the ratio of the first number to the first total number is calculated as the first ratio, that is, the result of dividing the first number by the first total number is used as the first ratio. In other words, the ratio of the number of close-range points to the number of all points in the target set is calculated as the first ratio. Then, it is determined whether the first ratio is less than the first preset ratio. If it is less than, it can be determined that it is not a scene where the laser radar is covered, and the detection can be exited. Optionally, if the first ratio is not less than the first preset ratio, it can be directly determined that it is a scene where the laser radar is covered, or it can be further identified in combination with other rules. Among them, the first preset ratio can be specifically set in combination with actual needs, such as being set to 0.8.
[0073] Optionally, you can also Figure 8 Please refer to the following method to perform scene recognition. Figure 8 , Figure 8 for Figure 5 2 is a flow chart of sub-steps included in step S120. In this embodiment, step S120 may further include sub-steps S125 to S128.
[0074] When the first ratio is not less than the first preset ratio, sub-step S125 is executed.
[0075] Sub-step S125, selecting a fourth laser point from the determined third laser points.
[0076] The fourth laser spot represents the third laser spot indicating that the laser radar is not covered.
[0077] As a possible implementation, Fig. 9 The method shown here determines the fourth laser point from the close-range points. Fig. 9 , Fig. 9 for Figure 8 Schematic diagram of the flow of sub-steps included in sub-step S125. In this embodiment, sub-step S125 may include sub-steps S1251 to S1255.
[0078] Sub-step S1251, performing straight line segment recognition on the target set and determining a second laser point corresponding to each straight line segment.
[0079] In this embodiment, any straight line recognition method can be used to perform straight line segment recognition on the second laser points in the target set to identify the straight line segments and the second laser points corresponding to each straight line segment.
[0080] Optionally, straight line segment recognition can be performed based on the second laser points in the target set to obtain an initial straight line segment and a corresponding second laser point. Then, the determined initial straight line segments are merged according to a preset merging rule to obtain each straight line segment and a corresponding second laser point. The second laser point corresponding to each straight line segment includes the second laser point corresponding to the initial straight line segment corresponding to the straight line segment, and the number of the second laser points corresponding to each straight line segment is greater than the first preset number. The preset merging rule can be determined in combination with actual needs.
[0081] As a possible implementation, the identified initial straight line segment can be expressed in a general straight line formula, that is, in the form of aX+bY+c=0. If the differences of a, b, and c of multiple initial straight line segments are all less than a preset value, it can be determined that the multiple initial straight line segments can be merged, and it is determined whether the sum of the second laser points corresponding to the multiple initial straight line segments is greater than a first preset number. If so, it is considered that the second laser points corresponding to the multiple initial straight line segments are on a straight line segment.
[0082] For example, the expression of an initial straight line segment is: a 1 X+b 1 Y+c 1 =0, the expression of the other initial straight line segment is: a 2 X+b 2 Y+c 2 =0; if a 1 with a 2 The difference is less than the preset value, b 1 With b 2 The difference is less than the preset value, c 1 With c 2 If the difference is less than a preset value, it is determined that the two initial straight line segments meet the preset merging rule and the two initial straight line segments can be merged. If it is determined that the two initial straight line segments can be merged, it is determined whether the number of all second laser points corresponding to the mergeable initial straight line segments is greater than the first preset number; if it is greater, it is determined that all second laser points corresponding to the mergeable initial straight line segments are on a straight line segment.
[0083] If an initial straight line segment does not meet the preset merging rule, it can be directly determined whether the number of second laser points corresponding to the initial straight line segment is greater than the first preset number. If it is greater, the initial straight line segment is regarded as a straight line segment, and it is considered that the second laser points corresponding to the initial straight line segment are located on a straight line segment.
[0084] Sub-step S1252, traversing the determined third laser point, and judging whether the third laser point is on the straight line segment according to the correspondence between the identified straight line segment and the second laser point.
[0085] If the third laser point is not on the straight line segment, execute sub-step S1253.
[0086] Sub-step S1253, determining whether the distance difference between the second distance and the first distance is greater than a preset difference.
[0087] The first distance represents an average value of the distances between each third laser point and the target centroid, and the second distance represents the distance between the third laser point and the target centroid.
[0088] If the distance difference is greater than the preset difference, sub-step S1254 is executed.
[0089] Sub-step S1254: taking the third laser point as the fourth laser point.
[0090] If the third laser point is on the straight line segment, or the distance difference between the second distance and the first distance is not a preset difference, sub-step S1265 is executed.
[0091] Traverse the close-range points in the target set, that is, traverse the third laser point determined from the target set. For the traversed third laser point, determine whether the third laser point is on a straight line segment according to the correspondence between the straight line segment and the second laser point obtained in sub-step S1251. If the third laser point is on a straight line segment, skip it and directly determine not to use the third laser point as a fourth laser point.
[0092] If the third laser point is on a straight line segment, the second distance corresponding to the third laser point can be calculated, and then it can be determined whether the distance difference between the second distance and the first distance is greater than the preset difference. The second distance corresponding to the third laser point represents the distance between the third laser point and the target center of mass Pc calculated in the target coordinate system; the first distance Da represents the average value of the distance between each third laser point and the target center of mass Pc calculated in the target coordinate system. The above distance difference can be an absolute value, and the preset difference is greater than 0. It can be set in combination with actual needs. For example, the preset difference is 0.2 meters.
[0093] If the distance difference between the second distance and the first distance is greater than the preset difference, the third laser point is used as a fourth laser point. If the distance difference between the second distance and the first distance is not greater than the preset difference, the third laser point is not used as a fourth laser point.
[0094] Sub-step S126, calculating a ratio of a second number of the fourth laser points to a second total number of the third laser points as a second ratio.
[0095] Sub-step S127, determining whether the second ratio is greater than a second preset ratio.
[0096] If the second ratio is greater than the second preset ratio, sub-step S124 is executed.
[0097] Sub-step S124, determining that the laser radar is not covered.
[0098] If the second ratio is not greater than the second preset ratio, sub-step S128 is executed.
[0099] Sub-step S128, determining that the laser radar is covered.
[0100] After the traversal of the close-range points in the target set is completed, the number of the fourth laser points determined can be statistically obtained as the second number. And, the number of close-range points (i.e., the third laser points) in the target set can be statistically obtained as the second total number. Then, the ratio of the second number to the second total number is calculated as the second ratio, that is, the ratio of the second number to the total number of close-range points is calculated. If the second ratio is greater than the second preset ratio, it is determined that the scene is not covered by the laser radar; if the second ratio is not greater than the second preset ratio, it is determined that the scene is covered by the laser radar. The specific size of the second preset ratio can be set according to the actual situation, for example, it is set to 0.2.
[0101] When the scene recognition result obtained indicates that the scene covered by the laser radar is not detected, the initial positioning result obtained by the SLAM algorithm corresponding to the target laser frame can be used as the target positioning result.
[0102] When the scene recognition result obtained indicates that a scene covered by the laser radar is detected, the target positioning result is calculated based on the posture corresponding to the previous laser frame and the driving distance between the first moment corresponding to the previous laser frame and the second moment corresponding to the target laser frame. That is, the position in the posture corresponding to the previous laser frame is used as the starting point, the posture in the posture corresponding to the previous laser frame is used as the direction, and the driving distance from the first moment to the second moment is used as the length to determine an end point, which is the target positioning result. Among them, the driving distance is the movement amount obtained by the odometer for a period of time, and the starting point of this period of time is the first moment and the end point is the second moment. In this way, in the scene where the laser radar is covered, accurate positioning can still be provided for other modules.
[0103] Optionally, in this embodiment, when it is determined that the target laser frame is a laser frame obtained in a scene where the laser radar is covered, the laser frame can also be deleted when building the map to avoid poor mapping effect.
[0104] The above-mentioned positioning method provided in the embodiment of the present application can enable the sweeping robot to detect the scene where the laser radar is blocked by the soft cloth, and output the accurate positioning when the scene is identified, thereby solving the problem of inaccurate positioning when the initial positioning result obtained by the SLAM algorithm is directly used as the target positioning result in this scene, that is, avoiding the loss of correct positioning in this scene, and thus avoiding map overlap.
[0105] In order to execute the corresponding steps in the above embodiments and various possible methods, a method for implementing the positioning determination device 200 is given below. Optionally, the positioning determination device 200 can adopt the above Figure 4 The device structure of the electronic device 100 is shown. Fig.10 , Fig.10 A block diagram of a positioning determination device 200 provided in an embodiment of the present application. It should be noted that the basic principle and technical effects of the positioning determination device 200 provided in this embodiment are the same as those of the above-mentioned embodiments. For the sake of brief description, for parts not mentioned in this embodiment, reference can be made to the corresponding contents in the above-mentioned embodiments. In this embodiment, the positioning determination device 200 may include: a sampling module 210, an analysis module 220 and a positioning module 230.
[0106] The sampling module 210 is used to perform distance downsampling on the first laser points in the target laser frame according to the first preset distance and the distance between the two first laser points in the target laser frame to obtain a target set, wherein the laser points in the target laser frame are the first laser points.
[0107] The analysis module 220 is used to perform scene recognition according to the position distribution of the second laser points in the target set to obtain a scene recognition result. The laser points in the target set are the second laser points, and the scene recognition result is used to indicate whether the laser radar that obtains the target laser frame is covered.
[0108] The positioning module 230 is used to obtain the target positioning result corresponding to the target laser frame according to the positioning determination method corresponding to the scene recognition result. Different scene recognition results correspond to different positioning determination methods.
[0109] In this embodiment, the analysis module 220 is further used to determine whether the first total number of the second laser points in the target set is less than the second preset number. If the first total number is less than the second preset number, the positioning module 230 uses the initial positioning result obtained by the SLAM algorithm corresponding to the target laser frame as the target positioning result. If the first total number is not less than the second preset number, the analysis module 220 performs scene recognition according to the position distribution of the second laser points in the target set to obtain a scene recognition result.
[0110] In this embodiment, the analysis module 220 is also used to determine whether the positioning score corresponding to the initial positioning result obtained by the SLAM algorithm corresponding to a laser frame is less than a preset score; if the positioning score is less than the preset score, the laser frame is used as the target laser frame.
[0111] Optionally, the above modules can be stored in the form of software or firmware. Figure 4 The memory 110 shown in the figure may be fixed in the operating system (OS) of the electronic device 100 and may be Figure 4 Meanwhile, the data and program codes required for executing the above modules may be stored in the memory 110.
[0112] An embodiment of the present application further provides a readable storage medium having a computer program stored thereon, and when the computer program is executed by a processor, the positioning determination method is implemented.
[0113] In summary, the embodiments of the present application provide a positioning determination method, device, electronic device and readable storage medium. According to the first preset distance and the distance between the two laser points in the target laser frame, the laser points in the target laser frame are distance downsampled to obtain a target set; then, scene recognition is performed according to the position distribution of the laser points in the target set to obtain a scene recognition result indicating whether the laser radar that obtains the target laser frame is covered; finally, according to the positioning determination method corresponding to the scene recognition result, the target positioning result corresponding to the target laser frame is obtained, wherein the positioning determination methods corresponding to different scene recognition results are different. In this way, it is possible to identify whether the scene is covered by the laser radar, and determine the corresponding target positioning result in a corresponding manner based on the scene recognition result, thereby avoiding the positioning deviation caused by ignoring the scene and directly using the positioning result obtained by the SLAM algorithm as the target positioning result, and making it possible to obtain accurate positioning results when the scene is covered by the laser radar.
[0114] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present application. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, a program segment or a part of a code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0115] In addition, the functional modules in the various embodiments of the present application may be integrated together to form an independent part, or each module may exist separately, or two or more modules may be integrated to form an independent part.
[0116] If the functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present application can be essentially or partly embodied in the form of a software product that contributes to the prior art. The computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in each embodiment of the present application. The aforementioned storage medium includes: various media that can store program codes, such as a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk.
[0117] The above description is only an optional embodiment of the present application and is not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the protection scope of the present application.
Claims
1. A positioning determination method, characterized in that: The method comprises: According to a first preset distance and a distance between two first laser points in a target laser frame, distance downsampling is performed on the first laser point in the target laser frame to obtain a target set, wherein the laser point in the target laser frame is the first laser point; Performing scene recognition according to the position distribution of the second laser point in the target set to obtain a scene recognition result, wherein the laser point in the target set is the second laser point, and the scene recognition result is used to indicate whether the laser radar that obtains the target laser frame is covered; According to the positioning determination method corresponding to the scene recognition result, the target positioning result corresponding to the target laser frame is obtained, wherein different positioning determination methods correspond to different scene recognition results.
2. The method according to claim 1, characterized in that The performing scene recognition according to the position distribution of the second laser points in the target set to obtain a scene recognition result includes: From the target set, a second laser point whose distance from the target centroid is less than a third preset distance is determined as a third laser point, wherein the target centroid is the centroid of the second laser point in the target set whose distance from the laser radar is less than the second preset distance; Calculating a ratio of a first number of the third laser points to a first total number of the second laser points as a first ratio; Determining whether the first ratio is less than a first preset ratio; If the first ratio is less than the first preset ratio, it is determined that the laser radar is not blocked.
3. The method according to claim 2, characterized in that The performing scene recognition according to the position distribution of the second laser points in the target set to obtain a scene recognition result also includes: If the first ratio is not less than the first preset ratio, a fourth laser point is obtained from the determined third laser point, wherein the fourth laser point represents the third laser point indicating that the laser radar is not covered; calculating a ratio of a second number of the fourth laser points to a second total number of the third laser points as a second ratio; Determining whether the second ratio is greater than a second preset ratio; If the second ratio is greater than the second preset ratio, it is determined that the laser radar is not blocked; If the second ratio is not greater than the second preset ratio, it is determined that the laser radar is blocked.
4. The method according to claim 3, characterized in that Determining a fourth laser point from the target set includes: Performing straight line segment recognition on the target set, and determining a second laser point corresponding to each straight line segment; Traversing the determined third laser point, and judging whether the third laser point is on the straight line segment according to the correspondence between the identified straight line segment and the second laser point; If the third laser point is not on the straight line segment, determining whether the distance difference between the second distance and the first distance is greater than a preset difference, wherein the first distance represents an average value of the distances between each third laser point and the target centroid, and the second distance represents the distance between the third laser point and the target centroid; If the distance difference is greater than the preset difference, the third laser point is used as the fourth laser point.
5. The method according to claim 4, characterized in that The step of identifying straight line segments of the target set and determining a second laser point corresponding to each straight line segment includes: Perform straight line segment recognition based on the second laser point in the target set to obtain an initial straight line segment and a corresponding second laser point; The determined initial straight line segments are merged according to a preset merging rule to obtain each straight line segment and a corresponding second laser point, wherein the second laser point corresponding to each straight line segment includes the second laser point corresponding to the initial straight line segment corresponding to the straight line segment, and the number of the second laser points corresponding to each straight line segment is greater than a first preset number.
6. The method according to claim 1, characterized in that The method of performing distance downsampling on the first laser points in the target laser frame according to the first preset distance and the distance between the two first laser points in the target laser frame to obtain the target set includes: Traversing the first laser point in the target laser frame, determining whether the distance between the first laser point and the laser radar is within a preset distance range, wherein the preset distance range is used to indicate the detection range of the laser radar; If the distance between the first laser point and the laser radar is within the preset distance range and the initial set is empty, directly adding the first laser point to the initial set; If the distance between the first laser point and the laser radar is within the preset distance range and the initial set is not empty, the distance between the first laser point and the first laser point last added to the initial set is calculated, and if the calculated distance is not less than the first preset distance, the first laser point is added to the initial set, wherein the target set is the initial set obtained when the traversal of the target laser frame is completed.
7. The method according to any one of claims 1 to 6, characterized in that: The method further includes: determining whether a first total number of second laser points in the target set is less than a second preset number; if the first total number is less than the second preset number, taking the initial positioning result obtained by the real-time positioning and mapping SLAM algorithm corresponding to the target laser frame as the target positioning result; if the first total number is not less than the second preset number, performing scene recognition according to the position distribution of the second laser points in the target set to obtain a scene recognition result; and\or, The method for determining the positioning according to the scene recognition result obtains the target positioning result corresponding to the target laser frame, including: when the scene recognition result indicates that the laser radar is not covered, using the initial positioning result corresponding to the target laser frame obtained by the SLAM algorithm as the target positioning result; when the scene recognition result indicates that the laser radar is covered, calculating the target positioning result according to the posture corresponding to the previous laser frame and the driving distance between the first moment corresponding to the previous laser frame and the second moment corresponding to the target laser frame.
8. The method according to any one of claims 1 to 6, characterized in that: The method further comprises: Determine whether a positioning score corresponding to an initial positioning result obtained by the SLAM algorithm corresponding to a laser frame is less than a preset score; If the positioning score is less than the preset score, the laser frame is used as the target laser frame.
9. A positioning determination device, characterized in that: The device comprises: a sampling module, configured to perform distance downsampling on the first laser points in the target laser frame according to a first preset distance and a distance between two first laser points in the target laser frame, so as to obtain a target set, wherein the laser points in the target laser frame are the first laser points; an analysis module, configured to perform scene recognition according to the position distribution of the second laser point in the target set to obtain a scene recognition result, wherein the laser point in the target set is the second laser point, and the scene recognition result is used to indicate whether a laser radar that obtains the target laser frame is covered; The positioning module is used to obtain the target positioning result corresponding to the target laser frame according to the positioning determination method corresponding to the scene recognition result, wherein different scene recognition results correspond to different positioning determination methods.
10. An electronic device, characterized in that: It comprises a processor and a memory, wherein the memory stores machine executable instructions that can be executed by the processor, and the processor can execute the machine executable instructions to implement the positioning determination method described in any one of claims 1-8.
