Seam path generation method and device, equipment, cleaning robot and storage medium

By smoothing and optimizing the edge-fitting path of the cleaning robot, the problem of uneven path caused by inconsistent boundary contour points was solved, and the overall smoothness and gentleness of the edge-fitting path were improved.

CN119024684BActive Publication Date: 2025-11-28GUANGZHOU SHIYUAN ELECTRONICS CO LTD +1
View PDF 2 Cites 0 Cited by

Patent Information

Application Number
CN202310567334.6
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2023-05-18
Publication Date
2025-11-28
Estimated Expiration
2043-05-18

AI Technical Summary

Technical Problem

When cleaning the boundary of an area, the lack of consistency in the boundary contour points of the cleaning robot results in an uneven edge path, a wavy shape, and insufficient overall smoothness.

Method used

By obtaining the original edge-fitting path of the target area, smoothing and curve fitting are performed, and the path control points are optimized so that adjacent two segments of the curved edge-fitting path bend to the same side. An optimization objective function is constructed to improve the path smoothness and motion constraints.

Benefits of technology

This improves the overall smoothness of the edge-fitting path, reduces the curvature of local paths, and presents a smoother path effect.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119024684B_ABST
    Figure CN119024684B_ABST
Patent Text Reader

Abstract

The application provides a method and device for generating a close-to-wall path, a cleaning robot, and a storage medium. The method comprises: obtaining an original close-to-wall path corresponding to a target area, the target area being an area currently to be planned for a close-to-wall path, and the original close-to-wall path comprising a plurality of ordered boundary points of the target area; performing smoothing processing on the original close-to-wall path based on the plurality of ordered boundary points to obtain a smooth close-to-wall path corresponding to the target area, the smooth close-to-wall path comprising a plurality of curve close-to-wall paths connected at the beginning and the end; and optimizing path control points of the plurality of curve close-to-wall paths so that adjacent two curve close-to-wall paths in the plurality of curve close-to-wall paths bend to the same side to obtain a planned close-to-wall path of the target area, the path control points being used to control the bending direction and shape of the curve close-to-wall path. The technical solution can improve the overall smoothness of the close-to-wall path.
Need to check novelty before this filing date? Find Prior Art

Description

TECHNICAL FIELD

[0001] The present application relates to the field of path planning, in particular to a method and device for generating a close-to-wall path, a cleaning robot and a storage medium. BACKGROUND

[0002] A cleaning robot is a robot that replaces human beings to clean in recent years with the progress of science and technology. The cleaning robot includes a body, a processor, a motor, a driving wheel, a positioning sensor, and various cleaning components, etc. to realize automatic walking and positioning of the cleaning robot, and processing of a dirty area.

[0003] When the cleaning robot performs a cleaning task, it will perform supplementary cleaning on the boundary area according to a separately planned close-to-wall path after cleaning the internal area, so as to ensure the cleanliness of close-to-wall cleaning. Due to the noise and error of the boundary contour points of the cleaning area, there is a lack of consistency, which will cause the planned close-to-wall path to present a wavy shape, to and fro, and the overall smoothness is not enough. SUMMARY

[0004] The present application provides a method and device for generating a close-to-wall path, a cleaning robot and a storage medium to solve the technical problem of insufficient overall smoothness of the close-to-wall path caused by the lack of consistency of the boundary contour points of the cleaning area.

[0005] In a first aspect, a method for generating a close-to-wall path is provided, comprising:

[0006] obtaining an original close-to-wall path corresponding to a target area, the target area being an area for which a close-to-wall path is currently planned, the original close-to-wall path including a plurality of ordered boundary points of the target area;

[0007] performing smoothing processing on the original close-to-wall path based on the plurality of ordered boundary points to obtain a smooth close-to-wall path corresponding to the target area, the smooth close-to-wall path including a plurality of curve close-to-wall paths connected at the beginning and end;

[0008] optimizing path control points of the plurality of curve close-to-wall paths so that adjacent two curve close-to-wall paths in the plurality of curve close-to-wall paths bend to the same side to obtain a planned close-to-wall path of the target area, the path control points being used to control the bending direction and shape of the curve close-to-wall path.

[0009] In the technical solution, the original edge bonding path corresponding to the target region is acquired, the original edge bonding path includes a plurality of ordered boundary points of the target region, then the original edge bonding path is smoothed based on the plurality of ordered boundary points on the original edge bonding path to obtain a smoothed edge bonding path corresponding to the target region, the smoothed edge bonding path includes a plurality of curve edge bonding paths connected at the head and tail, the local optimization of the edge bonding path is realized, and the local path in the edge bonding path is a smooth curve; the path control points of the plurality of curve edge bonding paths on the smoothed edge bonding path are optimized, the adjacent two curve edge bonding paths in the plurality of curve edge bonding paths are bent to the same side, and a planned edge bonding path of the target region is obtained, the overall optimization of the edge bonding path is realized, the path control points of the plurality of curve edge bonding paths on the smoothed edge bonding path are optimized, the adjacent two curve edge bonding paths of the smoothed edge bonding path are bent to the same side, the radian of the adjacent two local paths in the edge bonding path is reduced, and the local path is straightened, so that the overall radian of the edge bonding path is reduced and is more gentle, and the overall smoothness of the edge bonding path is higher.

[0010] With reference to the first aspect, in a possible implementation manner, the optimization of the path control points of the plurality of curve edge bonding paths, so that the adjacent two curve edge bonding paths in the plurality of curve edge bonding paths are bent to the same side, to obtain the planned edge bonding path of the target region, includes: constructing an optimization objective function related to the path control points, the optimization objective function taking the path control points as the independent variable, and the optimization objective function being used to improve the overall smoothness of the path; taking the path control points of the plurality of curve edge bonding paths as the initial solution of the independent variable in the optimization objective function, and determining the optimal solution of the independent variable to obtain new path control points, the optimal solution making the function value of the optimization objective function minimum; and generating the planned edge bonding path according to the new path control points. By modeling the path smoothing as an optimization problem of the path control points, constructing the optimization objective function, and solving the optimal solution of the optimization objective function, the accurate optimization of the edge bonding path can be realized.

