Methods, chips, and robots for optimizing and fitting straight lines based on laser point cloud data.

By performing two rounds of least squares fitting and polar coordinate transformation on the laser point cloud data, the optimal fitted line was selected, which solved the problem of skewed and distorted lines in robot mapping and improved the mapping accuracy and reliability.

CN115113230BActive Publication Date: 2026-03-10AMICRO SEMICONDUCTOR CO LTD
View PDF 1 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-06-28
Publication Date
2026-03-10

AI Technical Summary

Technical Problem

When robots fit straight lines based on laser point cloud data in complex environments, skewness or distortion can easily occur, affecting the reliability of the mapping.

Method used

The least squares method was used to perform two rounds of straight line fitting on the initial laser point cloud data. After converting to polar coordinates, the optimal fitted line was selected, and the fitted line was optimized by the angle difference and the comparison length.

Benefits of technology

This improves the accuracy and reliability of the fitted straight line, ensuring the accuracy of robot mapping.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115113230B_ABST
    Figure CN115113230B_ABST
Patent Text Reader

Abstract

This invention provides a method, chip, and robot for optimizing fitted lines based on laser point cloud data. The method includes: Step 1: Using the least squares method to perform linear fitting on the initial laser point cloud data, obtaining N fitted lines; Step 2: Obtaining and recording the fitted laser point cloud data corresponding to the N fitted lines; Step 3: Using the least squares method to perform linear fitting on the fitted laser point cloud data, obtaining M fitted lines; Step 4: Selecting the optimal fitted line from the M fitted lines to complete the optimization of the fitted line. This invention optimizes and selects fitted lines obtained based on laser point cloud data, improving the reliability of the fitted lines obtained using laser point cloud data, thereby avoiding situations where distortions in the laser point cloud data can cause the fitted lines to become skewed, affecting the reliability of robot mapping.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of robot mapping technology, specifically to a method, chip, and robot for optimizing and fitting straight lines based on laser point cloud data. Background Technology

[0002] With the development of robotics technology, various types of robots are widely used in all aspects of daily life. Currently, robots generally use laser point cloud data acquired by LiDAR sensors to build maps. However, due to the complexity of the robot's environment, directly using laser point cloud data for straight line fitting can easily lead to skewed or distorted lines in the map, affecting the reliability of robot mapping. How to optimize the fitting of straight lines based on laser point cloud data has become a problem to be solved. Summary of the Invention

[0003] To address the aforementioned problems, this invention provides a method, chip, and robot for optimizing fitted straight lines based on laser point cloud data. This enables multiple optimizations of the fitted straight lines based on laser point cloud data, thereby avoiding a decrease in robot mapping reliability due to skewed or distorted fitted lines, effectively optimizing the fitted straight lines, and improving the robot's mapping accuracy. The specific technical solution of this invention is as follows:

[0004] The method for optimizing fitted lines based on laser point cloud data includes: Step 1: Using the least squares method to perform line fitting on the initial laser point cloud data to obtain N fitted lines; Step 2: Obtaining and recording the fitted laser point cloud data corresponding to the N fitted lines; Step 3: Using the least squares method to perform line fitting on the fitted laser point cloud data to obtain M fitted lines; Step 4: Selecting the optimal fitted line from the M fitted lines to complete the optimization of the fitted line; where N is an integer greater than 0, and M is an integer less than or equal to M.

[0005] Furthermore, the method for optimizing and fitting a straight line based on laser point cloud data further includes: before performing step 1, acquiring initial laser point cloud data and converting the initial laser point cloud data from a Cartesian coordinate system to a polar coordinate system.

[0006] Furthermore, the acquisition of initial laser point cloud data specifically includes: acquiring the x-axis coordinate in a Cartesian coordinate system corresponding to the initial laser point cloud data; acquiring the y-axis coordinate in a Cartesian coordinate system corresponding to the initial laser point cloud data; and acquiring the angle between the lidar and the obstacle corresponding to the initial laser point cloud data.

