Sweeper control method and device and sweeper
By analyzing the obstacle map and emergency points of the sweeper, fitting the straight lines of the obstacle point set, the problem of the sweeper missing and collision in complex obstacle cleaning is solved, and the accuracy of the obstacle profile is improved. Cleaning efficiency.
Patent Information
- Application Number
- CN202410953976.4
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-07-16
- Publication Date
- 2024-11-08
- Estimated Expiration
- 2044-07-16
AI Technical Summary
When existing sweepers encounter complex obstacles, especially objects with edges and edges, it is difficult to accurately extract the obstacle profile, resulting in leakage or collision.
By obtaining the obstacle map and emergency points, determine the target obstacle point set and fit the point set on both sides of it in a straight line. If the slope difference of the straight line is greater than the threshold, it is determined as the target line and control the sweeper to rotate to the target direction of travel. To reduce scans and collisions.
Improve the accuracy of the extraction of obstacle profiles and reduce the leakage and collision of the sweeper during the cleaning process.
Smart Images

Figure CN118902337A_ABST
Abstract
Description
Technical Field
[0001] The present application relates to the field of intelligent robot technology, and in particular to a control method and device for a sweeping robot and a sweeping robot. Background Art
[0002] The current method of edge cleaning by a sweeper is mainly to align the movement direction of the sweeper with the outline of the obstacle or the tangent direction of the obstacle outline. However, the current method of extracting the obstacle outline by a sweeper may misjudge the shape or structure of complex objects, especially when encountering obstacles with angular edges. The original angular obstacle outline may be simplified into a straight line, resulting in inaccurate determination of the obstacle outline. In the process of cleaning according to the simplified obstacle outline, there may be omissions or collisions with obstacles. Summary of the invention
[0003] In view of this, the present application provides a sweeping machine control method, device and sweeping machine to reduce the situation where the sweeping machine misses sweeping or collides with obstacles.
[0004] The technical solutions provided by this application are as follows:
[0005] According to an embodiment of the first aspect of the present application, a sweeping machine control method is proposed, which is applied to the sweeping machine. The method includes:
[0006] Determine a target obstacle point set according to the obtained obstacle map and the obtained first emergency point, wherein the target obstacle point set includes a plurality of obstacle points in the moving direction of the sweeper, and a distance between the first emergency point and the sweeper is less than or equal to a first threshold;
[0007] Determining a first point set and a second point set from the target obstacle point set, wherein the first point set includes obstacle points located on one side of the first emergency point, and the second point set includes obstacle points located on the other side of the first emergency point;
[0008] If a first straight line is successfully fitted according to the first point set, and a second straight line is successfully fitted according to the second point set, then if the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is greater than a second threshold, the first straight line or the second straight line is determined as a target straight line;
[0009] If the first rotation angle is within the configured angle range, the direction pointed by the target straight line is determined as the first target travel direction of the sweeping machine; wherein the first rotation angle is the angle between the current travel direction of the sweeping machine and the direction pointed by the target straight line;
[0010] The sweeper is controlled to rotate to the first target traveling direction.
[0011] Optionally, determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point includes:
[0012] Taking the first emergency point obtained as a reference point, determining a target obstacle point adjacent to the reference point and having a distance from the reference point less than or equal to a third threshold based on the obstacle map, taking the target obstacle point as a reference point, returning to the step of determining a target obstacle point adjacent to the reference point in the obstacle map and having a distance from the reference point less than or equal to the third threshold, until there is no target obstacle point with a distance from the reference point less than or equal to the third threshold, or the number of determined target obstacle points reaches a fourth threshold; wherein the first emergency point is determined according to the current posture of the sweeper and the obstacle map;
[0013] The first emergency point and a set of all target obstacle points are determined as a target obstacle point set.
[0014] Optionally, before determining the first point set and the second point set from the target obstacle point set, the method further includes:
[0015] Fitting a reference straight line according to the target obstacle point set;
[0016] In the case where the reference straight line fitting is successful, the step of determining a first point set and a second point set from the target obstacle point set is performed;
[0017] The method further comprises:
[0018] If fitting the first straight line according to the first point set fails and / or fitting the second straight line according to the second point set fails, or the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is less than or equal to a second threshold, the reference straight line is determined as the target straight line.
[0019] Optionally, when the reference straight line fitting fails, or when the first rotation angle is not within a configured angle range, the method further includes:
[0020] If the vertical distance between the sweeping machine and the obtained target wall line is less than a fifth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0021] Among them, the target wall line is determined based on point cloud data collected by a laser radar sensor deployed above the sweeper.
[0022] Optionally, the method for determining the target wall line includes:
[0023] Determine a straight line segment set according to the point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0024] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0025] The candidate wall line that is closest to the sweeping machine in vertical distance is determined as the target wall line.
[0026] Optionally, the method further includes:
[0027] If the vertical distance between the cleaning robot and the target wall line is greater than or equal to a fifth threshold, determining the normal direction of the line connecting the center of the cleaning robot and the first emergency point;
[0028] The first target travel direction is determined based on the normal direction.
[0029] Optionally, before determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point, the method further includes:
[0030] Determining a first emergency point according to the current position of the sweeper and the obstacle map;
[0031] Determine a straight line segment set according to point cloud data collected by a laser radar sensor deployed above the sweeper, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0032] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0033] Determine the candidate wall line that is closest to the sweeper in vertical distance as the target wall line;
[0034] The method further comprises:
[0035] If a straight line segment set is not determined according to the point cloud data collected by the laser radar sensor, or a candidate wall line is not determined from the straight line segment set, the step of determining a target obstacle point set according to the obtained obstacle map and the obtained first emergency point is performed;
[0036] When the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is less than an eighth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0037] When the target wall line is determined, if it is determined that the vertical distance between the sweeper and the target wall line is greater than or equal to an eighth threshold, the step of determining the target obstacle point set based on the obtained obstacle map and the obtained first emergency point is executed.
[0038] Optionally, after controlling the sweeping machine to rotate to the first target traveling direction, the method further includes:
[0039] If a second emergency point is determined based on the current position of the sweeping machine and the obtained obstacle map, the second target travel direction of the sweeping machine is determined based on the second emergency point to control the sweeping machine to rotate to the second target travel direction until the sweeping machine fails to determine the second emergency point based on the current position of the sweeping machine and the obtained obstacle map after the rotation is completed, or the sweeping machine rotates continuously for a preset number of times without moving.
[0040] According to an embodiment of the second aspect of the present application, a sweeping machine control device is provided, which is applied to the sweeping machine, and the device includes:
[0041] A determination unit, configured to determine a target obstacle point set according to the obtained obstacle map and the obtained first emergency point, wherein the target obstacle point set includes a plurality of obstacle points in a moving direction of the sweeper, and a distance between the first emergency point and the sweeper is less than or equal to a first threshold;
[0042] Determining a first point set and a second point set from the target obstacle point set, wherein the first point set includes obstacle points located on one side of the first emergency point, and the second point set includes obstacle points located on the other side of the first emergency point;
[0043] a fitting unit, configured to, if a first straight line is successfully fitted according to the first point set, and a second straight line is successfully fitted according to the second point set, determine the first straight line or the second straight line as a target straight line if an absolute value of a difference between a slope of the first straight line and a slope of the second straight line is greater than a second threshold;
[0044] A control unit, used for determining the direction pointed by the target straight line as the first target travel direction of the sweeping machine if the first rotation angle is within the configured angle range; wherein the first rotation angle is the angle between the current travel direction of the sweeping machine and the direction pointed by the target straight line; and controlling the sweeping machine to rotate to the first target travel direction.
[0045] Optionally, the determining unit is specifically configured to:
[0046] Taking the first emergency point obtained as a reference point, determining a target obstacle point adjacent to the reference point and having a distance from the reference point less than or equal to a third threshold based on the obstacle map, taking the target obstacle point as a reference point, returning to the step of determining a target obstacle point adjacent to the reference point in the obstacle map and having a distance from the reference point less than or equal to the third threshold, until there is no target obstacle point with a distance from the reference point less than or equal to the third threshold, or the number of determined target obstacle points reaches a fourth threshold; wherein the first emergency point is determined according to the current posture of the sweeper and the obstacle map;
[0047] The first emergency point and a set of all target obstacle points are determined as a target obstacle point set.
[0048] Optionally, before determining the first point set and the second point set from the target obstacle point set, the determining unit is further configured to:
[0049] Fitting a reference straight line according to the target obstacle point set;
[0050] In the case where the reference straight line fitting is successful, the step of determining a first point set and a second point set from the target obstacle point set is performed;
[0051] If fitting the first straight line according to the first point set fails and / or fitting the second straight line according to the second point set fails, or the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is less than or equal to a second threshold, determining the reference straight line as the target straight line;
[0052] Optionally, when the reference straight line fitting fails, or when the first rotation angle is not within a configured angle range, the control unit is specifically configured to:
[0053] If the vertical distance between the sweeping machine and the obtained target wall line is less than a fifth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0054] Among them, the target wall line is determined based on point cloud data collected by a laser radar sensor deployed above the sweeper.
[0055] Optionally, the method for determining the target wall line includes:
[0056] Determine a straight line segment set according to the point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0057] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0058] The candidate wall line that is closest to the sweeping machine in vertical distance is determined as the target wall line.
[0059] Optionally, the control unit is further used for:
[0060] If the vertical distance between the cleaning robot and the target wall line is greater than or equal to a fifth threshold, determining the normal direction of the line connecting the center of the cleaning robot and the first emergency point;
[0061] The first target travel direction is determined based on the normal direction.
[0062] Optionally, before determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point, the determining unit is further used to:
[0063] Determining a first emergency point according to the current position of the sweeper and the obstacle map;
[0064] Determine a straight line segment set according to the point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0065] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0066] Determine the candidate wall line that is closest to the sweeper in vertical distance as the target wall line;
[0067] If a straight line segment set is not determined according to the point cloud data collected by the laser radar sensor, or a candidate wall line is not determined from the straight line segment set, the step of determining a target obstacle point set according to the obtained obstacle map and the obtained first emergency point is performed;
[0068] When the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is less than an eighth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0069] When the target wall line is determined, if it is determined that the vertical distance between the sweeper and the target wall line is greater than or equal to an eighth threshold, the step of determining the target obstacle point set based on the obtained obstacle map and the obtained first emergency point is executed.
[0070] Optionally, after controlling the sweeping machine to rotate to the first target traveling direction, the control unit is further configured to:
[0071] If a second emergency point is determined based on the current position of the sweeping machine and the obtained obstacle map, the second target travel direction of the sweeping machine is determined based on the second emergency point to control the sweeping machine to rotate to the second target travel direction until the sweeping machine fails to determine the second emergency point based on the current position of the sweeping machine and the obtained obstacle map after the rotation is completed, or the sweeping machine rotates continuously for a preset number of times without moving.
[0072] According to an embodiment of the third aspect of the present application, a sweeping machine is provided, comprising:
[0073] A controller, configured to execute the method according to the first aspect;
[0074] A heterogeneous sensor is used to collect data on a target scene; wherein the heterogeneous sensor includes at least one of the following: a lidar sensor deployed above the sweeper; a line laser sensor deployed in front of the sweeper; a distance sensor deployed on the side of the sweeper.
[0075] It can be seen from the above technical solution that the present application determines the target obstacle point set through the obtained obstacle map and the obtained first emergency point, and determines the first point set located on one side of the first emergency point and the second point set located on the other side of the first emergency point in the target obstacle point set, and performs straight line fitting on the first point set and the second point set respectively, which is equivalent to fitting the obstacle contour lines on both sides of the emergency point respectively. If the first point set can be successfully fitted into the first straight line and the second point set can be successfully fitted into the second straight line, and the difference in slope between the first straight line and the second straight line is large, it indicates that the obstacle is an angular obstacle. For an object, it is necessary to describe the outline of the obstacle by different straight lines on both sides, thereby improving the accuracy of obstacle contour extraction; further, the first straight line or the second straight line is determined as the target straight line, and if the rotation angle of the sweeper from the current travel direction to the direction pointed by the target straight line is within the allowable rotation angle range, then the direction pointed by the target straight line is determined as the first target travel direction. After determining the first target travel direction, the sweeper is controlled to rotate to the first target travel direction, so as to control the sweeper to clean along the obstacle outline, thereby reducing the situation where the sweeper misses or collides with the obstacle. BRIEF DESCRIPTION OF THE DRAWINGS
[0076] The accompanying drawings, which are incorporated in and constitute a part of the specification, illustrate embodiments consistent with the present application and, together with the description, serve to explain the principles of the present application.
[0077] Figure 1 A flowchart of a sweeping machine control method provided in an embodiment of the present application;
[0078] Figure 2 A schematic diagram of the installation positions of the sweeper and heterogeneous sensors provided in the embodiment of the present application;
[0079] Figure 3 A schematic diagram of contour fitting provided in an embodiment of the present application;
[0080] Figure 4 A schematic diagram of the area division of a sweeper provided in an embodiment of the present application;
[0081] Figure 5 A schematic diagram of extracting a target wall line from a straight line segment provided in an embodiment of the present application;
[0082] Figure 6 A schematic diagram of calculating the rotation angle of an object with a small or medium radius provided in an embodiment of the present application;
[0083] Figure 7 The overall flow chart of the sweeping machine control method provided in the embodiment of the present application;
[0084] Figure 8 A schematic diagram of the structure of an electronic device provided in an embodiment of the present application;
[0085] Fig. 9 A structural diagram of a sweeping machine control device provided in an embodiment of the present application. DETAILED DESCRIPTION
[0086] In order to enable those skilled in the art to better understand the technical solutions provided by the embodiments of the present application and to make the above-mentioned purposes, features and advantages of the embodiments of the present application more obvious and understandable, the technical solutions in the embodiments of the present application are further described in detail below in conjunction with the accompanying drawings.
[0087] Please refer to Figure 1 , Figure 1 A flowchart of a sweeping machine control method provided in an embodiment of the present application, the method comprising:
[0088] Step 101: determine a target obstacle point set according to the obtained obstacle map and the obtained first emergency point.
[0089] The target obstacle point set includes multiple obstacle points in the moving direction of the sweeping machine, and the distance between the first emergency point and the sweeping machine is less than or equal to a first threshold.
[0090] In this embodiment, the determined target obstacle point set includes multiple obstacle points in the movement direction of the sweeping machine. The first emergency point can be one of the multiple obstacle points, which refers to an obstacle point whose distance to the sweeping machine is less than or equal to the first threshold and is closest to the sweeping machine. This method can be applied to the controller in the sweeping machine.
[0091] In this embodiment, the method for obtaining the emergency point may be:
[0092] During the movement of the sweeping machine, if it is determined based on the current position of the sweeping machine and the obtained obstacle map that the sweeping machine will collide with any obstacle if it continues to move in the current direction of travel, and the distance between the point closest to the sweeping machine among the obstacle points included in the obstacle and the sweeping machine is less than or equal to the first threshold, then the point closest to the sweeping machine is determined to be the emergency point.
[0093] In other words, in this embodiment, the emergency point refers to the collision point where the sweeping machine collides with an obstacle within a preset distance when the sweeping machine continues to travel in the current direction of travel.
[0094] As an embodiment, the method for determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point may include:
[0095] Taking the first emergency point obtained as a reference point, determining a target obstacle point adjacent to the reference point and having a distance from the reference point less than or equal to a third threshold based on the obstacle map, taking the target obstacle point as a reference point, returning to the step of determining a target obstacle point adjacent to the reference point in the obstacle map and having a distance from the reference point less than or equal to the third threshold, until there is no target obstacle point with a distance from the reference point less than or equal to the third threshold, or the number of determined target obstacle points reaches a fourth threshold; wherein the first emergency point is determined according to the current position and posture of the sweeper and the obstacle map;
[0096] The first emergency point and a collection of all target obstacle points are determined as a target obstacle point set.
[0097] In this embodiment, the obstacle map may be constructed based on data collected by multiple heterogeneous sensors deployed on the sweeper. Exemplarily, the heterogeneous sensors may include a lidar sensor, a line laser sensor, and a distance sensor.
[0098] Combine the following Figure 2 A sweeping machine proposed in this embodiment is briefly introduced.
[0099] Please refer to Figure 2 , Figure 2 This is a schematic diagram of the installation position of the sweeping machine and detection sensor provided in an embodiment of the present application.
[0100] like Figure 2 As shown, three heterogeneous sensors are deployed on the sweeper, namely, a lidar sensor, which is deployed above the sweeper; a line laser sensor, which is deployed in front of the sweeper; and a distance sensor, which is deployed on the side of the sweeper.
[0101] In this embodiment, the distance sensor is deployed on the right side of the sweeper, and the sweeper cleans along the edge of the target scene from the right side. It is easy to understand that if the distance sensor is deployed on the left side of the sweeper, the sweeper can clean along the edge of the target scene from the left side. This application does not limit this.
[0102] In this embodiment, the distance sensor may be a position sensitive detector (PSD sensor) or a time of flight sensor (TOF sensor), which is used to determine the distance between the sensor and an obstacle in the target scene, and the present application does not impose any limitation on this.
[0103] In this embodiment, the effective detection distance of the laser radar sensor is relatively far, while the detection distance of the line laser sensor and the distance sensor is relatively short, and they can only detect obstacles within a relatively short distance range. Among them, the line laser sensor is used to detect the obstacle distance within a fan-shaped plane, and the distance sensor is generally used to detect the obstacle distance on the ray emitted from the emission point.
[0104] In this embodiment, the process of constructing an obstacle map by using heterogeneous sensors is a common method in the related art and will not be described in detail here.
[0105] This concludes Figure 2 Description of the installation location of the sweeper and heterogeneous sensors.
[0106] In this embodiment, after constructing an obstacle map through data collected by heterogeneous sensors deployed on the sweeping robot, the first emergency point can be determined according to the current position of the sweeping robot and the obstacle map. The method for determining the first emergency point has been described in detail above and will not be repeated here.
[0107] After determining the first emergency point, the target obstacle point set can be determined based on the first emergency point and the obstacle map. Specifically, in this embodiment, with the first emergency point as the center, adjacent points are diffused to the left and right directions of the sweeper at a certain threshold distance ε1 (third threshold) until the distance between two adjacent points in the left and right directions exceeds the third threshold ε1 or the number of extracted points exceeds the fourth threshold τ1. The set of the emergency point and the diffused adjacent points is determined as the target obstacle point set.
[0108] At this point, the description of step 101 ends, and step 102 is executed next.
[0109] Step 102: determine a first point set and a second point set from the target obstacle point set.
[0110] The first point set includes obstacle points located on one side of the emergency point, and the second point set includes obstacle points located on the other side of the emergency point.
[0111] In this embodiment, when the target obstacle point set is determined through step 101, a first point set corresponding to the obstacle points located on one side of the emergency point and a second point set corresponding to the obstacle points located on the other side of the emergency point can be determined from the target obstacle point set.
[0112] At this point, the description of step 102 ends, and step 103 is executed next.
[0113] Step 103, if the first straight line is successfully fitted according to the first point set, and the second straight line is successfully fitted according to the second point set, then if the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is greater than a second threshold, the first straight line or the second straight line is determined as the target straight line.
[0114] In this embodiment, after determining the first point set and the second point set from the target obstacle point set through step 102, straight line fitting can be performed on the obstacle points included in the first point set, and straight line fitting can be performed on the obstacle points included in the second point set, which is equivalent to extracting the obstacle contour lines on both sides of the emergency point, that is, the collision point where the sweeper continues to move in the current direction of travel and collides with the obstacle.
[0115] In this embodiment, if the obstacle points included in the first point set are successfully fitted into a first straight line, and the obstacle points included in the second point set are successfully fitted into a second straight line, it is further determined whether the absolute value of the slope difference between the first straight line and the second straight line is greater than a preset second threshold.
[0116] In this embodiment, if the absolute value of the difference in slope between the first straight line and the second straight line is greater than the second threshold, it indicates that the difference in slope between the first straight line and the second straight line is large, and the directions of the obstacle contour lines corresponding to the two are completely different, indicating that the obstacle has edges and corners near the emergency point. At this time, the first straight line or the second straight line can be determined as the target straight line according to the cleaning method of the sweeper (cleaning along the right edge or cleaning along the left edge).
[0117] For example, if the sweeping machine cleans along the right edge, a straight line fitted from the point set located on the left side of the emergency point, such as the first straight line, can be used as the target straight line; if the sweeping machine cleans along the left edge, a straight line fitted from the point set located on the right side of the emergency point, such as the second straight line, can be used as the target straight line. This application does not impose any restrictions on this.
[0118] Combine the following Figure 3 The contour fitting process is briefly described.
[0119] Please refer to Figure 3 , Figure 3 A schematic diagram of contour fitting provided in an embodiment of the present application.
[0120] like Figure 3 As shown, the obstacles in the figure are angular obstacles. If the contour line of the obstacle is fitted according to the contour line fitting method in the relevant technology, all obstacle points included in the determined obstacle point set (i.e., multiple obstacle points in the figure) will be fitted with an overall straight line, and the fitted straight line is the overall fitting straight line in the figure.
[0121] In the related art, the overall fitting straight line is directly determined as the outline of the obstacle, and then the sweeper is controlled to rotate and further clean along the direction pointed by the overall fitting straight line. It is foreseeable that the sweeper rotates and further cleans along the direction pointed by the overall fitting straight line, which actually ignores the actual shape of the obstacle, and will miss the parts on both sides of the corners of the obstacle during the cleaning process.
[0122] According to the method provided in the embodiment of the present application, after determining the emergency point (i.e., the point on the obstacle that is closest to the sweeper), the target obstacle point set is determined according to the emergency point, and the target obstacle point set is divided into a first point set located on the left side of the emergency point and a second point set located on the right side of the emergency point, and straight line fitting is performed on the first point set and the second point set, respectively.
[0123] If the absolute value of the slope difference between the first straight line fitted by the first point set and the second straight line fitted by the second point set is greater than the second threshold, it indicates that the distribution of the obstacle contour lines on the left and right sides of the emergency point is very different, and it cannot be simply fitted by a straight line. Instead, the obstacle contours on the left and right sides of the emergency point need to be fitted separately, with the first straight line corresponding to the obstacle contour on the left side of the emergency point, and the second straight line corresponding to the obstacle contour on the right side of the emergency point.
[0124] After determining the obstacle outline, Figure 3 The sweeper in the figure is a sweeper that cleans along the right side of the target scene, so at this time, the contour line on the left side of the emergency point, that is, the first straight line, can be selected as the target straight line.
[0125] This concludes Figure 3 Description of the mid-contour fitting schematic.
[0126] In this embodiment, before determining the first point set and the second point set from the target obstacle point set, the sweeping machine control method may further include:
[0127] Fitting a reference straight line according to the target obstacle point set;
[0128] When the reference straight line fitting is successful, the step of determining the first point set and the second point set from the target obstacle point set is performed;
[0129] If fitting the first straight line according to the first point set fails and / or fitting the second straight line according to the second point set fails, or the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is less than or equal to the second threshold, the reference straight line is determined as the target straight line.
[0130] In this embodiment, after the target obstacle point set is determined, a reference straight line may be fitted according to all obstacle points included in the target obstacle point set, that is, a relatively rough obstacle contour may be fitted through all obstacle points included in the target obstacle point set.
[0131] When the reference straight line is successfully fitted, the step of determining the first point set and the second point set from the target obstacle point set is performed to fit the obstacle contours on the left and right sides of the emergency point respectively.
[0132] If at least one of the first straight line and the second straight line fails to fit, for example, the number of obstacle points included in at least one of the first point set and the second point set is less than the preset threshold τ2, at least one of the first straight line and the second straight line cannot be successfully fitted. At this time, the reference straight line can be used as the target straight line.
[0133] If both the first straight line and the second straight line are fitted successfully, but the absolute value of the difference in slope between the first straight line and the second straight line is less than or equal to the second threshold, it indicates that the directions of the obstacle contour lines on both sides of the emergency point are basically the same. At this time, the reference straight line that uses more obstacle points for fitting can be used as the target straight line.
[0134] In this embodiment, the method for performing straight line fitting may be the least squares method, which is not limited in this application.
[0135] At this point, the description of step 103 ends, and step 104 is executed next.
[0136] Step 104: If the first rotation angle is within the configured angle range, the direction pointed by the target straight line is determined as the first target moving direction of the sweeping robot.
[0137] The first rotation angle is the angle between the current moving direction of the sweeping machine and the direction in which the target straight line points.
[0138] In this embodiment, different areas in the direction of the sweeping machine can be pre-defined, for example, the area in the direction of the sweeping machine can be divided into a left area, a middle area, and a right area, and a minimum angle R that the sweeping machine can rotate can be pre-set for each area. min and the maximum angle R max , that is, the configured angle range is [R min , R max ]. The configured angle range is determined according to the area where the emergency point is located.
[0139] According to the following Figure 4 The method of dividing the area in the moving direction of the sweeper is briefly introduced.
[0140] Please refer to Figure 4 , Figure 4 This is a schematic diagram of the sweeper area division.
[0141] like Figure 4 As shown, the sweeper is pre-divided into three areas in the current direction of travel, the left area, the right area and the middle area. Each area is pre-configured with a corresponding angle range. For example, the middle area is configured with the minimum angle R that the sweeper can rotate. min is 60°, the maximum angle R max If the angle is 120°, and the emergency point is in the middle area, the configured angle range is [60°, 120°].
[0142] This concludes Figure 4 Description of the schematic diagram of the area division of the sweeper.
[0143] In this embodiment, after the target straight line is determined through step 103, it can be determined whether the first rotation angle of the sweeping machine from the current travel direction to the direction pointed by the target straight line is within the configured angle range; if so, it indicates that the sweeping machine can rotate to the direction pointed by the target straight line, and at this time, the direction pointed by the target straight line can be determined as the first target travel direction of the sweeping machine.
[0144] In this embodiment, when the reference straight line fitting fails or the first rotation angle is not within the configured angle range, the method further includes:
[0145] If the vertical distance between the sweeping machine and the obtained target wall line is less than a fifth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0146] Among them, the target wall line is determined based on the point cloud data collected by the lidar sensor deployed above the sweeper.
[0147] In this embodiment, if the reference straight line fitting fails, or the first rotation angle of the sweeper from the current travel direction to the direction pointed by the target straight line is not within the configured angle range, it indicates that the obstacle contour line has not been determined at this time, or the determined obstacle contour line is abnormal (for example, the obstacle is in a suspended position).
[0148] At this time, the first target moving direction of the sweeping machine can be determined based on the relationship between the sweeping machine and the target wall line.
[0149] Specifically, the method for determining the target wall line may include:
[0150] Determine a straight line segment set according to point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0151] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0152] The candidate wall line with the shortest vertical distance to the sweeper is determined as the target wall line.
[0153] In this embodiment, the laser radar detection data over a period of time can be collected through the Slam module deployed in the sweeper, and the collected data can be fitted with straight line segments to obtain a straight line segment set, wherein the length of each straight line segment in the straight line segment set must not be less than L, and the distance between two adjacent points on the straight line segment must not exceed ε2. Further, using the configured rotation angle range, the straight line segment whose second rotation angle required for the sweeper to align with the straight line segment included in the straight line segment set (rotate to the direction pointed by the straight line segment) is within the configured rotation angle range is determined from the straight line segment set as a candidate wall line, and the candidate wall line with the closest vertical distance to the sweeper is determined as the target wall line.
[0154] Combine the following Figure 5 The extraction of target wall line is briefly introduced.
[0155] Please refer to Figure 5 , Figure 5 A schematic diagram of extracting a target wall line from a straight line segment provided in an embodiment of the present application.
[0156] like Figure 5 As shown, the points in the figure are the position points included in the point cloud data collected by the laser radar. A set of straight line segments is fitted according to the position points. After the sweeper determines the emergency point, it determines the configured angle range.
[0157] For each straight line segment in the straight line segment set, determine whether the second rotation angle required for the sweeper to align with it is within the configured rotation angle range. If so, the straight line segment is used as a candidate wall line, and finally the wall line with the closest vertical distance to the sweeper among the candidate wall lines is selected as the target wall line.
[0158] This concludes Figure 5 Description of the target wall line extraction method.
[0159] After determining the target wall line, if the vertical distance between the sweeping machine and the obtained target wall line is less than the fifth threshold, it indicates that the distance between the sweeping machine and the target wall line is very close, and there are no other obstacles between the sweeping machine and the target wall line. At this time, the direction of the target wall line can be determined as the first target travel direction.
[0160] As an embodiment, the method may further include:
[0161] If the vertical distance between the sweeping robot and the target wall line is greater than or equal to the fifth threshold, determining the normal direction of the line connecting the center of the sweeping robot and the first emergency point;
[0162] A first target travel direction is determined based on the normal direction.
[0163] In this embodiment, if the vertical distance between the sweeping machine and the target wall line is greater than or equal to the fifth threshold, it indicates that there are other obstacles between the sweeping machine and the target wall line, and the contour line of the obstacle has not been extracted before, indicating that the obstacle is a small or medium-sized radius object whose contour line is not easy to extract, such as table legs, chair legs, etc.
[0164] At this time, the normal direction of the line connecting the center of the sweeping robot and the emergency point can be determined, and the first target moving direction can be determined based on the normal direction.
[0165] In this embodiment, the first target moving direction may be the normal direction mentioned above, or may be a direction offset based on the normal direction, and this application does not impose any limitation on this.
[0166] Combine the following Figure 6 This paper briefly introduces the method of calculating the rotation angle of objects with small and medium radius.
[0167] Please refer to Figure 6 , Figure 6 A schematic diagram of calculating the rotation angle of objects with small and medium radii provided in an embodiment of the present application.
[0168] like Figure 6 As shown, when it is determined that the vertical distance between the sweeping machine and the target wall line is greater than or equal to the fifth threshold, that is, when there are other obstacles between the sweeping machine and the target wall line, but the contour of the obstacle is not extracted, it indicates that the obstacle may be a small or medium-sized radius object whose contour is difficult to extract. At this time, the normal direction of the line connecting the center of the sweeping machine and the emergency point can be directly used as the target travel direction to prevent the sweeping machine from continuing to move forward after the rotation is completed and colliding with the emergency point again.
[0169] This concludes Figure 6 Description of the method for calculating the rotation angle of objects with small and medium sized radii.
[0170] At this point, the description of step 104 ends, and step 105 is executed next.
[0171] Step 105, controlling the sweeping machine to rotate to a first target moving direction.
[0172] In this embodiment, after the first target traveling direction is determined, the sweeping machine can be further controlled to rotate to the first target traveling direction.
[0173] As an embodiment, after controlling the sweeping machine to rotate to the first target traveling direction, the method may further include:
[0174] If a second emergency point is determined based on the current position of the sweeping machine and the obtained obstacle map, the second target travel direction of the sweeping machine is determined based on the second emergency point to control the sweeping machine to rotate to the second target travel direction until the sweeping machine fails to determine the second emergency point based on the current position of the sweeping machine and the obtained obstacle map after the rotation is completed, or the sweeping machine rotates continuously for a preset number of times without moving.
[0175] In this embodiment, after the sweeping machine is controlled to complete a rotation, the second emergency point can be re-determined according to the current position of the sweeping machine and the obstacle map. If the second emergency point is determined, the second target travel direction of the sweeping machine is determined according to the second emergency point, and the sweeping machine is controlled to rotate to the second target travel direction until the second emergency point is not determined after the rotation is completed, or the sweeping machine rotates a preset number of times (for example, 3 times) without moving.
[0176] In this embodiment, the second emergency point refers to a new emergency point different from the first emergency point. After the second emergency point is determined, the second target travel direction of the sweeper can be determined according to the second emergency point according to the above-mentioned sweeper control method to control the sweeper to rotate to the second target travel direction. The second target travel direction refers to the target travel direction corresponding to the second emergency point. After the sweeper is controlled to rotate to the second target travel direction, a new second emergency point can be re-determined according to the current position of the sweeper and the obstacle map until the second emergency point is not determined after the rotation is completed, or the sweeper rotates a preset number of times (for example, 3 times) without moving.
[0177] In this embodiment, the method for determining the second emergency point is exactly the same as the method for determining the first emergency point, which has been described in detail above and will not be repeated here.
[0178] In this embodiment, this method of continuous iterative adjustment can achieve accurate obstacle avoidance during the edge cleaning process of the sweeper, ensuring safety and reliability, so as to improve the smoothness of the sweeper's movement during the cleaning process. Generally speaking, in most environments in complex home environments, the sweeper will not rotate continuously more than 3 times.
[0179] Finally, the PID algorithm can be used to control the sweeper to move forward and keep it at a certain distance from the obstacle until a new emergency point is determined or the edge cleaning task is terminated.
[0180] In this embodiment, the process of using the PID algorithm to control the forward movement of the sweeping machine is a common method in the related art and will not be described in detail here.
[0181] This concludes the description of step 105.
[0182] In this embodiment, before determining the target obstacle point set according to the obtained obstacle map, the method further includes:
[0183] Determine the first emergency point based on the current position of the sweeper and the obstacle map;
[0184] Determine a straight line segment set according to point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0185] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0186] The candidate wall line with the shortest vertical distance to the sweeper is determined as the target wall line;
[0187] The method may further include:
[0188] If a straight line segment set is not determined according to the point cloud data collected by the laser radar sensor, or a candidate wall line is not determined from the straight line segment set, a step of determining a target obstacle point set according to the obtained obstacle map is performed;
[0189] When the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is less than an eighth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0190] When the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is greater than or equal to the eighth threshold, a step of determining a target obstacle point set according to the obtained obstacle map is performed.
[0191] In this embodiment, before executing step 101, the first emergency point can be determined according to the current position of the sweeping robot and the obstacle map.
[0192] Furthermore, a set of straight line segments is determined based on the point cloud data collected by the laser radar sensor, and a straight line segment in the set of straight line segments that meets the configured angle range requirement and has the shortest vertical distance to the sweeper is determined as the target wall line.
[0193] The process of determining the target wall line has been described in detail above and will not be repeated here.
[0194] In this embodiment, when a set of straight line segments is not determined based on the point cloud data collected by the lidar sensor, or a candidate wall line is not determined from the set of straight line segments, it indicates that there is an obstacle blocking the current direction of travel of the sweeper. At this time, step 101 can be executed, that is, the process of detecting the obstacle contour line.
[0195] In this embodiment, when the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is less than the eighth threshold, it means that the distance between the sweeping machine and the target wall line is very small. At this time, it is considered that there is no obstacle between the sweeping machine and the target wall line, and the direction of the target wall line can be directly determined as the first target travel direction.
[0196] In this embodiment, when the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is greater than or equal to the eighth threshold, it indicates that the distance between the sweeping machine and the target wall line is large, and there may still be obstacles between the sweeping machine and the target wall line. At this time, step 101 is executed, that is, the process of detecting the obstacle contour is performed.
[0197] This concludes Figure 1 Description of the process of the sweeper control method.
[0198] The present application determines the target obstacle point set through the obtained obstacle map, and determines the first point set located on one side of the first emergency point and the second point set located on the other side of the first emergency point in the target obstacle point set, and performs straight line fitting on the first point set and the second point set respectively, which is equivalent to fitting the obstacle contour lines on both sides of the emergency point respectively. If the first point set can be successfully fitted into the first straight line and the second point set can be successfully fitted into the second straight line, and the difference in slope between the first straight line and the second straight line is large, it indicates that the obstacle is an angular obstacle, and the obstacle contour needs to be described by different straight lines on both sides, thereby improving the accuracy of obstacle contour line extraction; further, the first straight line or the second straight line is determined as the target straight line, and if the rotation angle of the sweeper from the current travel direction to the direction pointed by the target straight line is within the allowable rotation angle range, then the direction pointed by the target straight line is determined as the first target travel direction. After determining the first target travel direction, the sweeper is controlled to rotate to the first target travel direction, so as to control the sweeper to clean along the obstacle contour, thereby reducing the situation where the sweeper misses or collides with the obstacle.
[0199] This application builds an obstacle map in real time by fusing the detection information of heterogeneous sensors, and constructs a Slam module to separately collect the detection information of the lidar to assist the edge cleaning motion control of the sweeper.
[0200] Furthermore, the present application also proposes a method for controlling the sweeping machine to rotate and then perform emergency point detection, and iteratively adjust the rotation angle of the sweeping machine. This method can help the sweeping machine to achieve precise obstacle avoidance during edge cleaning better and faster, and improve the movement smoothness of the sweeping machine in edge cleaning tasks.
[0201] According to the following Figure 7 The provided overall flow chart of the sweeping machine control method provides an overall description of the sweeping machine control method in the embodiment of the present application.
[0202] Please refer to Figure 7 , Figure 7 This is an overall flow chart of the sweeping machine control method provided in the embodiment of the present application.
[0203] like Figure 7 As shown, in this embodiment, after the first emergency point is determined and the configured rotation angle range is determined according to the preset area where the first emergency point is located, the laser radar detection data is obtained through the Slam module to determine the target wall line.
[0204] A straight line segment set is formed based on the position points included in the point cloud data obtained from the laser radar detection data. If the straight line segment set is fitted successfully and there is a straight line segment that meets the configured rotation angle requirement, the straight line segment that is closest to the vertical distance of the sweeper among the straight line segments that meet the rotation angle will be used as the target wall line.
[0205] It is further determined whether the distance between the sweeping machine and the target wall line is less than a preset threshold value 1. If so, it indicates that there is no obstacle between the sweeping machine and the target wall line. At this time, the direction pointed by the target wall line can be directly used as the first target travel direction (alignment direction) and the sweeping machine can be controlled to rotate.
[0206] If the fitting of the straight line segment set is unsuccessful, or there is no straight line segment that meets the rotation angle requirement, or the distance between the sweeper and the target wall line is greater than or equal to the preset threshold 1, the target obstacle point set is obtained according to the obstacle map and the emergency point to determine the contour of the obstacle.
[0207] The process of determining the obstacle contour line based on the target obstacle point set has been described in detail above and will not be repeated here.
[0208] If the obstacle contour line can be extracted according to the target obstacle point set, and the contour line meets the rotation angle requirement, the direction pointed by the contour line is used as the first target travel direction, and the sweeper is controlled to rotate.
[0209] If the obstacle contour line is not extracted according to the target obstacle point set, or the extracted contour line does not meet the rotation angle requirement, it is determined whether the distance between the sweeper and the target wall line is less than a preset threshold 2, where the preset threshold 2 is greater than the preset threshold 1.
[0210] If it is less than, it indicates that there is no obstacle between the sweeper and the wall line. At this time, the direction pointed by the target wall line is directly used as the first target travel direction, and the sweeper is controlled to rotate.
[0211] If it is greater than or equal to, the first target travel direction is determined according to the normal direction of the line connecting the emergency point and the center position of the sweeping machine, and the sweeping machine is controlled to rotate.
[0212] After controlling the sweeper to rotate, it is possible to further detect whether the second emergency point can be determined based on the current position of the sweeper and the obtained obstacle map. If the second emergency point is detected, and it is determined that the sweeper has not rotated continuously for a preset number of times without moving, the second target travel direction of the sweeper is determined based on the second emergency point. If the second emergency point is not detected, or it is determined that the sweeper has rotated continuously for a preset number of times without moving, the sweeper is controlled to clean according to the PID algorithm.
[0213] This concludes Figure 7 Description of the overall flow chart of the sweeper control method.
[0214] Please refer to Figure 8 , Figure 8 It is a schematic structural diagram of an electronic device proposed in an embodiment of the present application. At the hardware level, the electronic device includes a processor, an internal bus, a network interface, a memory, and a non-volatile memory, and of course may also include hardware required for other services. The processor reads the corresponding computer program from the non-volatile memory into the memory and then runs it, forming a terminal interaction device at the logical level. Of course, in addition to the software implementation method, this application does not exclude other implementation methods, such as logic devices or a combination of software and hardware, etc., that is to say, the execution subject of the following processing flow is not limited to each logic unit, but can also be hardware or logic devices.
[0215] Please refer to Fig. 9 , Fig. 9 1 is a structural diagram of a sweeping machine control device proposed in an embodiment of the present application, and the device is applied to a sweeping machine. Fig. 9 As shown, the sweeping machine control device may include a determination unit 901, a fitting unit 902, and a control unit 903. Specifically, the device includes:
[0216] A determination unit 901 is used to determine a target obstacle point set according to the obtained obstacle map and the obtained first emergency point, where the target obstacle point set includes multiple obstacle points in the moving direction of the sweeper, and the distance between the first emergency point and the sweeper is less than or equal to a first threshold;
[0217] Determine a first point set and a second point set from the target obstacle point set, the first point set includes obstacle points located on one side of the first emergency point, and the second point set includes obstacle points located on the other side of the first emergency point;
[0218] A fitting unit 902, configured to, if the first straight line is successfully fitted according to the first point set, and the second straight line is successfully fitted according to the second point set, determine the first straight line or the second straight line as a target straight line if the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is greater than a second threshold;
[0219] The control unit 903 is used to determine the direction pointed by the target straight line as the first target travel direction of the sweeping machine if the first rotation angle is within the configured angle range; wherein the first rotation angle is the angle between the current travel direction of the sweeping machine and the direction pointed by the target straight line; and control the sweeping machine to rotate to the first target travel direction.
[0220] Optionally, the determining unit 901 is specifically configured to:
[0221] Taking the first emergency point obtained as a reference point, determining a target obstacle point adjacent to the reference point and having a distance from the reference point less than or equal to a third threshold based on the obstacle map, taking the target obstacle point as a reference point, returning to the step of determining a target obstacle point adjacent to the reference point in the obstacle map and having a distance from the reference point less than or equal to the third threshold, until there is no target obstacle point with a distance from the reference point less than or equal to the third threshold, or the number of determined target obstacle points reaches a fourth threshold; wherein the first emergency point is determined according to the current position and posture of the sweeper and the obstacle map;
[0222] The first emergency point and a collection of all target obstacle points are determined as a target obstacle point set.
[0223] Optionally, before determining the first point set and the second point set from the target obstacle point set, the determining unit 901 is further configured to:
[0224] Fitting a reference straight line according to the target obstacle point set;
[0225] When the reference straight line fitting is successful, the step of determining the first point set and the second point set from the target obstacle point set is performed;
[0226] If fitting the first straight line according to the first point set fails and / or fitting the second straight line according to the second point set fails, or the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is less than or equal to the second threshold, the reference straight line is determined as the target straight line;
[0227] Optionally, when the reference straight line fitting fails or the first rotation angle is not within the configured angle range, the control unit 903 is specifically configured to:
[0228] If the vertical distance between the sweeping machine and the obtained target wall line is less than a fifth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0229] Among them, the target wall line is determined based on the point cloud data collected by the lidar sensor deployed above the sweeper.
[0230] Optionally, a method for determining the target wall line includes:
[0231] Determine a straight line segment set according to point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0232] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0233] The candidate wall line with the shortest vertical distance to the sweeper is determined as the target wall line.
[0234] Optionally, the control unit 903 is further configured to:
[0235] If the vertical distance between the sweeping robot and the target wall line is greater than or equal to the fifth threshold, determining the normal direction of the line connecting the center of the sweeping robot and the first emergency point;
[0236] A first target travel direction is determined based on the normal direction.
[0237] Optionally, before determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point, the determining unit 901 is further configured to:
[0238] Determine the first emergency point based on the current position of the sweeper and the obstacle map;
[0239] Determine a straight line segment set according to point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold;
[0240] For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points;
[0241] The candidate wall line with the shortest vertical distance to the sweeper is determined as the target wall line;
[0242] If a straight line segment set is not determined according to the point cloud data collected by the laser radar sensor, or a candidate wall line is not determined from the straight line segment set, a step of determining a target obstacle point set according to the obtained obstacle map and the obtained first emergency point is performed;
[0243] When the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is less than an eighth threshold, the direction pointed by the target wall line is determined as the first target moving direction;
[0244] When the target wall line is determined, if it is determined that the vertical distance between the sweeper and the target wall line is greater than or equal to the eighth threshold, the step of determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point is executed.
[0245] Optionally, after controlling the sweeping machine to rotate to the first target traveling direction, the control unit 903 is further configured to:
[0246] If a second emergency point is determined based on the current position of the sweeping machine and the obtained obstacle map, the second target travel direction of the sweeping machine is determined based on the second emergency point to control the sweeping machine to rotate to the second target travel direction until the sweeping machine fails to determine the second emergency point based on the current position of the sweeping machine and the obtained obstacle map after the rotation is completed, or the sweeping machine rotates continuously for a preset number of times without moving.
[0247] So far, completed Fig. 9 Description of the sweeper controls.
[0248] Correspondingly, in this embodiment, the embodiment of the present application also provides a computer-readable storage medium, on which a number of computer instructions are stored. When the computer instructions are executed, the method disclosed in the above example of the present application can be implemented.
[0249] Exemplarily, the computer-readable storage medium may be any electronic, magnetic, optical or other physical storage device that may contain or store information, such as executable instructions, data, etc. For example, the computer-readable storage medium may be: RAM (Radom Access Memory), volatile memory, non-volatile memory, flash memory, storage drive (such as hard disk drive), solid state drive, any type of storage disk (such as optical disk, DVD, etc.), or similar storage medium, or a combination thereof.
[0250] The above are only preferred embodiments of the present application and are not intended to limit the present application. For those skilled in the art, the present application may have various modifications and variations. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application shall be included in the scope of protection of the present application.
Claims
1. A sweeping machine control method, characterized in that: Applied to a sweeping machine, the method comprises: Determine a target obstacle point set according to the obtained obstacle map and the obtained first emergency point, wherein the target obstacle point set includes a plurality of obstacle points in the moving direction of the sweeper, and a distance between the first emergency point and the sweeper is less than or equal to a first threshold; Determining a first point set and a second point set from the target obstacle point set, wherein the first point set includes obstacle points located on one side of the first emergency point, and the second point set includes obstacle points located on the other side of the first emergency point; If a first straight line is successfully fitted according to the first point set, and a second straight line is successfully fitted according to the second point set, then if the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is greater than a second threshold, the first straight line or the second straight line is determined as a target straight line; If the first rotation angle is within the configured angle range, the direction pointed by the target straight line is determined as the first target travel direction of the sweeping machine; wherein the first rotation angle is the angle between the current travel direction of the sweeping machine and the direction pointed by the target straight line; The sweeper is controlled to rotate to the first target traveling direction.
2. The method according to claim 1, characterized in that: The step of determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point includes: Taking the first emergency point obtained as a reference point, determining a target obstacle point adjacent to the reference point and having a distance from the reference point less than or equal to a third threshold based on the obstacle map, taking the target obstacle point as a reference point, returning to the step of determining a target obstacle point adjacent to the reference point in the obstacle map and having a distance from the reference point less than or equal to the third threshold, until there is no target obstacle point with a distance from the reference point less than or equal to the third threshold, or the number of determined target obstacle points reaches a fourth threshold; wherein the first emergency point is determined according to the current posture of the sweeper and the obstacle map; The first emergency point and a set of all target obstacle points are determined as a target obstacle point set.
3. The method according to claim 1, characterized in that Before determining the first point set and the second point set from the target obstacle point set, the method further includes: Fitting a reference straight line according to the target obstacle point set; In the case where the reference straight line fitting is successful, the step of determining a first point set and a second point set from the target obstacle point set is performed; The method further comprises: If fitting the first straight line according to the first point set fails and / or fitting the second straight line according to the second point set fails, or the absolute value of the difference between the slope of the first straight line and the slope of the second straight line is less than or equal to a second threshold, the reference straight line is determined as the target straight line.
4. The method according to claim 3, characterized in that In the case where the reference straight line fitting fails, or the first rotation angle is not within the configured angle range, the method further includes: If the vertical distance between the sweeping machine and the obtained target wall line is less than a fifth threshold, the direction pointed by the target wall line is determined as the first target moving direction; Among them, the target wall line is determined based on point cloud data collected by a laser radar sensor deployed above the sweeper.
5. The method according to claim 4, characterized in that The method for determining the target wall line comprises: Determine a straight line segment set according to the point cloud data collected by the laser radar sensor, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold; For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points; The candidate wall line that is closest to the sweeping machine in vertical distance is determined as the target wall line.
6. The method according to claim 4, characterized in that The method further comprises: If the vertical distance between the cleaning robot and the target wall line is greater than or equal to a fifth threshold, determining the normal direction of the line connecting the center of the cleaning robot and the first emergency point; The first target travel direction is determined based on the normal direction.
7. The method according to claim 1, characterized in that Before determining the target obstacle point set according to the obtained obstacle map and the obtained first emergency point, the method further includes: Determining a first emergency point according to the current position of the sweeper and the obstacle map; Determine a straight line segment set according to point cloud data collected by a laser radar sensor deployed above the sweeper, the point cloud data includes a plurality of position points, the straight line segment set includes at least one straight line segment, the length of each straight line segment is greater than or equal to a sixth threshold, and the distance between two adjacent position points on each straight line segment is less than or equal to a seventh threshold; For each straight line segment, if the second rotation angle is within the configured angle range, the straight line segment is determined as a candidate wall line; wherein the second rotation angle is the angle between the current moving direction of the sweeper and the direction in which the straight line segment points; Determine the candidate wall line that is closest to the sweeper in vertical distance as the target wall line; The method further comprises: If a straight line segment set is not determined according to the point cloud data collected by the laser radar sensor, or a candidate wall line is not determined from the straight line segment set, the step of determining a target obstacle point set according to the obtained obstacle map and the obtained first emergency point is performed; When the target wall line is determined, if it is determined that the vertical distance between the sweeping machine and the target wall line is less than an eighth threshold, the direction pointed by the target wall line is determined as the first target moving direction; When the target wall line is determined, if it is determined that the vertical distance between the sweeper and the target wall line is greater than or equal to an eighth threshold, the step of determining the target obstacle point set based on the obtained obstacle map and the obtained first emergency point is executed.
8. The method according to claim 1, characterized in that After controlling the sweeping machine to rotate to the first target traveling direction, the method further includes: If a second emergency point is determined based on the current position of the sweeping machine and the obtained obstacle map, the second target travel direction of the sweeping machine is determined based on the second emergency point to control the sweeping machine to rotate to the second target travel direction until the sweeping machine fails to determine the second emergency point based on the current position of the sweeping machine and the obtained obstacle map after the sweeping machine completes the rotation, or the sweeping machine rotates continuously for a preset number of times without moving.
9. A sweeping machine control device, characterized in that: Applied to a sweeping machine, the device comprises: A determination unit, configured to determine a target obstacle point set according to the obtained obstacle map and the obtained first emergency point, wherein the target obstacle point set includes a plurality of obstacle points in a moving direction of the sweeper, and a distance between the first emergency point and the sweeper is less than or equal to a first threshold; Determining a first point set and a second point set from the target obstacle point set, wherein the first point set includes obstacle points located on one side of the first emergency point, and the second point set includes obstacle points located on the other side of the first emergency point; a fitting unit, configured to, if a first straight line is successfully fitted according to the first point set, and a second straight line is successfully fitted according to the second point set, determine the first straight line or the second straight line as a target straight line if an absolute value of a difference between a slope of the first straight line and a slope of the second straight line is greater than a second threshold; A control unit, used for determining the direction pointed by the target straight line as the first target travel direction of the sweeping machine if the first rotation angle is within the configured angle range; wherein the first rotation angle is the angle between the current travel direction of the sweeping machine and the direction pointed by the target straight line; and controlling the sweeping machine to rotate to the first target travel direction.
10. A sweeping machine, characterized in that: include: A controller for executing the method according to any one of claims 1 to 8; A heterogeneous sensor for collecting data on a target scene; wherein the heterogeneous sensor includes at least one of the following: a laser radar sensor deployed above the sweeper; a line laser sensor deployed in front of the sweeper; The distance sensor is deployed on the side of the sweeper.
Citation Information
Patent Citations
Road negative obstacle detection method and system
CN112505724A
Sweeper and control method and device thereof
CN113768420A
Obstacle-avoiding walking method and device of cleaning robot, electronic equipment and medium
CN115137267A
Sweeper control method and device, electronic equipment and medium
CN118236003A
D-type robot turning control method based on obstacle contour
CN118319185A
Cited By
Mobile robot and control method thereof
CN122411442A
Mobile robot and control method thereof
CN122411442B