[0011] With reference to the first aspect, in a possible implementation manner, the optimization objective function is a nonlinear function related to the path control points. The optimization objective function is a nonlinear function related to the path control points, which is equivalent to realizing the optimization of the path in a nonlinear manner, and is more in line with the characteristics of path planning, thereby helping to improve the rationality of the optimization of the edge bonding path.

[0012] With reference to the first aspect, in a possible implementation manner, the optimization objective function comprises a smoothness optimization objective function and a motion constraint objective function, a function value of the optimization objective function is obtained based on a function value of the smoothness optimization objective function and a function value of the motion constraint objective function, the smoothness optimization objective function is used for optimizing overall smoothness of the path, and the motion constraint function is used for constraining velocity and acceleration on the path. By setting the optimization objectives of the two aspects of path smoothness and kinematics, the path obtained through final optimization can be more reasonable.

[0013] With reference to the first aspect, in a possible implementation manner, the smoothness optimization objective function is:

[0014]

[0015] wherein f s is a function value of the smoothness optimization objective function, Q i+1 , Q i and Q i-1 are position vectors of three adjacent path control points, and pb is an order of a curve corresponding to the curve-fitted path.

[0016] With reference to the first aspect, in a possible implementation manner, the motion constraint objective function comprises:

[0017]

[0018]

[0019] wherein f v (v t ) is a function value of a velocity curve function, f a (v a ) is a function value of an acceleration curve function, v max and a max are preset maximum velocity and maximum acceleration, v t and a t are velocity and acceleration on the curve-fitted path, v t and a t are obtained based on path control points of the curve-fitted path.

[0020] With reference to the first aspect, in a possible implementation manner, the function value of the optimization objective function is obtained by weighted summation of the function value of the smoothness optimization objective function and the function value of the motion constraint objective function. By setting the weights of the optimization objectives of the two aspects of path smoothness and kinematics, the path obtained through final optimization can be more reasonable.

[0021] With reference to the first aspect, in a possible implementation manner, the smoothing processing on the original trimming path based on the plurality of ordered boundary points to obtain the smooth trimming path corresponding to the target region comprises: performing curve fitting on the plurality of ordered boundary points to obtain the smooth trimming path. Through the curve fitting manner, the local optimization processing on the trimming path can be realized.

[0022] With reference to the first aspect, in a possible implementation manner, the performing curve fitting on the plurality of ordered boundary points to obtain the smooth trimming path comprises: performing B-spline curve fitting on the plurality of ordered boundary points to obtain the smooth trimming path. Based on the B-spline curve, the curve fitting is performed on the plurality of ordered boundary points, so that the trimming path obtained through the fitting is smoother, and the similarity with the original trimming path is higher.

[0023] With reference to the first aspect, in a possible implementation manner, the obtaining the original trimming path corresponding to the target region comprises: obtaining target three-dimensional point cloud data corresponding to the target region, the target three-dimensional point cloud data being used to represent the target region; extracting three-dimensional point cloud data representing the contour of the target region from the target three-dimensional point cloud data to obtain a plurality of boundary points corresponding to the target region; and sorting the plurality of boundary points to obtain the original trimming path corresponding to the target region. Through the obtaining of the three-dimensional point cloud data of the target region and the extracting of the three-dimensional point cloud data representing the contour as the boundary points of the target region, and then the sorting of the boundary points, the initial path of the target region can be obtained.

[0024] With reference to the first aspect, in a possible implementation manner, the extracting the three-dimensional point cloud data representing the contour of the target region from the target three-dimensional point cloud data to obtain the plurality of boundary points comprises: extracting the three-dimensional point cloud data representing the contour of the target region from the target three-dimensional point cloud data based on a rolling ball method to obtain the plurality of boundary points corresponding to the target region. Based on the rolling ball method, the three-dimensional point cloud data representing the contour of the target region is extracted, so that the fast extraction of the boundary points of the target region can be realized.

[0025] With reference to the first aspect, in a possible implementation manner, the obtaining the target three-dimensional point cloud data corresponding to the target region comprises: obtaining three-dimensional point cloud data containing the target region; and performing target segmentation on the three-dimensional point cloud data to obtain the target three-dimensional point cloud data.

[0026] With reference to the first aspect, in a possible implementation manner, the obtaining the three-dimensional point cloud data containing the target region comprises: obtaining a depth image containing the target region; and performing coordinate conversion on each pixel point in the depth image to obtain the three-dimensional point cloud data containing the target region.

[0027] In a second aspect, a skirting path generation apparatus is provided, comprising:

[0028] a path acquisition module configured to acquire an original skirting path corresponding to a target region, the target region being a region for which a skirting path is to be planned, the original skirting path comprising a plurality of ordered boundary points of the target region;

[0029] a path smoothing module configured to perform smoothing processing on the original skirting path based on the plurality of ordered boundary points to obtain a smoothed skirting path corresponding to the target region, the smoothed skirting path comprising a plurality of curve skirting paths connected at their heads and tails;

[0030] a path optimization module configured to optimize path control points of the plurality of curve skirting paths such that adjacent two curve skirting paths in the plurality of curve skirting paths bend towards the same side, to obtain a planned skirting path of the target region, the path control points being used to control bending directions and shapes of the curve skirting paths.

[0031] In a third aspect, a computer device is provided, comprising a memory and one or more processors, the memory being connected to the one or more processors, the one or more processors being configured to execute one or more computer programs stored in the memory, and the one or more processors, when executing the one or more computer programs, causing the computer device to implement the skirting path generation method of the first aspect.

[0032] In a fourth aspect, a computer readable storage medium is provided, the computer readable storage medium storing a computer program, the computer program comprising program instructions, the program instructions, when executed by a processor, causing the processor to execute the skirting path generation method of the first aspect.

[0033] In a fifth aspect, a cleaning robot is provided, comprising a moving body and a cleaning mechanical arm, the cleaning robot being configured to execute the skirting path generation method of the first aspect, and the planned skirting path being a skirting path for the cleaning mechanical arm to clean the target region.