[0007] Furthermore, the conversion of the initial laser point cloud data from a Cartesian coordinate system to a polar coordinate system specifically includes: calculating the angle formed by the line connecting the initial laser point cloud data coordinate point to the origin and the x-axis based on the x-axis and y-axis coordinates in the Cartesian coordinate system of the acquired initial laser point cloud data; calculating the distance between the initial laser point cloud data coordinate point and the origin based on the x-axis and y-axis coordinates in the Cartesian coordinate system of the acquired initial laser point cloud data; using the angle formed by the line connecting the initial laser point cloud data coordinate point to the origin and the x-axis as the angular coordinate of the initial laser point cloud data in the polar coordinate system; and using the distance between the initial laser point cloud data coordinate point and the origin as the radius coordinate of the initial laser point cloud data in the polar coordinate system.

[0008] Further, step 3 specifically includes: storing the M fitted lines into the optimal fitted line candidate set; obtaining the angle difference of each fitted line in the optimal fitted line candidate set; obtaining the comparison length of each fitted line in the optimal fitted line candidate set; and selecting an optimal fitted line from the M fitted lines based on the angle difference and comparison length of each fitted line in the optimal fitted line candidate set.

[0009] Furthermore, obtaining the angle difference value of each fitted line in the candidate set of optimal fitted lines specifically includes: selecting a fitted line from the candidate set of optimal fitted lines for which no angle difference value has been obtained as the current candidate line; traversing and calculating the angle difference between the current candidate line and other fitted lines in the candidate set of optimal fitted lines; taking the sum of the angle differences between the current candidate line and other fitted lines in the candidate set of optimal fitted lines as the angle difference value of the current candidate line; repeating the above steps until there are no fitted lines in the candidate set of optimal fitted lines for which no angle difference value has been obtained.

[0010] Furthermore, step 2 also includes: obtaining the starting point coordinates and ending point coordinates of each of the N fitted lines.

[0011] Further, obtaining the comparison length of each fitted line in the optimal fitted line candidate set specifically includes: selecting a fitted line from the optimal fitted line candidate set whose comparison length has not been obtained as the current candidate line, and obtaining the length of the current candidate line based on the starting point coordinates and ending point coordinates of the current candidate line; obtaining the reference projection value of each fitted line in the optimal fitted line candidate set other than the current candidate line and the current candidate line; taking the sum of the reference projection value of each fitted line in the optimal fitted line candidate set other than the current candidate line and the length of the current candidate line as the comparison length of the current candidate line; repeating the above steps until there are no fitted lines in the optimal fitted line candidate set whose comparison length has not been obtained.

[0012] Further, the method for obtaining the reference projection value of the fitted line and the current candidate line specifically includes: obtaining the first projection value of the fitted line in the direction of the current candidate line; obtaining the second projection value of the fitted line in the direction at a 90-degree angle to the current candidate line; determining the relationship between the first projection value and the second projection value of the fitted line; if the first projection value of the fitted line is greater than the second projection value of the fitted line, then the product of the first projection value of the fitted line and a preset parameter is used as the reference projection value of the fitted line and the current candidate line; if the first projection value of the fitted line is less than the second projection value of the fitted line, then the product of the second projection value of the fitted line and a preset parameter is used as the reference projection value of the fitted line and the current candidate line; if the first projection value of the fitted line is equal to the second projection value of the fitted line, then the product of the first or second projection value of the fitted line and a preset parameter is used as the reference projection value of the fitted line and the current candidate line.

[0013] Furthermore, the step of selecting an optimal fitting line from M fitting lines based on the angle difference and comparison length of each fitting line in the optimal fitting line candidate set specifically includes: traversing and judging whether the angle difference of each fitting line in the optimal fitting line candidate set is greater than the angle difference threshold; if the angle difference of the fitting line is greater than the angle difference threshold, then the fitting line is removed from the optimal fitting line candidate set; after the traversal and judgment are completed, a first optimal fitting line candidate set is obtained; and the fitting line with the longest comparison length in the first optimal fitting line candidate set is selected as the optimal fitting line.

