Detection Method, Device, Equipment and Storage Medium for Long Corridor Environment

By collecting laser data and using RANSAC algorithm to determine the number and specification conditions of fitted lines, the calculating the length of the environment is solved, and the problem of inaccurate positioning of robots in long corridor environments is improved, and the accuracy of detection and positioning is improved.

CN115166770BActive Publication Date: 2025-07-11SHENZHEN SILVER STAR INTELLIGENT TECH CO LTD
View PDF 3 Cites 0 Cited by

Patent Information

Application Number
CN202210868922.9
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2022-07-22
Publication Date
2025-07-11
Estimated Expiration
2042-07-22

AI Technical Summary

Technical Problem

The robot cannot accurately identify the type of environment it is in a long corridor environment, resulting in positioning errors and affecting the accuracy of positioning mapping and planning control.

Method used

By collecting laser data, using the RANSAC algorithm to find the fitted straight line, determine whether the fitted straight line meets the quantity and specification conditions, calculate the degree of elongation of the environment, and compare it with the degree threshold to determine whether it is a long corridor environment.

Benefits of technology

The accuracy of detection of long corridor environment types is improved, ensuring the accuracy of positioning and mapping of robots in long corridor environments.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN115166770B_ABST
    Figure CN115166770B_ABST
Patent Text Reader

Abstract

The present application provides a detection method, device, equipment and storage medium for a long corridor environment. The detection system first makes a primary judgment on the quantity condition and specification condition of the fitted straight lines included in the laser data, so as to identify whether the current scene is a long corridor environment. After a preliminary determination of the environment type of the current scene based on the fitted straight lines, a secondary judgment is further made on the environment type of the current scene by the environmental slenderness degree of the current environment, thereby effectively improving the detection accuracy of the environment type of the current scene.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the technical field of laser mapping, and particularly relates to a detection method, device, equipment and storage medium for a long corridor environment. Background Art

[0002] Positioning and mapping in long corridors is a difficult point in existing laser slam. In actual tests, technicians found that robots often have positioning errors when located in a long corridor environment. This is because when using a lidar to map in a long corridor, the scores of the robot at each pose during movement are basically the same, resulting in the robot being unable to accurately locate its own pose, which has a very bad impact on normal positioning and mapping and subsequent planning and control. Therefore, how to accurately identify the type of environment the robot is in during movement is a technical problem that technicians urgently need to solve. Summary of the Invention

[0003] The main purpose of this application is to provide a detection method, device, equipment and storage medium for a long corridor environment, aiming to solve the drawback that existing robots cannot accurately identify the type of environment they are in.

[0004] To achieve the above purpose, this application provides a detection method for a long corridor environment, including:

[0005] Collect laser data and obtain all the fitted straight lines from the current frame of the laser data;

[0006] Judge whether the fitted straight lines meet the quantity condition and the specification condition;

[0007] If the fitted straight lines meet the quantity condition and the specification condition, calculate the environmental slenderness degree of the current scene based on the laser point coordinates included in the current frame of the laser data;

[0008] Judge whether the environmental slenderness degree is greater than the degree threshold;

[0009] If the environmental slenderness degree is greater than the degree threshold, determine that the current scene is a long corridor environment.

[0010] This application also provides a detection device for a long corridor environment, including:

[0011] A search module, configured to collect laser data and obtain all the fitted straight lines from the current frame of the laser data;

[0012] A first judgment module, configured to judge whether the fitted straight lines meet the quantity condition and the specification condition;

[0013] A calculation module, configured to calculate the environmental elongation degree of the current scene based on the laser point coordinates included in the laser data of the current frame if the fitting line meets the quantity condition and the specification condition.

[0014] A second judgment module, configured to judge whether the environmental elongation degree is greater than a degree threshold.

[0015] A determination module, configured to determine that the current scene is a long corridor environment if the environmental elongation degree is greater than the degree threshold.

[0016] The present application also provides a computer device, including a memory and a processor, where a computer program is stored in the memory, and when the processor executes the computer program, the steps of the method described in any one of the above are implemented.

[0017] The present application also provides a computer-readable storage medium, on which a computer program is stored, and when the computer program is executed by a processor, the steps of the method described in any one of the above are implemented.

[0018] In a detection method, device, equipment, and storage medium for a long corridor environment provided in the present application, a detection system of a sweeping robot collects laser data, and all fitting lines are found from the laser data of the current frame through the RANSAC algorithm. Then, it is judged whether each fitting line meets the quantity condition and the specification condition; if each fitting line meets the preset quantity condition and specification condition, the environmental elongation degree of the current scene is calculated based on the laser point coordinates included in the laser data of the current frame. The detection system further judges whether the environmental elongation degree is greater than the degree threshold. If the environmental elongation degree is greater than the degree threshold, it is determined that the current scene is a long corridor environment. In the present application, the detection system first makes a primary judgment on the quantity condition and the specification condition of the fitting lines included in the laser data, so as to identify whether the current scene is a long corridor environment. After a preliminary determination of the environmental type of the current scene based on the fitting line, a secondary judgment on the environmental type of the current scene is further made through the environmental elongation degree of the current environment, thereby effectively improving the detection accuracy of the environmental type of the current scene. Description of the Drawings