[0034] The present application can achieve the following technical effects: the overall optimization of the skirting path is achieved, the path control points of the plurality of curve skirting paths on the smoothed skirting path are optimized, the adjacent two curve skirting paths of the smoothed skirting path bend towards the same side, the radian of the adjacent two local paths in the skirting path is reduced, the local path is straightened, the overall radian of the skirting path is reduced and is more gentle, and thus the overall smoothness of the skirting path is higher. BRIEF DESCRIPTION OF DRAWINGS

[0035] Figure 1 A scene schematic diagram of a specific application scenario provided by an embodiment of the present application;

[0036] Figure 2 Schematic flowchart of a method for generating a hemming path provided by an embodiment of the present application;

[0037] Figure 3 Schematic diagram of the original hemming path provided by an embodiment of the present application;

[0038] Figure 4 Schematic diagram of the relationship between a curve and control points provided by an embodiment of the present application;

[0039] Figure 5 Schematic diagram of a smooth hemming path and a planned hemming path provided by an embodiment of the present application;

[0040] Figure 6 Schematic structural diagram of a hemming path generation device provided by an embodiment of the present application;

[0041] Figure 7 Schematic structural diagram of a computer device provided by an embodiment of the present application. Detailed implementation manners

[0042] Next, the technical solutions in the embodiments of the present application will be described in conjunction with the accompanying drawings in the embodiments of the present application.

[0043] The technical solution of the present application is applicable to the path planning scenario. The technical solution of the present application can be specifically applied to a target device. Optionally, the technical solution of the present application can also be applied to other devices having a connection relationship or a supporting relationship with the target device. The connection relationship between the target device and the other device can be a wired connection relationship or a wireless connection relationship. For example, if the target device is a cleaning robot, the other device can refer to a base station supporting the cleaning robot, or the other device can also refer to a background server corresponding to the cleaning robot (such as a cloud server), and data is transmitted between the background server and the cleaning robot based on wireless communication.

[0044] In a specific application scenario, the technical solution of the present application can be applied to a cleaning robot with a cleaning robotic arm. The cleaning robot with a cleaning robotic arm uses the cleaning robotic arm to complete the cleaning of spatial positions such as the ground and the wall. The planned hemming path generated based on the technical solution of the present application can be the hemming path for the cleaning robotic arm of the cleaning robot to clean the target area. The cleaning robotic arm of the cleaning robot can move along the planned hemming path to complete the cleaning of the boundary of the target area. Exemplarily, reference can be made to Figure 1 the scenario shown in the figure. When the cleaning robot 10 executes the cleaning task of the washbasin 20, a planned hemming path along the edge of the washbasin 20 can be generated based on the technical solution of the present application, so that the edge of the washbasin 20 can be cleaned based on the planned hemming path.

[0045] The technical solutions of the present application are described in detail below.

[0046] Referring to Figure 2 , Figure 2 A flowchart of a method for generating a close-to-edge path provided by an embodiment of the present application is shown in FIG. 1. The method can be applied to the target device mentioned above or other devices. As shown in FIG. 1, the method includes the following steps: Figure 2

[0047] S301, obtaining an original close-to-edge path corresponding to a target region.

[0048] Here, the target region is a region for which a close-to-edge path is to be planned, and the target region may, for example, be a region to be cleaned. By way of example, the target region may, for example, be region R1 in FIG. 2. Figure 1

[0049] The original close-to-edge path corresponding to the target region refers to a close-to-edge path obtained by boundary recognition of the target region. The original close-to-edge path includes a plurality of ordered boundary points of the target region. The ordered boundary points refer to boundary points in order. The plurality of ordered boundary points of the target region are sequentially connected in order to obtain the original close-to-edge path corresponding to the target region. By way of example, referring to FIG. 3, assuming that the target region is region R2 in FIG. 2, the original close-to-edge path corresponding to the target region can be as shown by the white thick solid line in FIG. 3. Figure 3 Figure 1 Figure 3

[0050] In one possible implementation, the original close-to-edge path corresponding to the target region can be obtained by the following steps A1-A3:

[0051] A1, obtaining target three-dimensional point cloud data corresponding to the target region.

[0052] The target three-dimensional point cloud data is used to represent the target region, and the target three-dimensional point cloud data is a set of position points in the target region. Each position point in the target region can be represented as (x, y, z) in the target three-dimensional point cloud data, which represents the position coordinates of the position point in the target region in space.

[0053] In one possible implementation, the target three-dimensional point cloud data corresponding to the target region can be obtained by the following steps A11-A12:

[0054] A11, obtaining three-dimensional point cloud data containing the target region.

[0055] ​​​​​Here, 3D point cloud data is used to represent a spatial region including the target region (hereinafter referred to as the target spatial region). Each spatial location point in the target spatial region constitutes the 3D point cloud data containing the target region. Each 3D point cloud data has the same representation form. For the specific representation form, please refer to the target 3D point cloud data.

[0056] In one specific implementation, 3D point cloud data containing the target region can be obtained through passive acquisition. Specifically, a depth image containing the target region can be acquired, and the coordinates of each pixel in the depth image can be transformed to obtain 3D point cloud data containing the target region. The depth image containing the target region can be obtained by capturing the target spatial region using a depth camera. Transforming the coordinates of each pixel in the depth image to obtain 3D point cloud data containing the target region means transforming the pixel coordinates and depth data of each pixel in the depth image to the camera coordinate system, device coordinate system, or world coordinate system. The specific coordinate system to which the pixels in the depth image are transformed can be determined based on actual needs, and this application does not impose any restrictions.

[0057] For example, the target device is Figure 1 The cleaning robot 10 shown targets an area of... Figure 1 In region R2 shown, a depth camera is mounted at the end of the cleaning robot's robotic arm. The depth camera can then be used to capture a depth image of region R2. The coordinates of each pixel in the depth image can then be transformed to obtain 3D point cloud data containing the target region in the camera coordinate system. Furthermore, the 3D point cloud data containing the target region can be transformed from the camera coordinate system to the robotic arm's coordinate system. Assume the coordinates of the 3D point cloud data in the camera coordinate system are p1. i Then the coordinates p2 of the 3D point cloud data in the coordinate system of the robotic arm i =T1*T2*p1 i T1 is the first transformation matrix, which indicates the relative positional relationship between the end effector of the robotic arm and the base of the robotic arm. It includes the rotational and translational relationship between the end effector of the robotic arm and the base of the robotic arm. It can be obtained by real-time detection of the position of the robotic arm and kinematic calculation. T2 is the second transformation matrix, which indicates the relative positional relationship between the camera and the end effector of the cleaning robotic arm. It includes the rotational and translational relationship between the camera and the end effector of the robotic arm. It can be obtained by pre-calibration (such as hand-eye calibration method).