[0014] The present invention also discloses a chip that internally stores a computer program, which, when executed by a processor, implements the steps of the method for optimizing and fitting a straight line based on laser point cloud data as described above.

[0015] The present invention also discloses a robot, comprising: a processor, a chip, and a lidar, wherein the lidar is used to acquire laser point cloud data, and the processor executes a computer program stored inside the chip to implement the steps of the method for optimizing and fitting a straight line based on the laser point cloud data as described above.

[0016] The beneficial effects of this invention are as follows: by optimizing the fitting of the fitted straight line of laser point cloud data through refitting and secondary screening, the accuracy of the fitted straight line can be effectively improved, the problem of skewness or distortion of the fitted straight line based on laser point cloud data in complex environments can be solved, and the reliability of fitting straight lines using laser point cloud data can be improved. Attached Figure Description

[0017] Figure 1 This is a flowchart illustrating a method for optimizing and fitting a straight line based on laser point cloud data, according to an embodiment of the present invention. Detailed Implementation

[0018] To make the objectives, technical solutions, and advantages of this application clearer, the application is described and illustrated below with reference to the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are merely illustrative and not intended to limit the scope of this application. All other embodiments obtained by those skilled in the art based on the embodiments provided in this application without inventive effort are within the scope of protection of this application.

[0019] Obviously, the accompanying drawings described below are merely some examples or embodiments of this application. Those skilled in the art can apply this application to other similar scenarios based on these drawings without any creative effort. Furthermore, it is understood that although the efforts made in this development process may be complex and lengthy, for those skilled in the art related to the content disclosed in this application, any changes to the design, manufacturing, or production based on the technical content disclosed in this application are merely conventional technical means and should not be construed as insufficient disclosure of the content of this application.

[0020] Unless otherwise defined, the technical or scientific terms used in this application shall have the ordinary meaning understood by one of ordinary skill in the art to which this application pertains. The terms “a,” “an,” “an,” “the,” and similar words used in this application do not indicate quantity limitation and may represent singular or plural. The terms “comprising,” “including,” “having,” and any variations thereof used in this application are intended to cover non-exclusive inclusion. For example, a process, method, system, product, or apparatus that includes a series of steps or modules is not limited to the listed steps or units but may also include steps or units not listed, or may include other steps or units inherent to such processes, methods, products, or apparatus. The terms “first,” “second,” and “third” used in this application are merely to distinguish similar objects and do not represent a specific ordering of objects.

[0021] With the rapid development of science and technology, the cost of LiDAR has decreased significantly, leading to a surge in its commercial applications. LiDAR possesses advantages such as good monochromaticity, high brightness, strong directionality, strong anti-interference capability, high resolution, and small and lightweight equipment, making it widely used in robot localization. However, during LiDAR applications, the complexity of the environment may cause distortion in the acquired laser point cloud data, resulting in skewed straight lines fitted based on the laser point cloud data, affecting the accuracy of robot mapping. To address this issue, this application proposes a method for optimizing fitted straight lines based on laser point cloud data. This method optimizes the fitted straight lines based on the laser point cloud data to eliminate distortions in the laser point cloud data.

[0022] As a preferred embodiment of this application, the first embodiment of the present invention provides a method for optimizing and fitting a straight line based on laser point cloud data, such as... Figure 1 The method specifically includes:

[0023] Step 1: Use the least squares method to perform linear fitting on the initial laser point cloud data to obtain N fitted lines. The least squares method is a mathematical optimization technique that finds the best function match for the data by minimizing the sum of squared errors. This step uses the least squares method to perform linear fitting on the initial laser point cloud data in order to adjust the data that may be distorted in the initial laser point cloud data and minimize the error of the initial laser point cloud data.