[0019] Figure 1 is a schematic diagram of the steps of a detection method for a long corridor environment in an embodiment of the present application;

[0020] Figure 2 is a block diagram of the overall structure of a detection device for a long corridor environment in an embodiment of the present application;

[0021] Figure 3 is a schematic block diagram of the structure of a computer device in an embodiment of the present application.

[0022] The realization of the purpose of this application, its functional characteristics and advantages will be further described in conjunction with the embodiments with reference to the accompanying drawings. Detailed implementation manners

[0023] In order to make the purpose, technical solutions and advantages of this application clearer, the following further details this application in conjunction with the accompanying drawings and embodiments. It should be understood that the specific embodiments described herein are only used to explain this application and are not used to limit this application.

[0024] Referring to Figure 1 , in an embodiment of this application, a detection method for a long corridor environment is provided, including:

[0025] S1: Collect laser data and obtain all fitted straight lines from the current frame of the laser data;

[0026] In this embodiment, the detection method is described by taking its application to a floor cleaning robot as an example. A lidar is deployed on the floor cleaning robot, and the detection system of the floor cleaning robot obtains laser data through the scan of the lidar. A frame of laser data contains multiple laser points. Taking 1 degree as the quantization distance as an example, the lidar scans a full circle (i.e., scans 360 degrees) to obtain a frame of laser data, and this frame of laser data contains 360 laser points. The detection system uses the RANSAC (RANdom SAmpleConsensus) algorithm to find all the fitted straight lines from the current frame of laser data. Specifically, first convert the current frame of laser data into 2D point cloud and put it into mPointCloud. If the maximum number of straight lines maxIterNum that can be found is reached, then return all the found straight lines (i.e., the fitted straight lines). During the process of finding the straight lines, set the current iteration number iterNum to 1; Step 1: If the current iteration number iterNum is greater than the maximum iteration number lineMaxIter, then return all the found fitted straight lines. Otherwise, randomly sample two points p1 and p2 in the 2D point cloud and calculate the straight line composed of p1 and p2 and its straight line parameters; Step 2: The detection system calculates the distance from all current points to this straight line and counts the number inLiears of points with a distance less than the threshold dmin. Step 3: The detection system calculates the current ideal iteration number N. The calculation formula for the current ideal iteration number N is: N = log(1 - probability) / log(1 - (1 - e) 2), where probability represents the prior probability of inliers; Step 4: If iterNum >= N, return the parameters of the line line, otherwise, increment the current iteration number iterNum by 1 and return to Step 1 to process again in the order of the steps. The detection system uses the found line parameters to find the inliers on the line. If the number of found inliers is greater than the minimum number of line point clouds MinLinePointNum (the set threshold of the number of laser points), then directly return the found line; otherwise, use the found inliers to refit the line, calculate more accurate line parameters, save the line, and remove the points on the line segment from the input point cloud. According to the above logic, the detection system uses RANSAC to find all the fitted lines in the laser data of the current frame.

[0027] S2: Determine whether the fitted line meets the quantity condition and the specification condition;

[0028] In this embodiment, for all the fitted lines found from the laser data of the current frame, the detection system globally determines whether the fitted lines meet the quantity condition and the specification condition. Specifically, the detection system first obtains the total number of all the fitted lines found in the laser data of the current frame to get the total line number. Then, it retrieves the quantity threshold and compares the total line number with the quantity threshold to judge the quantity relationship between the two. If the total line number is not greater than the quantity threshold, it may be that the lidar fails, resulting in incorrect laser data acquisition; it may also be that the current scene belongs to a long corridor environment. If the total line number is greater than the quantity threshold, it is determined that the fitted lines meet the quantity condition, and further, the distance between adjacent two lines is obtained and it is judged whether each line distance is less than the distance threshold. If the line distance between adjacent two lines is less than the distance threshold, it is determined that the fitted lines meet the specification condition.

[0029] S3: If the fitted line meets the quantity condition and the specification condition, calculate the environmental elongation degree of the current scene based on the laser point coordinates included in the laser data of the current frame;

[0030] In this embodiment, if the fitting lines found from the laser data of the current frame meet the quantity condition and the specification condition, the detection system calculates based on the laser point coordinates included in the laser data of the current frame to obtain the environmental elongation degree of the current scene. Specifically, the detection system calculates the average value of the laser coordinate values corresponding to all the laser points included in the laser data of the current frame to obtain the coordinate average value corresponding to the laser data of the current frame. Then, a covariance matrix corresponding to the laser data of the current frame is constructed according to the coordinate average value, and the covariance matrix is solved to obtain a first eigenvalue and a second eigenvalue; among them, the first eigenvalue represents the orientation of the laser data of the current frame, and the second eigenvalue represents the normal direction of the laser data of the current frame. The detection system calculates the environmental ratio between the first eigenvalue and the second eigenvalue to obtain the environmental elongation degree of the current scene.