[0058] By acquiring a depth image containing the target region and performing coordinate transformation on each pixel in the depth image, 3D point cloud data containing the target region can be obtained, which is a simple implementation method.

[0059] Optionally, the three-dimensional point cloud data containing the target region can also be obtained by active acquisition. For example, the three-dimensional point cloud data containing the target region can be obtained by optical acquisition. In this case, the target space region can be scanned by a laser radar to obtain the three-dimensional point cloud data containing the target region in the laser radar coordinate system. Similarly, the three-dimensional point cloud data in the laser radar coordinate system can be converted into the three-dimensional point cloud data in the device coordinate system or the world coordinate system. Alternatively, the three-dimensional point cloud data containing the target region can also be obtained by sound waves or electromagnetic waves.

[0060] Optionally, the three-dimensional point cloud data containing the target region can also be obtained by a combination of active and passive acquisition. The application does not limit the manner of obtaining the three-dimensional point cloud data containing the target region.

[0061] A12, performing target segmentation on the three-dimensional point cloud data containing the target region to obtain target three-dimensional point cloud data.

[0062] Here, the target segmentation on the three-dimensional point cloud data containing the target region means identifying the target region from the three-dimensional point cloud data containing the target region and segmenting the three-dimensional point cloud data exclusively belonging to the target region to obtain the target three-dimensional point cloud data.

[0063] Specifically, any one of the region-based segmentation methods such as region growing, region separation aggregation, and watershed can be used to perform target segmentation on the three-dimensional point cloud data containing the target region to obtain the target three-dimensional point cloud data.

[0064] In an optional embodiment, after obtaining the three-dimensional point cloud data containing the target region, the three-dimensional point cloud data belonging to the edge of the target region, i.e., the boundary points of the target region, can be identified by an edge-based method, and then the region formed by connecting the boundary points is determined as the target region, and the three-dimensional point cloud data in the target region is determined as the target three-dimensional point cloud data. The application does not limit the specific manner of obtaining the target three-dimensional point cloud data.

[0065] A2, extracting three-dimensional point cloud data representing the contour of the target region from the target three-dimensional point cloud data to obtain a plurality of boundary points corresponding to the target region.

[0066] In a feasible embodiment, the three-dimensional point cloud data representing the contour of the target region can be extracted from the target three-dimensional point cloud data based on the rolling ball method to obtain a plurality of boundary points corresponding to the target region.

[0067] Specifically, the target three-dimensional point cloud data can be projected onto a two-dimensional plane (generally the XOY plane) to obtain target two-dimensional point cloud data. Then, the contour points in the target two-dimensional point cloud data can be determined by the following steps (11)-(14).

[0068] (11) For the point p(x, y) to be judged, search all points with a distance less than 2a from the point p according to the pre-set rolling circle radius a, and obtain a point set P.

[0069] Wherein, the point p to be judged is any one point in the target two-dimensional point cloud.

[0070] (12) Select any point p1(x1, y1) in the point set P, and calculate two circle center coordinates o1(x o1 , y o1 ) and o2(x o2 , y o2 ) according to p, p1 and the rolling circle radius a. The calculation formula of the circle center coordinates o1(x o1 , y o1 ) and o2(x o2 , y o2 ) is as follows:

[0071] x o1 =x+(x1-x)*1 / 2-(y1-y)*H

[0072] y o1 =y+(y1-y)*1 / 2-(x-x1)*H

[0073] x o2 =x+(x1-x)*1 / 2+(y1-y)*H

[0074] y o2 =y+(y1-y)*1 / 2+(x-x1)*H

[0075]

[0076] S 2 =(x1-x) 2 +(y-y1) 2

[0077] (13) For other points in the point set P except p1, calculate the distance of other points to the circle centers o1 and o2. If the distance of other points to the circle center o1 or the circle center o2 is greater than a except p1, it is determined that p is a contour point.

[0078] (14) If the distance of other points to the circle center o1 and the circle center o2 is not all greater than a except p1, select other points in the point set P as p1, return to step (12) until p is determined as a contour point, or all points in the point set P are traversed.

[0079] (15) If all points in the point set P are traversed and p is not determined as a contour point, it is determined that p is not a contour point.

[0080] By judging each point in the target two-dimensional point cloud data through steps (11)-(15), a plurality of contour points in the target two-dimensional point cloud can be determined, and finally the three-dimensional point cloud data corresponding to the plurality of contour points is determined as a plurality of boundary points corresponding to the target region.

[0081] The three-dimensional point cloud data representing the contour of the target region is extracted based on the rolling ball method, and the boundary points of the target region can be quickly extracted.

[0082] Alternatively, the three-dimensional point cloud data representing the contour of the target region can also be extracted from the target three-dimensional point cloud data based on other boundary extraction methods to obtain a plurality of boundary points corresponding to the target region. For example, the three-dimensional point cloud data representing the contour of the target region can also be extracted by an edge extraction operator such as a Laplace operator or a Sobel operator. Alternatively, the three-dimensional point cloud data representing the contour of the target region can also be extracted from the target three-dimensional point cloud data based on a Delaunay contour extraction method to obtain a plurality of boundary points corresponding to the target region. The present application does not make any limitation.

[0083] A3, sorting a plurality of boundary points corresponding to the target region to obtain an original edge-fitting path corresponding to the target region.

[0084] Specifically, any one of the following methods can be used to sort the plurality of boundary points corresponding to the target region to obtain the original edge-fitting path corresponding to the target region: a nearest search method, a distance sorting method, and an arrangement method.

[0085] By obtaining the three-dimensional point cloud data of the target region and extracting the three-dimensional point cloud data representing the contour as the boundary points of the target region, and then sorting the boundary points, an initial path of the target region can be obtained.

[0086] Alternatively, the original edge-fitting path corresponding to the target region can also be obtained by other implementations, and the present application does not make any limitation.