[0024] Step 2: Obtain and record the fitted laser point cloud data corresponding to the N fitted lines. This step extracts the fitted laser point cloud data from the fitted lines. Essentially, this step involves obtaining the initial laser point cloud data optimized using the least squares method. The method for recording the fitted laser point cloud data corresponding to the N fitted lines can be, but is not limited to, numbering each fitted laser point cloud data point and recording both the data point and its corresponding number together, so that the fitted laser point cloud data can be indexed later using the number.

[0025] Step 3: Use the least squares method to fit straight lines to the fitted laser point cloud data and obtain M fitted straight lines; In this step, the least squares method is used again to optimize the fitted laser point cloud data by utilizing the optimization function of the least squares method.

[0026] Step 4: Select the optimal fitting line from the M fitted lines to complete the optimization of the fitted line. This step selects only one optimal fitting line from the M fitted lines to ensure that the fitted line obtained based on the laser point cloud data has the highest accuracy and is the fitted line with the best optimization effect. It should be noted that N is an integer greater than 0, and M is an integer less than or equal to M.

[0027] This embodiment performs two rounds of correction on the initial laser point cloud data and selects the optimal fitting line from the fitted lines after the two rounds of correction, thereby improving the accuracy of the fitted line obtained based on the laser fitting data and ensuring the reliability of the robot's mapping based on the fitted line.

[0028] Based on the above embodiments, as a preferred embodiment of the present invention, in the second embodiment, the method for optimizing the fitted line based on laser point cloud data can further utilize the least squares method to perform multiple rounds of optimization on the laser point cloud data before selecting the optimal fitted line. Specifically, the method for optimizing the fitted line based on laser point cloud data includes:

[0029] First round of optimization: Use the least squares method to perform line fitting on the initial laser point cloud data, obtain A fitted lines, and obtain and record the first fitted laser point cloud data corresponding to the A fitted lines.

[0030] Second round of optimization: Use the least squares method to perform linear fitting on the first fitted laser point cloud data to obtain B fitted lines, and obtain and record the corresponding second fitted laser point cloud data in the B fitted lines.

[0031] Similarly, the optimization is repeated until the Nth round of optimization, until the N fitted lines obtained in the Nth round of optimization meet the preset optimization termination condition. Then, the N fitted lines obtained in the Nth round of optimization are filtered to select the best fitted line and end the optimization of the fitted line.

[0032] The preset optimization termination condition can be, but is not limited to, reaching a specified number of optimization rounds. For example, after the Nth round of optimization, the least squares method fitting is terminated, and the N-round fitting lines obtained from the Nth round of optimization are filtered to obtain the optimal fitting line; or it can be set to achieve the target fitting optimization effect, etc.

[0033] The method for optimizing and fitting straight lines based on laser point cloud data provided in this embodiment can perform multiple rounds of iterative optimization and refitting of laser point cloud data to effectively minimize the error of the laser point cloud data and improve the reliability of the fitted straight line. By adjusting the preset optimization termination condition, the number of optimization rounds and the optimization effect achieved can be pre-adjusted to better meet the needs of various users and application scenarios.

[0034] Based on the above embodiments, as a preferred embodiment of the present invention, in the third embodiment of the present invention, the method for optimizing and fitting a straight line based on laser point cloud data further includes: before performing step 1, acquiring initial laser point cloud data and converting the initial laser point cloud data from a Cartesian coordinate system to a polar coordinate system. The method of acquiring the initial laser point cloud data may include, but is not limited to: acquiring the x-axis coordinate in the Cartesian coordinate system corresponding to the initial laser point cloud data; acquiring the y-axis coordinate in the Cartesian coordinate system corresponding to the initial laser point cloud data; and acquiring the angle between the lidar and the obstacle corresponding to the initial laser point cloud data.