[0031] S4: Determine whether the environmental elongation degree is greater than the degree threshold;

[0032] In this embodiment, the detection system retrieves the preset degree threshold and compares the calculated environmental elongation degree of the current scene with the degree threshold to determine the size relationship between the two.

[0033] S5: If the environmental elongation degree is greater than the degree threshold, it is determined that the current scene is a long corridor environment.

[0034] In this embodiment, if the environmental elongation degree of the current scene is greater than the preset degree threshold, it means that the regional shape of the current scene is slender enough, and the detection system determines that the current scene is a long corridor environment.

[0035] In this embodiment, the detection system first makes a primary judgment on the quantity condition and the specification condition of the fitting lines included in the laser data to identify whether the current scene is a long corridor environment. After a preliminary determination of the environmental type of the current scene based on the fitting lines, the environmental type of the current scene is further judged secondarily by the environmental elongation degree of the current environment, so as to effectively improve the detection accuracy of the environmental type of the current scene.

[0036] Further, the step of determining whether the fitting lines meet the quantity condition and the specification condition includes:

[0037] S201: Obtain the total number of the fitting lines and determine whether the total number of the lines is greater than the quantity threshold;

[0038] In this embodiment, the detection system uses the RANSAC algorithm to find all the fitting lines from the laser data of the current frame, and counts the total number of all the fitting lines to obtain the total number of lines. Then, the preset quantity threshold is retrieved, and the total number of the fitting lines is compared with the quantity threshold to determine the size relationship between the two; among them, the quantity threshold is set to 1.

[0039] S202: If the total number of the lines is greater than the quantity threshold, determine that the fitted lines meet the quantity condition, and determine whether each pair of the fitted lines is parallel to each other;

[0040] In this embodiment, if the total number of the fitted lines is greater than the quantity threshold, the detection system determines that the fitted lines found in the current frame of laser data meet the quantity condition. Further, the detection system takes two fitted lines as a group and determines whether each pair of the fitted lines is parallel to each other respectively. Preferably, the detection system screens two adjacent fitted lines as a group to facilitate pairing in sequence and avoid omission.

[0041] S203: If each pair of the fitted lines is parallel to each other, obtain the line distances between adjacent pairs of the fitted lines, and determine whether each of the line distances is less than the distance threshold;

[0042] In this embodiment, if each pair of the fitted lines is parallel to each other (that is, all the fitted lines are parallel to each other), the detection system takes two adjacent lines as a group and obtains the line distance between the two lines in the same group, so as to obtain the line distances between adjacent pairs of the fitted lines. The detection system retrieves the distance threshold and compares each line distance with the distance threshold respectively, so as to determine the size relationship between each line distance and the distance threshold.

[0043] S204: If each of the line distances is less than the distance threshold, determine that the fitted lines meet the specification condition.

[0044] In this embodiment, if each of the line distances is less than the distance threshold, the detection system determines that the fitted lines meet the specification condition and waits for the next step of processing. If there is one or more line distances among the line distances that are not less than the distance threshold, the detection system determines that the current scene is a non-long corridor environment.

[0045] Further, after the step of determining whether the total number of the lines is greater than the quantity threshold, it includes:

[0046] S205: If the total number of the lines is less than the quantity threshold, determine that the laser data acquisition is incorrect;

[0047] In this embodiment, if the total number of straight lines is less than the quantity threshold (i.e., less than 1), it indicates that there is an error in the current frame of lidar data collected. Because under normal data collection, at least one straight line can be found in each frame of lidar data. Therefore, the detection system determines that the lidar data collection of the current frame is incorrect, and it may be that the lidar is operating abnormally. The detection system can output an error message to the maintenance personnel's receiving terminal so that the maintenance personnel can check the operating conditions of the lidar in a timely manner, or search for and correct the reasons for the incorrect lidar data collection to ensure that the sweeping robot can work properly.

[0048] S206: If the total number of the straight lines is equal to the quantity threshold, determine that the current scene is the long corridor environment.

[0049] In this embodiment, if only one fitted straight line can be found in the lidar data of the current frame, it indicates that the boundary of the current scene is only this fitted straight line. Therefore, the detection system can directly determine that the current scene is a long corridor environment.

[0050] Further, after the step of determining whether each pair of the fitted straight lines is parallel to each other, it includes:

[0051] S207: If there is at least one group of the fitted straight lines intersecting among each pair of the fitted straight lines, determine that the current scene is a non-long corridor environment, where a single group of the fitted straight lines includes two of the fitted straight lines.