[0087] S302, based on a plurality of ordered boundary points of the target region, smoothing the original edge-fitting path corresponding to the target region to obtain a smoothed edge-fitting path corresponding to the target region.

[0088] Here, the smoothed edge-fitting path corresponding to the target region includes a plurality of curve edge-fitting paths connected end to end. Smoothing the original edge-fitting path corresponding to the target region means that for the turning position (hereinafter referred to as turning position) in the original edge-fitting path corresponding to the target region, the curvature of the path at the turning position is reduced so that the path at the turning position becomes smooth. The shape of the smoothed edge-fitting path corresponding to the target region is similar to the shape of the original edge-fitting path corresponding to the target region.

[0089] In some possible cases, the original edge-adapted path corresponding to the target region can be smoothed by an interpolation or fitting based path smoothing method to obtain a smoothed edge-adapted path corresponding to the target region.

[0090] In a possible implementation, the plurality of ordered boundary points of the target region can be curve fitted to obtain a smoothed edge-adapted path corresponding to the target region.

[0091] Specifically, the plurality of ordered boundary points of the target region can be B-spline curve fitted to obtain a smoothed edge-adapted path corresponding to the target region. The parametric expression of the B-spline is as follows:

[0092]

[0093] wherein N i,p is a basis function, Q i is a path control point, and the number of the path control points is n.

[0094] The plurality of ordered boundary points of the target region can be first parameterized to obtain B-spline parameter values, then the node vectors can be determined according to the B-spline parameter values, then the basis functions and the path control points can be solved according to the B-spline parameter values and the node vectors, and finally the smoothed edge-adapted path corresponding to the target region can be drawn according to the path control points and the basis functions.

[0095] The plurality of ordered boundary points can be curve fitted based on the B-spline, so that the fitted edge-adapted path is smoother and has a higher similarity to the original edge-adapted path.

[0096] Alternatively, the plurality of ordered boundary points of the target region can also be Bezier curve fitted to obtain a smoothed edge-adapted path corresponding to the target region. Alternatively, the plurality of ordered boundary points of the target region can also be polynomial interpolated to obtain a smoothed edge-adapted path corresponding to the target region.

[0097] Alternatively, the plurality of ordered boundary points can be divided into a plurality of groups of ordered boundary points, and each group of ordered boundary points can be interpolated or fitted to obtain a plurality of curve edge-adapted paths, and then the plurality of curve edge-adapted paths can be connected to obtain a smoothed edge-adapted path corresponding to the target region.

[0098] In some other possible cases, the original edge-adapted path corresponding to the target region can be smoothed by an optimization based path smoothing method to obtain a smoothed edge-adapted path corresponding to the target region. Alternatively, the original edge-adapted path corresponding to the target region can be smoothed by a Floyd algorithm to obtain a smoothed edge-adapted path corresponding to the target region. The specific implementation of the smoothing is not limited in the present application.

[0099] S303, optimizing the path control points of the plurality of curve edge bonding paths connected in sequence on the smooth edge bonding path, so that the two adjacent curve edge bonding paths in the plurality of curve edge bonding paths bend to the same side, to obtain the planned edge bonding path of the target region.

[0100] Here, the path control points are used to control the bending direction and shape of the curve edge bonding path. One curve edge bonding path can correspond to multiple control points. The number of control points corresponding to one curve edge bonding path is related to the order of the curve corresponding to the curve edge bonding path. For example, referring to the curve SE in Figure 4 , Figure 4 , if the curve SE is a 3-order B-spline curve, the number of control points corresponding to the curve SE is 4, which are Q1, Q2, Q3 and Q4 in Figure 4 . Different curve edge bonding paths can correspond to the same control point. For example, if the curves corresponding to the plurality of curve edge bonding paths connected in sequence on the smooth edge bonding path are all 3-order B-spline curves, each curve edge bonding path corresponds to 4 control points, the curve edge bonding path 1 corresponds to the control points Q1, Q2, Q3 and Q4, the curve edge bonding path 2 corresponds to Q2, Q3, Q4 and Q5, the curve edge bonding path 3 corresponds to Q3, Q4, Q5 and Q6, …, the curve edge bonding path n-3 corresponds to Q n-3 , Q n-1 , Q n-1 and Q n , and n is the number of path control points. The number of path control points depends on the number of curve edge bonding paths on the smooth edge bonding path and the order of the curve corresponding to the curve edge bonding path.

[0101] In some possible cases, the path control points can be optimized by constructing an optimization objective function related to the path control points and determining the optimal solution of the optimization function, so as to optimize the edge bonding path of the target region. The above step S303 includes the following steps B1-B3.

[0102] A1, constructing an optimization objective function related to the path control points.

[0103] Here, the optimization objective function is a function with the path control points as the independent variable, and the optimization objective function can be expressed as f(Q).

[0104] The optimization objective function is used to improve the overall smoothness of the path, and when the function value of the optimization objective function reaches the minimum, the overall smoothness of the path is the highest. The optimization objective function can be any objective function that can improve the overall smoothness of the path.

[0105] Specifically, the optimization objective function can be a nonlinear function related to the path control points. The optimization objective function is a nonlinear function related to the path control points, which is equivalent to achieving the optimization of the path in a nonlinear manner, which is more in line with the characteristics of path planning, thereby helping to improve the rationality of the edge bonding path optimization.

[0106] In an implementable embodiment, the optimization objective function can include a smoothness optimization objective function and a motion constraint objective function, wherein the smoothness optimization objective function is used to optimize the overall smoothness of the path, the motion constraint function is used to constrain the velocity and acceleration on the path, and the function value of the optimization objective function is obtained based on the function value of the smoothness optimization objective function and the function value of the motion constraint objective function. By setting the optimization objectives of the path smoothness and kinematics, the path obtained by the final optimization can be more reasonable.

[0107] Specifically, the smoothness optimization objective function can be:

[0108]

[0109] wherein f s is the function value of the smoothness optimization objective function, Q i+1 , Q i and Q i-1 are the position vectors of the three adjacent path control points, and pb is the order of the curve corresponding to the curve-fitted path. For example, the target region smooth-fitted path is obtained by B-spline curve fitting, and the B-spline curve used in the fitting is a 3-order B-spline curve, so pb is 3.