[0035] In some embodiments of this application, the means of converting the initial laser point cloud data from a Cartesian coordinate system to a polar coordinate system may include, but is not limited to, the following: calculating the angle formed by the line connecting the initial laser point cloud data coordinate point to the origin and the x-axis based on the x-axis and y-axis coordinates in the Cartesian coordinate system of the acquired initial laser point cloud data; calculating the distance between the initial laser point cloud data coordinate point and the origin based on the x-axis and y-axis coordinates in the Cartesian coordinate system of the acquired initial laser point cloud data; using the angle formed by the line connecting the initial laser point cloud data coordinate point to the origin and the x-axis as the angular coordinate of the initial laser point cloud data in the polar coordinate system; and using the distance between the initial laser point cloud data coordinate point and the origin as the radius coordinate of the initial laser point cloud data in the polar coordinate system.

[0036] Based on the above embodiments, as a preferred embodiment of the present invention, the method for optimizing and fitting lines based on laser point cloud data using the least squares method to obtain M fitted lines specifically includes: storing the M fitted lines in a candidate set of optimal fitted lines; obtaining the angle difference of each fitted line in the candidate set of optimal fitted lines; obtaining the comparison length of each fitted line in the candidate set of optimal fitted lines; and selecting an optimal fitted line from the M fitted lines based on the angle difference and comparison length of each fitted line in the candidate set of optimal fitted lines. The angle difference of the fitted line is used to show the difference in angle between the fitted line and the other fitted lines. The larger the angle difference between the fitted line and the other fitted lines, the larger the angle difference of the fitted line. This embodiment selects the optimal fitted line from the candidate set of optimal fitted lines by comprehensively considering the angle difference and comparison length of the fitted lines, thus completing the optimization and selection of fitted lines based on laser point cloud data, obtaining the optimal fitted line, and ensuring excellent accuracy of subsequent mapping results using the fitted line.

[0037] Based on the above embodiments, as a preferred embodiment of the present invention, the method for optimizing fitted lines based on laser point cloud data provided in the fourth embodiment of the present invention, specifically includes obtaining the angle difference value of each fitted line in the optimal fitted line candidate set, which specifically includes: selecting a fitted line from the optimal fitted line candidate set that has not obtained an angle difference value as the current candidate line; traversing and calculating the angle difference between the current candidate line and other fitted lines in the optimal fitted line candidate set; taking the sum of the angle differences between the current candidate line and other fitted lines in the optimal fitted line candidate set as the angle difference value of the current candidate line; repeating the above steps until there are no fitted lines in the optimal fitted line candidate set that have not obtained angle differences. The method for calculating the angle difference between the current candidate line and other fitted lines in the optimal fitted line candidate set can be, but is not limited to, using the method of calculating the slope difference between two lines, or other methods capable of calculating the angle difference between fitted lines. This embodiment obtains the angle difference between each fitted line in the candidate set of optimal fitted lines and the remaining fitted lines in the candidate set of optimal fitted lines. This allows for the selection of each fitted line in the candidate set of optimal fitted lines based on the angle difference, eliminating fitted lines whose angle difference does not meet expectations, reducing the number of fitted lines in the candidate set of optimal fitted lines, and thus narrowing the selection range of optimal fitted lines.

[0038] Based on the above embodiments, as a preferred embodiment of the present invention, the fifth embodiment of the present invention provides a method for optimizing fitted lines based on laser point cloud data. Step 2 includes, in addition to acquiring and recording the fitted laser point cloud data corresponding to the N fitted lines, acquiring the starting point coordinates and ending point coordinates of each of the N fitted lines. In this embodiment, acquiring the starting point coordinates and ending point coordinates of each fitted line facilitates the acquisition of the length of each fitted line.