[0052] In this embodiment, the detection system takes two fitted straight lines as a group. If there is one or more groups of the fitted straight lines intersecting (i.e., two fitted straight lines intersect. Here, the length of the fitted straight lines is ignored, and only whether the directions of the fitted straight lines intersect is determined), it indicates that the regional boundaries of the current scene intersect and it is not a long corridor environment of the slender type. Therefore, the detection system determines that the current scene is a non-long corridor environment.

[0053] After the step of determining whether each of the straight line distances is less than the distance threshold, it includes:

[0054] S208: If there is at least one of the straight line distances not less than the distance threshold, determine that the current scene is the non-long corridor environment.

[0055] In this embodiment, if each of the fitted straight lines is parallel to each other, but among the straight line distances between adjacent two straight lines, there is one or more straight line distances not less than the preset distance threshold, it indicates that the regional boundaries of the current scene do not conform to the slender characteristics of the long corridor environment. Therefore, the detection system determines that the current scene is a non-long corridor environment.

[0056] Further, after the step of determining that the current scene is a non-long corridor environment, it includes:

[0057] S6: Generate the scene area boundary of the current scene according to the intersecting fitting lines.

[0058] In this embodiment, if there are intersecting fitting lines among the fitting lines found in the current frame of laser data, since each fitting line essentially corresponds to the area boundary of the current scene; therefore, the detection system can obtain the scene area boundary of the current scene according to the specific intersection shape of the intersecting fitting lines, thereby obtaining the area shape of the current scene. For example, if 4 fitting lines are found in the current frame of laser data, and these 4 fitting lines intersect adjacent to each other to form a rectangle, then the area boundary of the rectangle is the scene area boundary of the current scene (the rectangle is equivalent to the shape of the scene area).

[0059] Further, the step of calculating the environmental elongation degree of the current scene based on the laser point coordinates included in the current frame of the laser data includes:

[0060] S301: Perform an averaging calculation on the laser coordinate values corresponding to all the laser points included in the current frame of the laser data to obtain the coordinate average value corresponding to the current frame of the laser data;

[0061] In this embodiment, the detection system obtains the laser coordinate values corresponding to all the laser points included in the laser data of the current frame, and then performs an averaging calculation on all the laser coordinate values to obtain the coordinate average value corresponding to the current frame of the laser data. Among them, the coordinate average value consists of the horizontal coordinate average value and the vertical coordinate average value; in the process of performing the averaging calculation, the sum of the horizontal coordinate values of each laser point is divided by the number of laser points to obtain the horizontal coordinate average value; the sum of the vertical coordinate values of each laser point is divided by the number of laser points to obtain the vertical coordinate average value.

[0062] S302: Construct a covariance matrix corresponding to the current frame of the laser data according to the coordinate average value, and solve the covariance matrix to obtain a first eigenvalue and a second eigenvalue, where the first eigenvalue represents the orientation of the current frame of the laser data, and the second eigenvalue represents the normal direction of the current frame of the laser data;

[0063] In this embodiment, the detection system constructs a corresponding covariance matrix according to the coordinate average value of the current frame of laser data, and solves the covariance matrix to obtain a first eigenvalue and a second eigenvalue. Among them, the eigenvector corresponding to the minimum eigenvalue (i.e., the second eigenvalue) is the normal vector, and the other eigenvalue is the first eigenvalue, with a total of two eigenvalues. The first eigenvalue represents the orientation of the current frame of laser data, and the second eigenvalue represents the normal direction of the current frame of laser data.

[0064] S303: Calculate the environmental ratio between the first eigenvalue and the second eigenvalue to obtain the environmental elongation degree.

[0065] In this embodiment, the detection system divides the first eigenvalue by the second eigenvalue to calculate the environmental ratio between the two, and this environmental ratio characterizes the environmental slenderness of the current scene.

[0066] Furthermore, the detection method is applied to a floor cleaning robot. After the step of determining that the current scene is a long corridor environment, it includes:

[0067] S7: Retrieve the odometer data;

[0068] S8: Locate the floor cleaning robot according to the odometer data.

[0069] In this embodiment, the floor cleaning robot is equipped with an odometer. When the detection system determines that the current scene is a long corridor environment, the reliability of the laser data collected by laser scanning is greatly reduced. To ensure the reliability of subsequent map building, positioning, and planning control of the floor cleaning robot, it is necessary to use the odometer data collected by the odometer as the standard. Specifically, the detection system retrieves the odometer data collected by the odometer, and locates, builds a map, and performs planning control on the floor cleaning robot according to the odometer data.

[0070] Refer to Figure 2 , in an embodiment of the present application, a detection device for a long corridor environment is further provided, including:

[0071] Search module 1, configured to collect laser data and obtain all the fitted straight lines from the current frame of the laser data;