[0110] Specifically, the motion constraint objective function can include:

[0111]

[0112]

[0113] wherein f v (v t ) is the function value of the velocity curve function, f a (v a ) is the function value of the acceleration curve function, v max and a max are the preset maximum velocity and maximum acceleration, the maximum velocity and maximum acceleration here are the maximum velocity and maximum acceleration in the Cartesian space, v t and a t are the velocity and acceleration on the curve-fitted path, and v t and a t are obtained based on the path control points of the curve-fitted path. For example, the target region smooth path is obtained by B-spline curve fitting, so

[0114] Therefore, the optimization objective function can be: f1(Q)=fs+f v (vt )+f a (v a ), f1(Q) is a function value of the smoothness optimization objective function.

[0115] It should be noted that the smoothness optimization objective function and the motion constraint objective function can not be limited to the above forms, and can be set based on actual conditions.

[0116] In some possible cases, the function value of the optimization objective function can be obtained by weighting and summing the function value of the smoothness optimization objective function and the function value of the motion constraint objective function. The optimization objective function can be: f2(Q) = w1*fs+w2*[f v (v t )+f a (v a )], f2(Q) is a function value of the optimization objective function, and w1 and w2 are respectively weights of the smoothness optimization objective function and the motion constraint objective function.

[0117] The weight of the motion constraint objective function can be greater than the weight of the smoothness optimization objective function. In a specific example, w2 = 10, and w1 = 1.

[0118] By setting weights for the optimization objectives of path smoothness and kinematics, the final optimized path can be more reasonable.

[0119] A2, the path control points of the multi-segment curve trimming path are taken as initial solutions of independent variables in the optimization objective function, and an optimal solution of the independent variable is determined to obtain new path control points.

[0120] The optimal solution of the independent variable minimizes the function value of the optimization objective function.

[0121] Specifically, the optimal solution of the independent variable in the optimization objective function can be solved by Newton method or L-BFGS (large bfgs) algorithm.

[0122] The general principle of solving the optimal solution of the independent variable in the optimization objective function by Newton method can be as follows:

[0123] (21) Derive the optimization objective function f(Q) to obtain the derivative function f'(Q) and f''(Q) of the optimization objective function.

[0124] (22) Set k to 0.

[0125] (23) Substitute the target solution Q k of the independent variable into the optimization objective function f(Q) and the derivative functions f'(Q) and f''(Q) to obtain the function values fk , f' k , and f" k . Wherein, when k is 0, the target solution Q k of the independent variable is the initial solution of the independent variable.

[0126] (24) According to the function value f 1k and f 2k of the optimization objective function f(Q) and the derivative function f'(Q), the target solution Q k of the independent variable is updated to obtain the next target solution Q k of the independent variable. k+1 ;

[0127] (25) Substitute the target solution Q k+1 of the independent variable into the optimization objective function f(Q) and the derivative function f'(Q) to obtain the function value f k+1 , f' k+1 of the optimization objective function f(Q) and the derivative function f'(Q).

[0128] (26) Determine whether f k+1 is less than f k , and determine whether f' k+1 is less than the preset threshold value.

[0129] (27) If f k+1 is less than f k , and f' k+1 is less than the preset threshold value, the target solution Q k+1 is determined as the optimal solution of the independent variable; otherwise, k is increased by 1, and step (23) is returned.

[0130] A3, according to the new path control point, a planning edge path of the target area is generated.

[0131] Specifically, according to the new path control point, the planning edge path of the target area can be drawn in combination with the basis function of the curve corresponding to the curve edge path.

[0132] Exemplarily, the black large dots in Figure 5 , Figure 5 are ordered boundary points, and the black small dots are original path control points. The smooth edge path corresponding to the original path control points is shown as a dashed line in Figure 5 , Figure 5 The gray triangles in are new path control points, and the planning edge path corresponding to the new path control points is shown as a black solid line in Figure 5 .

[0133] By modeling the path smoothing as an optimization problem of the path control point, and constructing an optimization objective function, the optimal solution of the optimization objective function can be solved to accurately optimize the edge path.

[0134] In the above Figure 2 In the corresponding technical solution, the original edge path corresponding to the target region is obtained, the original edge path including a plurality of ordered boundary points of the target region, and then the original edge path is smoothed based on the plurality of ordered boundary points on the original edge path to obtain a smoothed edge path corresponding to the target region, the smoothed edge path including a plurality of curve edge paths connected at the head and tail. The local optimization of the edge path is realized, so that the local path in the edge path is a smooth curve. The path control points of the plurality of curve edge paths on the smoothed edge path are optimized, so that the adjacent two curve edge paths in the plurality of curve edge paths bend to the same side, to obtain a planned edge path of the target region, and the overall optimization of the edge path is realized. The path control points of the plurality of curve edge paths on the smoothed edge path are optimized, so that the adjacent two curve edge paths of the smoothed edge path bend to the same side, which can make the radian of the adjacent two local paths in the edge path smaller, showing a local path straightening effect, so that the overall radian of the edge path is smaller and more gentle, and thus the overall smoothness of the edge path is higher.

[0135] The method of the application is described above, and the device of the application is described below.

[0136] Referring to Figure 6 , Figure 6 is a structural schematic diagram of an edge path generation device provided by an embodiment of the application. The edge path generation device can be the target device or other device mentioned above. As shown in Figure 6 , the edge path generation device 40 includes:

[0137] The path acquisition module 401 is configured to acquire an original edge path corresponding to a target region, the target region being a region for which an edge path is currently planned, and the original edge path including a plurality of ordered boundary points of the target region.

[0138] The path smoothing module 402 is configured to smooth the original edge path based on the plurality of ordered boundary points to obtain a smoothed edge path corresponding to the target region, the smoothed edge path including a plurality of curve edge paths connected at the head and tail.

[0139] The path optimization module 403 is configured to optimize path control points of the plurality of curve edge paths, so that the adjacent two curve edge paths in the plurality of curve edge paths bend to the same side, to obtain a planned edge path of the target region, and the path control points are used to control the bending direction and shape of the curve edge path.