[0039] Based on the above embodiments, as a preferred embodiment of the present invention, the sixth embodiment of the present invention provides a method for optimizing fitted lines based on laser point cloud data. The step of obtaining the comparison length of each fitted line in the optimal fitted line candidate set specifically includes: selecting a fitted line from the optimal fitted line candidate set whose comparison length has not been obtained as the current candidate line, and obtaining the length of the current candidate line based on the coordinates of its starting and ending points; obtaining the reference projection value of each fitted line in the optimal fitted line candidate set other than the current candidate line and the current candidate line; using the sum of the reference projection value of each fitted line in the optimal fitted line candidate set other than the current candidate line and the length of the current candidate line as the comparison length of the current candidate line; repeating the above steps until there are no fitted lines in the optimal fitted line candidate set whose comparison length has not been obtained. The method for obtaining the length of the current candidate line based on the coordinates of its starting and ending points may be, but is not limited to, obtaining it by calculating the distance between the starting and ending points. This embodiment obtains the reference projection values ​​of each fitted line and the remaining fitted lines in the optimal fitted line candidate set, and uses the sum of the reference projection values ​​of each fitted line and the remaining fitted lines in the optimal fitted line candidate set and its own fitted line length as its comparison length. This realizes that the difference between the fitted line and the remaining fitted lines is used as a screening factor to select the fitted line with small difference and small distortion possibility as the optimal fitted line.

[0040] In some preferred embodiments of this application, the method for obtaining the reference projection value of the fitted line and the current candidate line specifically includes: obtaining a first projection value of the fitted line in the direction of the current candidate line; obtaining a second projection value of the fitted line in the direction at a 90-degree angle to the current candidate line; determining the relationship between the first projection value and the second projection value of the fitted line; if the first projection value of the fitted line is greater than the second projection value, then the product of the first projection value of the fitted line and a preset parameter is used as the reference projection value of the fitted line and the current candidate line; if the first projection value of the fitted line is less than the second projection value, then the product of the second projection value of the fitted line and the preset parameter is used as the reference projection value of the fitted line and the current candidate line; if the first projection value of the fitted line is equal to the second projection value, then the product of the first or second projection value of the fitted line and the preset parameter is used as the reference projection value of the fitted line and the current candidate line. The preset parameter is a pre-set multiple used to expand the projection value, and the preset parameter can be, but is not limited to, 0.5, 1, 2, 5, 10, 15, or 100. These embodiments compare the projection values ​​in different directions and select the larger values ​​to obtain the reference projection value of the fitted line, thereby quantifying the maximum difference between the projection of the fitted line and the projection of other fitted lines.

[0041] Based on the above embodiments, as a preferred embodiment of the present invention, the method for optimizing fitted lines based on laser point cloud data provided in the seventh embodiment of the present invention, wherein selecting an optimal fitted line from M fitted lines based on the angle difference and comparison length of each fitted line in the optimal fitted line candidate set, specifically includes: traversing and judging whether the angle difference of each fitted line in the optimal fitted line candidate set is greater than an angle difference threshold; if the angle difference of the fitted line is greater than the angle difference threshold, then removing that fitted line from the optimal fitted line candidate set; after traversing and judging, a first optimal fitted line candidate set is obtained; and selecting the fitted line with the longest comparison length from the first optimal fitted line candidate set as the optimal fitted line. This embodiment first uses the angle difference of each fitted line to remove some fitted lines from the optimal fitted line candidate set, and then analyzes the comparison length in the optimal fitted line candidate set to achieve the best among the best, achieving a better fitting line optimization effect and effectively improving the accuracy of the fitted line.

[0042] Based on the above embodiments, a preferred embodiment of the present invention provides a chip that internally stores a computer program. When the computer program is run by a processor, it implements the steps of the method for optimizing and fitting a straight line based on laser point cloud data as described in any of the preceding embodiments.

[0043] Based on the above embodiments, a preferred embodiment of the present invention provides a robot, which includes a processor, a chip, and a lidar. The lidar is used to acquire laser point cloud data. When the processor executes the computer program stored inside the chip, it implements the steps of the method for optimizing and fitting a straight line based on laser point cloud data as described in any of the preceding embodiments.

