US-12625267-B2 - Plane detection method and device based on laser sensor
Abstract
A plane detection method and device based on a laser sensor are disclosed. The method includes: acquiring data of the laser sensor after starting detection; inputting the data into a detection model trained in advance, wherein the detection model is obtained by training with data corresponding to a medium type selected in advance and is capable of recognizing the medium type selected; judging whether an object to which the data belongs is a plane, and if the object is a plane, determining the medium type of the plane; and setting corresponding optimization methods for different medium types, and optimizing the data according to the medium type. The laser sensor recognizes the medium type by the machine learning model, and optimizes the two-dimensional laser data according to the recognition results, and thus forms a more refined map and performs more accurate positioning based on the two-dimensional laser data.
Inventors
- Yue NING
- Yifan Zhang
- Libing Zou
- Fuqiang Zhang
Assignees
- GOERTEK INC.
Dates
- Publication Date
- 20260512
- Application Date
- 20201024
- Priority Date
- 20191125
Claims (7)
- 1 . A robot, comprising: a processor; a laser sensor; and a memory arranged to store computer executable instructions, wherein the processor performs the following processing: acquiring data by the laser sensor after starting detection; inputting the data into a detection model trained in advance, wherein the detection model is obtained by training with data corresponding to a medium type selected in advance for recognizing the medium type selected; judging, by the detection model, whether an object to which the data belongs is a plane, and if the object is a plane, determining the medium type of the plane, otherwise eliminating the object; and setting corresponding optimization manners for different medium types, optimizing the data according to the medium type, and performing positioning or mapping of robots using the optimized data, wherein the medium type includes any one of the following: a mirror-like medium, a non-black metal medium, a black medium, and other conventional media, optimizing the data according to the medium type comprises: if the medium type is a mirror-like medium or a non-black metal medium, performing median filtering on corresponding data, so that the corresponding data tends to be flat; if the medium type is a black medium, inserting missing data points in corresponding data according to an arithmetic sequence; if the medium type is other conventional media, increasing data point density in corresponding data using a nearest neighbor resampling method, wherein the processor obtains the detection model by training through the following processing: using the laser sensor to collect laser point data corresponding to a medium type selected in advance; grouping and labeling the laser point data, and forming sample sets by groups of data, wherein a label added includes at least the following information: whether an object to which a sample belongs is a plane, and a medium type of a plane; and constructing a detection model based on an xgboost algorithm, and using the xgboost algorithm to generate a decision tree for detecting the medium type according to the sample sets, and training the detection model using the sample sets.
- 2 . The robot of claim 1 , wherein the processor groups the laser point data through the following processing: grouping the laser point data according to a preset number of points, and taking each data of the preset number of points as a sample; taking a first point in each sample as a coordinate origin, calculating local coordinate values of remaining points in the sample, and storing the local coordinate values in an array; and determining a farthest distance between points in the sample according to the array, and if the farthest distance exceeds a distance threshold, discarding the sample, otherwise selecting the sample to form a sample set.
- 3 . The robot according to claim 2 , wherein the processor further performs the following processing: calculating a mean value and a variance of all abscissa values and ordinate values in the sample, taking the mean value and the variance as data features, and storing them in the array.
- 4 . The robot of claim 1 , wherein the processor trains the detection model using the sample sets through the following processing: dividing the sample sets into a training set and a testing set, dividing the training set into multiple groups, training one group of training set, and then using the testing set to test; if accuracy of a test result is lower than an accuracy threshold, analyzing a label and laser point data of each sample in the group of training set, and judging whether a data feature of the laser point data is consistent with the medium type in the label; if it is consistent, keeping the sample, otherwise eliminating the sample until the group of training set satisfy an accuracy requirement; adding one or more subsequent groups of training set and merging, then continuing training.
- 5 . The robot according to claim 4 , wherein the processor further performs the following processing: if accuracy of a test result currently obtained is lower than the accuracy threshold, keeping a group of training set whose test result has an accuracy higher than the accuracy threshold, only analyzing data of one or more groups of training set added subsequently, and eliminating inconsistent samples in the groups of training sets added subsequently.
- 6 . The robot according to claim 4 , wherein the accuracy threshold is set to 90%.
- 7 . The robot according to claim 4 , wherein the processor further performs the following processing: with respect to data of other conventional media wall, confirming whether the data is neatly and evenly distributed on a straight line; with respect to data of a black medium wall, analyzing whether the data satisfies a corresponding sparseness requirement; with respect to data of a mirror-like medium and a metal medium, analyzing whether their tortuosity and distribution conform to their predetermined laws.
Description
CROSS-REFERENCE TO RELATED APPLICATION This Application is a U.S. National-Stage entry under 35 U.S.C. § 371 based on International Application No. PCT/CN2020/123466, filed Oct. 24, 2020 which was published under PCT Article 21(2) and which claims priority to Chinese Application No. 201911166056.3, filed Nov. 25, 2019, which are all hereby incorporated herein in their entirety by reference. TECHNICAL FIELD This Application pertains to the field of machine learning, and in particular to a plane detection method and device based on a laser sensor, an electronic apparatus and a readable storage medium. BACKGROUND With the thriving of robots and autonomous driving, issues such as simultaneous localization and mapping (SLAM) of robots have attracted more and more attention. The laser sensor is currently the main sensor that can be used to solve the problem. Compared with ordinary rangefinders, they have the merits of fast speed, long distance, and relatively high accuracy. When positioning with laser, the accuracy and frequency of laser output have significant impact on the positioning accuracy, but the performance of laser is not so satisfactory when dealing with special materials and special-shaped surfaces. The single line laser sensor generates laser data frame by frame through the continuous transmission and reception of a laser transmitter and a receiver. Ideally, by calculating the time difference between transmitting and receiving laser, the distance of the obstacle in the angle can be obtained; however, some lasers will not be received by the receiver due to angle problems, and the distance measured by some will fluctuate due to the diffuse reflection of light. In actual use, the reflection of walls made of different media is not the same, so even if the wall is originally flat, it may be an uneven surface in the laser data. This problem will cause the map generated by the laser SLAM not to match with the actual map. In addition, other objects, desirable features and characteristics will become apparent from the subsequent summary and detailed description, and the appended claims, taken in conjunction with the accompanying drawings and this background. SUMMARY In view of the above problems, the present disclosure is proposed to provide a plane detection method and device based on a laser sensor, an electronic apparatus and a readable storage medium that can overcome or at least partially solve the above problems. According to an aspect of the present disclosure, a plane detection method based on a laser sensor is provided. The method comprises: acquiring data of the laser sensor after starting detection;inputting the data into a detection model trained in advance, wherein the detection model is obtained by training with data corresponding to a medium type selected in advance and is capable of recognizing the medium type selected;judging, by the detection model, whether an object to which the data belongs is a plane, and if the object is a plane, determining the medium type of the plane; andsetting corresponding optimization manners for different medium types, and optimizing the data according to the medium type. According to another aspect of the present disclosure, a plane detection device based on a laser sensor is provided. The device comprises: a data acquisition unit for acquiring data of the laser sensor after starting detection;a data input unit for inputting the data into a detection model trained in advance, wherein the detection model is obtained by training with data corresponding to a medium type selected in advance and is capable of recognizing the medium type selected;a type detection unit for judging whether an object to which the data belongs is a plane by the detection model, and if the object is a plane, determining the medium type of the plane; anda data optimization unit for setting corresponding optimization manners for different medium types, and optimizing the data according to the medium type. According to yet another aspect of the present disclosure, an electronic apparatus is provided. The electronic apparatus comprises: a processor and a memory arranged to store computer executable instructions, wherein the executable instructions, when executed, cause the processor to perform the above method. According to still yet another aspect of the present disclosure, a computer readable storage medium is provided, wherein the computer readable storage medium stores one or more programs, and the one or more programs, when executed by a processor, implement the above method. It can be seen from the above that the technical solutions of the embodiments of the present disclosure recognize the medium type to which the two-dimensional laser data of a wall and other planes belongs by a machine learning model, and optimizes the two-dimensional laser data according to the recognition result, and thus form a more refined map and perform more accurate positioning based on the two-dimensional lase