[0140] In a possible design, the path optimization module 403 is specifically configured to: construct an optimization objective function related to the path control points, the optimization objective function taking the path control points as independent variables, and the optimization objective function being used to improve the overall smoothness of the path; take the path control points of the multi-segment curve-fitting path as the initial solution of the independent variables in the optimization objective function, and determine the optimal solution of the independent variables to obtain new path control points, the optimal solution making the function value of the optimization objective function minimum; and generate the planned curve-fitting path according to the new path control points.

[0141] In a possible design, the optimization objective function is a nonlinear function related to the path control points.

[0142] In a possible design, the optimization objective function includes a smoothness optimization objective function and a motion constraint objective function, the function value of the optimization objective function being obtained based on the function value of the smoothness optimization objective function and the function value of the motion constraint objective function, the smoothness optimization objective function being used to optimize the overall smoothness of the path, and the motion constraint function being used to constrain the velocity and acceleration on the path.

[0143] In a possible design, the smoothness optimization objective function is:

[0144]

[0145] wherein f s is the function value of the smoothness optimization objective function, Q i+1 , Q i , and Q i-1 are position vectors of three path control points adjacent to each other, and pb is the order of the curve corresponding to the curve-fitting path.

[0146] In a possible design, the motion constraint objective function includes:

[0147]

[0148]

[0149] wherein f v (v t ) is the function value of the velocity curve function, f a (v a ) is the function value of the acceleration curve function, v max and a max are respectively a preset maximum velocity and a preset maximum acceleration, v t and a t are respectively the velocity and the acceleration on the curve-fitting path, v t and a tThe path control points based on the curve-fitted path are obtained.

[0150] In a possible design, a function value of the optimization target function is obtained by weighted sum of a function value of the smoothness optimization target function and a function value of the motion constraint target function.

[0151] In a possible design, the path smoothing module 402 is specifically configured to perform curve fitting on the plurality of ordered boundary points to obtain the smooth path.

[0152] In a possible design, the path smoothing module 402 is specifically configured to perform B-spline curve fitting on the plurality of ordered boundary points to obtain the smooth path.

[0153] In a possible design, the path obtaining module 401 is specifically configured to: obtain target three-dimensional point cloud data corresponding to the target region, where the target three-dimensional point cloud data is used to represent the target region; extract, from the target three-dimensional point cloud data, three-dimensional point cloud data representing an outline of the target region to obtain a plurality of boundary points corresponding to the target region; and sort the plurality of boundary points to obtain an original path along the edge of the target region.

[0154] In a possible design, the path obtaining module 401 is specifically configured to: extract, based on a rolling ball method, three-dimensional point cloud data representing an outline of the target region from the target three-dimensional point cloud data to obtain a plurality of boundary points corresponding to the target region.

[0155] In a possible design, the path obtaining module 401 is specifically configured to: obtain a depth image containing the target region; and perform coordinate conversion on each pixel point in the depth image to obtain three-dimensional point cloud data containing the target region.

[0156] It should be noted that, Figure 6 The content not mentioned in the corresponding embodiments can be referred to the description of the foregoing method embodiments, which will not be described here again.

[0157] The device realizes local optimization of the edge bonding path, so that the local path in the edge bonding path is a smooth curve; and then the path control points of the plurality of curve edge bonding paths on the smooth edge bonding path are optimized, so that the two adjacent curve edge bonding paths in the plurality of curve edge bonding paths bend to the same side, to obtain the planned edge bonding path of the target region, and realize overall optimization of the edge bonding path. Through the optimization of the path control points of the plurality of curve edge bonding paths on the smooth edge bonding path, the two adjacent curve edge bonding paths of the smooth edge bonding path bend to the same side, so that the curvature of the two adjacent local paths in the edge bonding path is smaller, and the local path is straightened, so that the overall curvature of the edge bonding path is smaller and more gentle, and thus the overall smoothness of the edge bonding path is higher.

[0158] Referring to Figure 7 , Figure 7 is a structural schematic diagram of a computer device provided by an embodiment of the present application. The computer device 50 includes a processor 501 and a memory 502. The memory 502 is connected to the processor 501, for example, through a bus.

[0159] The processor 501 is configured to support the computer device 50 to perform the corresponding functions in the methods in the method embodiments. The processor 501 can be a central processing unit (CPU), a network processor (NP), a hardware chip or any combination thereof. The hardware chip can be an application specific integrated circuit (ASIC), a programmable logic device (PLD) or a combination thereof. The PLD can be a complex programmable logic device (CPLD), a field-programmable gate array (FPGA), a generic array logic (GAL) or any combination thereof.

[0160] The memory 502 is configured to store program codes and the like. The memory 502 can include a volatile memory (VM), for example, a random access memory (RAM); the memory 502 can also include a non-volatile memory (NVM), for example, a read-only memory (ROM), a flash memory, a hard disk drive (HDD) or a solid-state drive (SSD); and the memory 502 can further include a combination of the above-mentioned memories.

[0161] The processor 501 can invoke the program codes to perform the following operations:

[0162] obtain an original skirting path corresponding to a target region, the target region being a region to be planned for a skirting path currently, the original skirting path including a plurality of ordered boundary points of the target region;

[0163] perform smoothing processing on the original skirting path based on the plurality of ordered boundary points to obtain a smooth skirting path corresponding to the target region, the smooth skirting path including a plurality of curve skirting paths connected at the head and tail;

[0164] optimize path control points of the plurality of curve skirting paths, so that adjacent two curve skirting paths in the plurality of curve skirting paths bend to the same side, to obtain a planned skirting path of the target region, the path control points being used to control bending directions and shapes of the curve skirting paths.

[0165] The embodiment of the present application further provides a computer readable storage medium, which stores a computer program, the computer program including program instructions, the program instructions causing a computer to execute the method according to the foregoing embodiment when the computer executes the program instructions.

[0166] Those skilled in the art can understand that all or part of the processes in the above-mentioned embodiment methods can be completed by a computer program instructing related hardware, and the program can be stored in a computer readable storage medium, and the program can include the processes of the above-mentioned embodiments when executed.

[0167] The above descriptions are only the preferred embodiment of the application, of course, cannot be used to limit the scope of the application, thus the equivalent variations made by the claims of the application, still belongs to the scope of the application covered.