[0044] It should be noted that, in this document, the terms "comprising," "including," or any other variations thereof are intended to cover non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements includes not only those elements but also other elements not expressly listed, or elements inherent to such a process, method, article, or system. Unless otherwise specified, an element defined by the phrase "comprising one..." does not exclude the presence of other identical elements in the process, method, article, or system that includes that element.

[0045] The sequence numbers of the above embodiments of the present invention are for descriptive purposes only and do not represent the superiority or inferiority of the embodiments.

[0046] Through the above description of the embodiments, those skilled in the art can clearly understand that the methods of the above embodiments can be implemented by means of software plus necessary general-purpose hardware platforms. Of course, they can also be implemented by hardware, but in many cases the former is a better implementation method. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product is stored in a storage medium (such as ROM / RAM, magnetic disk, optical disk) as described above, and includes several instructions to cause a terminal device (which may be a laser robot, etc.) to execute the methods described in the various embodiments of the present invention.

[0047] The above are merely preferred embodiments of the present invention and do not limit the patent scope of the present invention. Any equivalent structural or procedural transformations made based on the content of the present invention's specification and drawings, or direct or indirect applications in other related technical fields, are similarly included within the patent protection scope of the present invention.

Claims

1. A method for optimizing fitting a straight line based on laser point cloud data, characterized in that, The method for optimizing and fitting a straight line based on laser point cloud data comprises the following steps: Step 1: using the least square method to fit a straight line to the initial laser point cloud data, and obtaining N fitted straight lines; Step 2: obtaining and recording the corresponding fitted laser point cloud data in the N fitted straight lines; Step 3: using the least square method to fit a straight line to the fitted laser point cloud data, and obtaining M fitted straight lines; Step 4: selecting one optimal fitted straight line from the M fitted straight lines to complete the optimization of the fitted straight line; wherein N is an integer greater than 0, and M is an integer less than or equal to M; wherein the step 4 specifically comprises the following steps: storing the M fitted straight lines into an optimal fitted straight line candidate set; obtaining the angle difference value of each fitted straight line in the optimal fitted straight line candidate set; obtaining the comparison length of each fitted straight line in the optimal fitted straight line candidate set; selecting one optimal fitted straight line from the M fitted straight lines based on the angle difference value and the comparison length of each fitted straight line in the optimal fitted straight line candidate set.

2. The method of claim 1, wherein, The method for optimizing and fitting a straight line based on laser point cloud data further comprises the following steps: before performing the step 1, obtaining the initial laser point cloud data, and converting the initial laser point cloud data from a rectangular coordinate system to a polar coordinate system.

3. The method of claim 2, wherein, The method for obtaining the initial laser point cloud data specifically comprises the following steps: obtaining the x-axis coordinate of the initial laser point cloud data in the rectangular coordinate system; obtaining the y-axis coordinate of the initial laser point cloud data in the rectangular coordinate system; obtaining the angle between the laser radar and the obstacle corresponding to the initial laser point cloud data.

4. The method of claim 3, wherein, The method for converting the initial laser point cloud data from the rectangular coordinate system to the polar coordinate system specifically comprises the following steps: calculating the included angle between the line connecting the coordinate point of the initial laser point cloud data and the origin and the x-axis based on the obtained x-axis coordinate and y-axis coordinate of the initial laser point cloud data in the rectangular coordinate system; calculating the distance between the coordinate point of the initial laser point cloud data and the origin based on the obtained x-axis coordinate and y-axis coordinate of the initial laser point cloud data in the rectangular coordinate system; taking the included angle between the line connecting the coordinate point of the initial laser point cloud data and the origin and the x-axis as the angular coordinate of the initial laser point cloud data in the polar coordinate system; taking the distance between the coordinate point of the initial laser point cloud data and the origin as the radial coordinate of the initial laser point cloud data in the polar coordinate system.