[0072] First judgment module 2, configured to judge whether the fitted straight line meets the quantity condition and the specification condition;

[0073] Calculation module 3, configured to calculate the environmental slenderness of the current scene based on the laser point coordinates included in the current frame of the laser data if the fitted straight line meets the quantity condition and the specification condition;

[0074] Second judgment module 4, configured to judge whether the environmental slenderness is greater than the degree threshold;

[0075] Determination module 5, configured to determine that the current scene is a long corridor environment if the environmental slenderness is greater than the degree threshold.

[0076] Furthermore, the first judgment module 2 includes:

[0077] First judgment unit, configured to obtain the total number of straight lines of the fitted straight line and judge whether the total number of straight lines is greater than the quantity threshold;

[0078] A second judgment unit, configured to determine that the fitted straight line meets the quantity condition if the total number of the straight lines is greater than the quantity threshold, and determine whether any two of the fitted straight lines are parallel to each other;

[0079] A third judgment unit, configured to obtain the straight line distances between adjacent pairs of the fitted straight lines if any two of the fitted straight lines are parallel to each other, and determine whether all the straight line distances are less than a distance threshold;

[0080] A first determination unit, configured to determine that the fitted straight line meets the specification condition if all the straight line distances are less than the distance threshold.

[0081] Further, the first judgment module 2 further includes:

[0082] A second determination unit, configured to determine that the laser data acquisition is incorrect if the total number of the straight lines is less than the quantity threshold;

[0083] A third determination unit, configured to determine that the current scene is the long corridor environment if the total number of the straight lines is equal to the quantity threshold.

[0084] Further, the first judgment module 2 further includes:

[0085] A fourth determination unit, configured to determine that the current scene is not the long corridor environment if there is at least one group of the fitted straight lines that intersect among any two of the fitted straight lines, where a single group of the fitted straight lines includes two of the fitted straight lines;

[0086] A fifth determination unit, configured to determine that the current scene is the non-long corridor environment if there is at least one of the straight line distances that is not less than the distance threshold.

[0087] Further, the first judgment module 2 further includes:

[0088] A generation unit, configured to generate a scene area boundary of the current scene according to the intersecting fitted straight lines.

[0089] Further, the calculation module 3 includes:

[0090] A first calculation unit, configured to perform an averaging calculation on the laser coordinate values corresponding to all the laser points included in the laser data of the current frame to obtain a coordinate average value corresponding to the laser data of the current frame;

[0091] A solution unit, configured to construct a covariance matrix corresponding to the laser data of the current frame according to the coordinate mean value, and solve the covariance matrix to obtain a first eigenvalue and a second eigenvalue, where the first eigenvalue represents the orientation of the laser data of the current frame, and the second eigenvalue represents the normal direction of the laser data of the current frame;

[0092] A second calculation unit, configured to calculate an environment ratio between the first eigenvalue and the second eigenvalue to obtain the degree of elongation of the environment.

[0093] Further, the detection method is applied to a floor sweeping robot, and the detection device further includes:

[0094] An access module 6, configured to access odometer data;

[0095] A positioning module 7, configured to position the floor sweeping robot according to the odometer data.

[0096] In this embodiment, each module and unit in the detection device for a long corridor environment is configured to correspondingly execute each step in the above-mentioned detection method for a long corridor environment, and the specific implementation process thereof will not be elaborated here.

[0097] A detection device for a long corridor environment provided in this embodiment, where a detection system of a floor sweeping machine collects laser data, and all fitting straight lines are found from the laser data of the current frame through the RANSAC algorithm. Then, it is determined whether each fitting straight line meets the quantity condition and the specification condition; if each fitting straight line meets the preset quantity condition and specification condition, then based on the laser point coordinates included in the laser data of the current frame, the degree of elongation of the current scene is calculated. The detection system further determines whether the degree of elongation of the environment is greater than a degree threshold, and if the degree of elongation of the environment is greater than the degree threshold, it is determined that the current scene is a long corridor environment. In this application, the detection system first makes a primary judgment on the quantity condition and the specification condition of the fitting straight lines included in the laser data, so as to identify whether the current scene is a long corridor environment. After a preliminary determination of the environment type of the current scene according to the fitting straight lines, the environment type of the current scene is further judged secondarily by the degree of elongation of the current environment, thereby effectively improving the detection accuracy of the environment type of the current scene.

[0098] Referring to Figure 3 , in the embodiment of the present application, a computer device is further provided. The computer device may be a server, and its internal structure may be as Figure 3As shown in the figure. The computer device includes a processor, a memory, a network interface, and a database connected via a system bus. Among them, the processor of the computer design is used to provide computing and control capabilities. The memory of the computer device includes a non-volatile storage medium and an internal memory. The non-volatile storage medium stores an operating system, computer programs, and a database. The internal memory provides an environment for the operation of the operating system and computer programs in the non-volatile storage medium. The database of the computer device is used to store data such as laser data. The network interface of the computer device is used to communicate with an external terminal via a network connection. When the computer program is executed by the processor, it realizes a detection method for a long corridor environment.