Claims

1. A method of generating a skirting path, characterized by, The method comprises the following steps: obtaining an original edge-adapted path corresponding to a target region, the target region being a region for which an edge-adapted path is to be planned, the original edge-adapted path comprising a plurality of ordered boundary points of the target region; based on the plurality of ordered boundary points, performing smoothing processing on the original edge-adapted path to obtain a smoothed edge-adapted path corresponding to the target region, the smoothed edge-adapted path comprising a plurality of curve edge-adapted paths connected end to end; optimizing path control points of the plurality of curve edge-adapted paths so that adjacent two curve edge-adapted paths in the plurality of curve edge-adapted paths bend to the same side, to obtain a planned edge-adapted path of the target region, the path control points being used to control the bending direction and shape of the curve edge-adapted paths.

2. The method of claim 1, wherein, The optimization of the path control points of the plurality of curve edge-adapted paths so that adjacent two curve edge-adapted paths in the plurality of curve edge-adapted paths bend to the same side, to obtain a planned edge-adapted path of the target region, comprises: constructing an optimization objective function related to the path control points, the optimization objective function taking the path control points as independent variables, the optimization objective function being used to improve the overall smoothness of the path; taking the path control points of the plurality of curve edge-adapted paths as initial solutions of the independent variables in the optimization objective function, and determining the optimal solutions of the independent variables to obtain new path control points, the optimal solutions making the function value of the optimization objective function minimum; generating the planned edge-adapted path according to the new path control points.

3. The method of claim 2, wherein, The optimization objective function is a nonlinear function related to the path control points.

4. The method of claim 2, wherein, The optimization objective function comprises a smoothness optimization objective function and a motion constraint objective function, the function value of the optimization objective function being obtained based on the function value of the smoothness optimization objective function and the function value of the motion constraint objective function, the smoothness optimization objective function being used to optimize the overall smoothness of the path, and the motion constraint function being used to constrain the velocity and acceleration on the path.

5. The method of claim 4, wherein, The smoothness optimization objective function is: wherein f s is a function value of a smoothness optimization objective function, Q i+1 , Q i and Q i-1 are position vectors of three path control points adjacent in front and back, and pb is an order of a curve corresponding to the curve-fitted path.

6. The method of claim 4, wherein, The motion constraint objective function comprises: wherein f v (v t ) is a function value of a velocity curve function, f a (v a ) is a function value of an acceleration curve function, v max and a max are respectively a preset maximum velocity and a maximum acceleration, v t and a t are respectively a velocity and an acceleration on the curve-fitted path, and v t and a t are obtained based on path control points of the curve-fitted path.

7. The method of claim 4, wherein, The function value of the optimization objective function is obtained by weighted summation of the function value of the smoothness optimization objective function and the function value of the motion constraint objective function.

8. The method according to any one of claims 1 to 7, characterized in that, The smoothing processing on the original edge-adapted path based on the plurality of ordered boundary points to obtain the smoothed edge-adapted path corresponding to the target region comprises: performing curve fitting on the plurality of ordered boundary points to obtain the smoothed edge-adapted path.

9. The method of claim 8, wherein, The curve fitting on the plurality of ordered boundary points to obtain the smoothed edge-adapted path comprises: performing B-spline curve fitting on the plurality of ordered boundary points to obtain the smoothed edge-adapted path.

10. The method according to any one of claims 1 to 7, characterized in that, The obtaining of the original edge-adapted path corresponding to the target region comprises: obtaining target three-dimensional point cloud data corresponding to the target region, the target three-dimensional point cloud data being used to represent the target region; extracting three-dimensional point cloud data representing the contour of the target region from the target three-dimensional point cloud data to obtain a plurality of boundary points corresponding to the target region; ordering the plurality of boundary points to obtain the original edge-adapted path corresponding to the target region.

11. The method of claim 10, wherein, The three-dimensional point cloud data representing the contour of the target region is extracted from the target three-dimensional point cloud data based on a rolling ball method, and a plurality of boundary points corresponding to the target region are obtained. The target three-dimensional point cloud data corresponding to the target region is obtained, including:

12. The method of claim 10, wherein, Obtaining three-dimensional point cloud data containing the target region; Performing target segmentation on the three-dimensional point cloud data to obtain the target three-dimensional point cloud data. The three-dimensional point cloud data containing the target region is obtained, including:

13. The method of claim 12, wherein, Obtaining a depth image containing the target region; Performing coordinate conversion on each pixel point in the depth image to obtain the three-dimensional point cloud data containing the target region. Including:

14. A trimming path generating apparatus characterized by comprising: A path acquisition module is configured to acquire an original edge-following path corresponding to a target region, the target region being a region to be planned for an edge-following path, and the original edge-following path including a plurality of ordered boundary points of the target region; A path smoothing module is configured to perform smoothing processing on the original edge-following path based on the plurality of ordered boundary points to obtain a smooth edge-following path corresponding to the target region, the smooth edge-following path including a plurality of curve edge-following paths connected at the beginning and the end; A path optimization module is configured to optimize path control points of the plurality of curve edge-following paths, so that adjacent two curve edge-following paths in the plurality of curve edge-following paths bend to the same side, to obtain a planned edge-following path of the target region, the path control points being used to control the bending direction and shape of the curve edge-following path. The computer device includes a memory and a processor, the memory is connected to the processor, and the processor is used to execute one or more computer programs stored in the memory, and the processor, when executing the one or more computer programs, causes the computer device to implement the method of any one of claims 1-13.

15. A computer device, comprising: The computer readable storage medium stores a computer program, the computer program includes program instructions, and the program instructions, when executed by a processor, cause the processor to execute the method of any one of claims 1-13.

16. A computer-readable storage medium, characterized in that, The cleaning robot includes a moving body and a cleaning mechanical arm, and is used to execute the method of any one of claims 1-13, and the planned edge-following path is an edge-following path for the cleaning mechanical arm to clean the target region.

17. A cleaning robot, characterized in that ​

Citation Information

Patent Citations

  • Program segment smooth compression processing method suitable for numerical control device

    CN101881952A

  • Path planning method, computer equipment and storage medium

    CN115280102A