5. The method of claim 4, wherein, The method for obtaining the angle difference value of each fitted straight line in the optimal fitted straight line candidate set specifically comprises the following steps: selecting one fitted straight line without the angle difference value from the optimal fitted straight line candidate set as a current candidate line; iteratively calculating the angle difference between the current candidate line and other fitted straight lines in the optimal fitted straight line candidate set; taking the sum of the angle differences between the current candidate line and other fitted straight lines in the optimal fitted straight line candidate set as the angle difference value of the current candidate line; repeating the above steps until there is no fitted straight line without the angle difference value in the optimal fitted straight line candidate set.

6. The method of claim 5, wherein, The step 2 further comprises the following steps: obtaining the starting point coordinate and the ending point coordinate of each fitted straight line in the N fitted straight lines.

7. The method of claim 6, wherein, The method for obtaining the comparison length of each fitted straight line in the optimal fitted straight line candidate set specifically comprises the following steps: selecting a fitting straight line without the comparison length from the set of optimal fitting straight line candidates as a current candidate line, and obtaining the length of the current candidate line based on the starting point coordinate and the ending point coordinate of the current candidate line; obtaining the reference projection value of each fitting straight line in the set of optimal fitting straight line candidates other than the current candidate line relative to the current candidate line; taking the sum of the reference projection value of each fitting straight line in the set of optimal fitting straight line candidates other than the current candidate line relative to the current candidate line and the length of the current candidate line as the comparison length of the current candidate line; repeating the above steps until there is no fitting straight line without the comparison length in the set of optimal fitting straight line candidates.

8. The method of claim 7, wherein, The method for obtaining the reference projection value of the fitting straight line relative to the current candidate line specifically comprises: obtaining a first projection value of the fitting straight line in the direction of the current candidate line; obtaining a second projection value of the fitting straight line in the direction perpendicular to the current candidate line; judging the size relationship between the first projection value of the fitting straight line and the second projection value of the fitting straight line; if the first projection value of the fitting straight line is greater than the second projection value of the fitting straight line, taking the product of the first projection value of the fitting straight line and a preset parameter as the reference projection value of the fitting straight line relative to the current candidate line; if the first projection value of the fitting straight line is less than the second projection value of the fitting straight line, taking the product of the second projection value of the fitting straight line and the preset parameter as the reference projection value of the fitting straight line relative to the current candidate line; if the first projection value of the fitting straight line is equal to the second projection value of the fitting straight line, taking the product of the first projection value or the second projection value of the fitting straight line and the preset parameter as the reference projection value of the fitting straight line relative to the current candidate line.

9. The method of claim 5, wherein, The method for screening one optimal fitting straight line from the M fitting straight lines based on the angle difference value and the comparison length of each fitting straight line in the set of optimal fitting straight line candidates specifically comprises: iteratively judging whether the angle difference value of each fitting straight line in the set of optimal fitting straight line candidates is greater than the angle difference value threshold, and if the angle difference value of the fitting straight line is greater than the angle difference value threshold, the fitting straight line is removed from the set of optimal fitting straight line candidates, and after the iterative judgment, a first set of optimal fitting straight line candidates is obtained; selecting the fitting straight line with the longest comparison length from the first set of optimal fitting straight line candidates as the optimal fitting straight line.

10. A chip internally storing a computer program, characterized by The computer program is run by the processor to implement the steps of the method for optimizing the fitting straight line based on the laser point cloud data according to any one of claims 1 to 9.

11. A robot comprising: The processor, the chip and the laser radar are characterized in that the laser radar is used to obtain the laser point cloud data, and the processor executes the computer program stored in the chip to implement the steps of the method for optimizing the fitting straight line based on the laser point cloud data according to any one of claims 1 to 9.

Citation Information

Patent Citations

  • Constraint-based three-dimensional straight line fitting method

    CN114638955A