[0099] The steps for the above-mentioned processor to execute the above-mentioned detection method for a long corridor environment are as follows:

[0100] S1: Collect laser data and obtain all the fitted lines from the current frame of the laser data;

[0101] S2: Determine whether the fitted lines meet the quantity condition and the specification condition;

[0102] S3: If the fitted lines meet the quantity condition and the specification condition, calculate the environmental elongation degree of the current scene based on the laser point coordinates included in the current frame of the laser data;

[0103] S4: Determine whether the environmental elongation degree is greater than the degree threshold;

[0104] S5: If the environmental elongation degree is greater than the degree threshold, determine that the current scene is a long corridor environment.

[0105] Further, the step of determining whether the fitted lines meet the quantity condition and the specification condition includes:

[0106] S201: Obtain the total number of the fitted lines and determine whether the total number of the lines is greater than the quantity threshold;

[0107] S202: If the total number of the lines is greater than the quantity threshold, determine that the fitted lines meet the quantity condition and determine whether each pair of the fitted lines is parallel to each other;

[0108] S203: If each pair of the fitted lines is parallel to each other, obtain the line distance between adjacent pairs of the fitted lines and determine whether each of the line distances is less than the distance threshold;

[0109] S204: If each of the line distances is less than the distance threshold, determine that the fitted lines meet the specification condition.

[0110] Further, after the step of determining whether the total number of the straight lines is greater than the number threshold, the following steps are included:

[0111] S205: If the total number of the straight lines is less than the number threshold, it is determined that the laser data acquisition is incorrect;

[0112] S206: If the total number of the straight lines is equal to the number threshold, it is determined that the current scene is the long corridor environment.

[0113] Further, after the step of determining whether each pair of the fitted straight lines is parallel to each other, the following steps are included:

[0114] S207: If there is at least one pair of the fitted straight lines that intersect among each pair of the fitted straight lines, it is determined that the current scene is not the long corridor environment, where a single pair of the fitted straight lines includes two fitted straight lines;

[0115] After the step of determining whether the distance between each of the straight lines is less than the distance threshold, the following steps are included:

[0116] S208: If there is at least one straight line distance that is not less than the distance threshold, it is determined that the current scene is the non-long corridor environment.

[0117] Further, after the step of determining that the current scene is the non-long corridor environment, the following steps are included:

[0118] S6: Generate the scene area boundary of the current scene according to each of the intersecting fitted straight lines.

[0119] Further, the step of calculating the environmental slenderness degree of the current scene based on the laser point coordinates included in the current frame of the laser data includes:

[0120] S301: Perform an averaging calculation on the laser coordinate values corresponding to all the laser points included in the current frame of the laser data to obtain the coordinate average value corresponding to the current frame of the laser data;

[0121] S302: Construct a covariance matrix corresponding to the current frame of the laser data according to the coordinate average value, and solve the covariance matrix to obtain a first eigenvalue and a second eigenvalue, where the first eigenvalue represents the orientation of the current frame of the laser data, and the second eigenvalue represents the normal direction of the current frame of the laser data;

[0122] S303: Calculate the environmental ratio between the first eigenvalue and the second eigenvalue to obtain the environmental slenderness degree.

[0123] Further, when the detection method is applied to a sweeping robot, after the step of determining that the current scene is the long corridor environment, the following steps are included:

[0124] S7: Retrieve odometer data;

[0125] S8: Locate the floor cleaning robot according to the odometer data.

[0126] An embodiment of the present application further provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, a detection method for a long corridor environment is implemented. The detection method for the long corridor environment is specifically as follows:

[0127] S1: Collect laser data and obtain all the fitted straight lines from the current frame of the laser data;

[0128] S2: Determine whether the fitted straight lines meet the quantity condition and the specification condition;

[0129] S3: If the fitted straight lines meet the quantity condition and the specification condition, calculate the environmental elongation degree of the current scene based on the laser point coordinates included in the current frame of the laser data;

[0130] S4: Determine whether the environmental elongation degree is greater than the degree threshold;

[0131] S5: If the environmental elongation degree is greater than the degree threshold, determine that the current scene is a long corridor environment.

[0132] Further, the step of determining whether the fitted straight lines meet the quantity condition and the specification condition includes:

[0133] S201: Obtain the total number of straight lines of the fitted straight lines and determine whether the total number of straight lines is greater than the quantity threshold;

[0134] S202: If the total number of straight lines is greater than the quantity threshold, determine that the fitted straight lines meet the quantity condition and determine whether each pair of the fitted straight lines is parallel to each other;

[0135] S203: If each pair of the fitted straight lines is parallel to each other, obtain the straight line distance between adjacent pairs of the fitted straight lines and determine whether each straight line distance is less than the distance threshold;

[0136] S204: If each straight line distance is less than the distance threshold, determine that the fitted straight lines meet the specification condition.

[0137] Further, after the step of determining whether the total number of straight lines is greater than the quantity threshold, it includes:

[0138] S205: If the total number of straight lines is less than the quantity threshold, determine that the laser data collection is incorrect;

[0139] S206: If the total number of the straight lines is equal to the quantity threshold, determine that the current scene is the long corridor environment.

[0140] Further, after the step of determining whether each pair of the fitted straight lines is parallel to each other, it includes:

[0141] S207: If there is at least one group of the fitted straight lines intersecting among each pair of the fitted straight lines, determine that the current scene is a non-long corridor environment, where a single group of the fitted straight lines includes two of the fitted straight lines;

[0142] After the step of determining whether each of the straight line distances is less than the distance threshold, it includes:

[0143] S208: If there is at least one of the straight line distances not less than the distance threshold, determine that the current scene is the non-long corridor environment.

[0144] Further, after the step of determining that the current scene is a non-long corridor environment, it includes:

[0145] S6: Generate the scene area boundary of the current scene according to each of the intersecting fitted straight lines.

[0146] Further, the step of calculating the environmental elongation degree of the current scene based on the laser point coordinates included in the current frame of the laser data includes:

[0147] S301: Perform an average calculation on the laser coordinate values respectively corresponding to all the laser points included in the current frame of the laser data to obtain the coordinate average value corresponding to the current frame of the laser data;

[0148] S302: Construct a covariance matrix corresponding to the current frame of the laser data according to the coordinate average value, and solve the covariance matrix to obtain a first eigenvalue and a second eigenvalue, where the first eigenvalue represents the orientation of the current frame of the laser data, and the second eigenvalue represents the normal direction of the current frame of the laser data;

[0149] S303: Calculate the environmental ratio between the first eigenvalue and the second eigenvalue to obtain the environmental elongation degree.

[0150] Further, when the detection method is applied to a sweeping robot, after the step of determining that the current scene is a long corridor environment, it includes:

[0151] S7: Retrieve the odometer data;

[0152] S8: Locate the sweeping robot according to the odometer data.

[0153] Those of ordinary skill in the art can understand that all or part of the processes in the methods of the above embodiments can be completed by instructing relevant hardware through a computer program. The computer program can be stored in a non-volatile computer-readable storage medium. When the computer program is executed, it can include the processes of the embodiments of the above methods. Among them, any reference to a memory, storage, database, or other medium provided in this application and used in the embodiments can include non-volatile and / or volatile memories. Non-volatile memories can include read-only memory (ROM), programmable ROM (PROM), electrically programmable ROM (EPROM), electrically erasable programmable ROM (EEPROM), or flash memory. Volatile memories can include random access memory (RAM) or external cache memory. By way of illustration and not limitation, RAM is available in various forms, such as static RAM (SRAM), dynamic RAM (DRAM), synchronous DRAM (SDRAM), double data rate SDRAM (DDR SDRAM), enhanced SDRAM (ESDRAM), synchronous link DRAM (SLDRAM), Rambus direct RAM (RDRAM), direct memory bus dynamic RAM (DRDRAM), and Rambus dynamic RAM (RDRAM), etc.

[0154] It should be noted that in this article, the terms "include", "comprise", or any other variant thereof are intended to cover non-exclusive inclusion, such that a process, device, first object, or method that includes a series of elements includes not only those elements but also other elements not expressly listed, or elements that are inherent to such process, device, first object, or method. Without further limitation, an element defined by the statement "including one..." does not exclude the existence of additional identical elements in the process, device, first object, or method that includes such element.

[0155] The above are only the preferred embodiments of this application, and do not limit the patent scope of this application accordingly. Any equivalent structural or equivalent process transformation made by using the content of the specification and drawings of this application, or directly or indirectly applied in other related technical fields, shall be similarly included in the patent protection scope of this application.

Claims

1. A detection method for a long corridor environment, characterized in that, Including: Collecting laser data and obtaining all fitted straight lines from the laser data of the current frame; Judging whether the fitted straight lines meet the quantity condition and the specification condition; If the fitted straight lines meet the quantity condition and the specification condition, calculating the environmental elongation degree of the current scene based on the laser point coordinates included in the laser data of the current frame; Judging whether the environmental elongation degree is greater than the degree threshold; If the environmental elongation degree is greater than the degree threshold, determining that the current scene is a long corridor environment; The step of judging whether the fitted straight lines meet the quantity condition and the specification condition includes: Obtaining the total number of straight lines of the fitted straight lines and judging whether the total number of straight lines is greater than the quantity threshold; wherein, the quantity threshold is set to 1; If the total number of straight lines is greater than the quantity threshold, determining that the fitted straight lines meet the quantity condition and judging whether each pair of the fitted straight lines is parallel to each other; If each pair of the fitted straight lines is parallel to each other, obtaining the straight line distance between adjacent pairs of the fitted straight lines and judging whether each straight line distance is less than the distance threshold; If each straight line distance is less than the distance threshold, determining that the fitted straight lines meet the specification condition; The step of calculating the environmental elongation degree of the current scene based on the laser point coordinates included in the laser data of the current frame includes: Performing a mean value calculation on the laser point coordinates corresponding to all laser points included in the laser data of the current frame to obtain the coordinate mean value corresponding to the laser data of the current frame; Constructing a covariance matrix corresponding to the laser data of the current frame according to the coordinate mean value and solving the covariance matrix to obtain a first eigenvalue and a second eigenvalue, wherein the first eigenvalue represents the orientation of the laser data of the current frame, and the second eigenvalue represents the normal direction of the laser data of the current frame; Calculating an environmental ratio between the first eigenvalue and the second eigenvalue to obtain the environmental elongation degree.

2. The detection method for the long corridor environment according to claim 1, characterized in that, After the step of judging whether the total number of straight lines is greater than the quantity threshold, it includes: If the total number of straight lines is less than the quantity threshold, determining that the laser data collection is incorrect; If the total number of straight lines is equal to the quantity threshold, determining that the current scene is the long corridor environment.

3. The detection method for a long corridor environment according to claim 1, characterized in that, After the step of judging whether each pair of the fitted straight lines is parallel to each other, it includes: If there is at least one group of the fitted straight lines intersecting among each pair of the fitted straight lines, determining that the current scene is a non-long corridor environment, wherein a single group of the fitted straight lines includes two fitted straight lines; after the step of judging whether each straight line distance is less than the distance threshold, it includes: If there is at least one straight line distance not less than the distance threshold, determining that the current scene is the non-long corridor environment.

4. The detection method for a long corridor environment according to claim 3, wherein After the step of determining that the current scene is a non-long corridor environment, it includes: Generating a scene area boundary of the current scene according to the intersecting fitted straight lines.

5. The detection method for a long corridor environment according to claim 1, characterized in that, The detection method is applied to a sweeping robot. After the step of determining that the current scene is a long corridor environment, it includes: Retrieving odometer data; Locate the floor cleaning robot according to the odometer data.

6. A detection device for a long corridor environment, characterized in that, Including: A search module, configured to collect laser data and obtain all fitted straight lines from the current frame of the laser data; A first judgment module, configured to judge whether the fitted straight lines meet the quantity condition and the specification condition; A calculation module, configured to, if the fitted straight lines meet the quantity condition and the specification condition, calculate the environmental elongation degree of the current scene based on the laser point coordinates included in the current frame of the laser data; A second judgment module, configured to judge whether the environmental elongation degree is greater than the degree threshold; A determination module, configured to, if the environmental elongation degree is greater than the degree threshold, determine that the current scene is a long corridor environment; The first judgment module includes: A first judgment unit, configured to obtain the total number of straight lines of the fitted straight lines and judge whether the total number of straight lines is greater than the quantity threshold; wherein, the quantity threshold is set to 1; A second judgment unit, configured to, if the total number of straight lines is greater than the quantity threshold, determine that the fitted straight lines meet the quantity condition and judge whether each pair of the fitted straight lines is parallel to each other; A third judgment unit, configured to, if each pair of the fitted straight lines is parallel to each other, obtain the straight line distance between adjacent pairs of the fitted straight lines and judge whether each straight line distance is less than the distance threshold; A first determination unit, configured to, if each straight line distance is less than the distance threshold, determine that the fitted straight lines meet the specification condition; The calculation module includes: A first calculation unit, configured to perform a mean value calculation on the laser point coordinates corresponding to all laser points included in the current frame of the laser data to obtain the coordinate mean value corresponding to the current frame of the laser data; A solution unit, configured to construct a covariance matrix corresponding to the current frame of the laser data according to the coordinate mean value and solve the covariance matrix to obtain a first eigenvalue and a second eigenvalue, wherein the first eigenvalue represents the orientation of the current frame of the laser data, and the second eigenvalue represents the normal direction of the current frame of the laser data; A second calculation unit, configured to calculate the environmental ratio between the first eigenvalue and the second eigenvalue to obtain the environmental elongation degree.

7. A computer device, comprising a memory and a processor, wherein a computer program is stored in the memory, characterized in that, When the processor executes the computer program, the steps of the method according to any one of claims 1 to 5 are implemented.

8. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, the steps of the method according to any one of claims 1 to 5 are implemented.

Citation Information

Patent Citations

  • Feature salience detection method based on laser radar in linear environment

    CN108445505A

  • Method, device and system for mapping in long corridor by using laser SLAM, and storage medium

    CN110333495A

  • Long channel identification method and robot

    CN112539756A