A robot adaptive gluing trajectory generation algorithm based on 3D vision
By acquiring the workpiece point cloud through three-dimensional vision and processing it with an adaptive algorithm, it solves the problem of low efficiency in gluing trajectory generation that relies on manual preset templates in the existing technology, realizes adaptive and robust gluing trajectory generation, and improves efficiency. Quality and efficiency in automated gluing operations.
Patent Information
- Application Number
- CN202311804515.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2023-12-26
- Publication Date
- 2024-09-24
- Estimated Expiration
- 2043-12-26
AI Technical Summary
The existing robot gluing solution relies on manual preset templates and is difficult to adapt to complex curves and non-planar gluing trajectories, resulting in low quality and efficiency of automated gluing operations.
A robot adaptive gluing trajectory generation algorithm based on three-dimensional vision is used to obtain the workpiece point cloud through a 3D camera, perform cluster analysis and morphological corrosion, and adaptively generate a gluing trajectory point set to avoid manual interference and noise effects.
It achieves adaptive and robust gluing trajectory generation, improves the intelligence and production efficiency of gluing operations, avoids the problems of corner noise and poor robustness, and is suitable for gluing complex workpieces.
Smart Images

Figure CN117788406B
Abstract
Description
Technical Field
[0001] The invention relates to the field of intelligent manufacturing, and in particular to a robot adaptive gluing trajectory generation algorithm based on three-dimensional vision. Background Art
[0002] Gluing is a process widely used in the fields of machinery, electronics, and automobile manufacturing. It is mainly used to achieve adhesion and waterproofing between different parts. The traditional gluing process mainly relies on manual operation. For complex gluing tracks, it is not only inefficient, but also difficult to ensure the consistency of gluing quality due to human factors.
[0003] In recent years, with the rapid development of industrial automation and robotics, the application of robotic gluing has become more and more widespread. However, existing robotic gluing solutions often rely on preset templates and manually determine the gluing path. For each new batch of workpieces, it takes a lot of time to manually preset the template gluing trajectory. In addition, for complex curves and non-planar gluing, manual inspection is not able to find the precise gluing trajectory, which greatly reduces the quality and efficiency of automated gluing operations.
[0004] Compared with the traditional glue coating based on preset templates, the glue coating through two-dimensional or three-dimensional visual gluing has higher flexibility. For example, the invention patent of CN 114663736A, "A new algorithm for obtaining the glue coating path of the air conditioner evaporator by fusion of two-dimensional and three-dimensional data", provides a method based on brightness image and depth image, by calculating the target connected area, and using the least squares method to fit the glue coating points, so as to be applied to the glue coating of the air conditioner evaporator plane. The algorithm segments the image based on the grayscale threshold to form a single connected area. Therefore, its design relies on the lighting of the camera light source of 2D vision, the color of the workpiece itself, and the early image processing. It can only generate a relatively simple single connected glue coating area for a single workpiece, and it is not adaptive and universal. For example, for light-absorbing workpieces, such as bicycle seats made of black plastic, it is difficult to segment the connected area with a 2D brightness image. Summary of the invention
[0005] The technical problem to be solved by the present invention is to provide a robot adaptive gluing trajectory generation algorithm based on three-dimensional vision in view of the deficiencies of the above-mentioned prior art. The robot adaptive gluing trajectory generation algorithm based on three-dimensional vision can be used to adaptively generate accurate robot gluing trajectory.
[0006] In order to solve the above technical problems, the technical solution adopted by the present invention is:
[0007] A robot adaptive gluing trajectory generation algorithm based on three-dimensional vision includes the following steps.
[0008] Step 1, obtaining the original workpiece point cloud: Place the workpiece with the surface to be coated with glue facing upward on the material table; use a 3D camera to take a picture of the surface to be coated with glue on the workpiece to obtain the original workpiece point cloud.
[0009] Step 2: Obtain pure workpiece point cloud: remove the material platform point cloud from the original workpiece point cloud to obtain a pure workpiece point cloud.
[0010] Step 3, separate the glue-coated plane clusters: Use a clustering algorithm to perform cluster analysis on the pure workpiece point cloud obtained in step 2, so as to calculate the point cloud corresponding to the maximum OBB bounding box, which is the glue-coated plane cluster of the workpiece outer frame.
[0011] Step 4, obtaining the glue coating center line: cluster the glue coating planes obtained in step 3, and use morphology to erode the center line from the inner and outer sides respectively, so as to obtain the glue coating center line.
[0012] Step 5, obtain the gluing trajectory point set: all the point clouds on the gluing centerline obtained in step 4 are first sorted clockwise, and then the set parameter difference between two adjacent points is calculated; when the set parameter difference is not less than the set parameter minimum threshold, a downsampled adaptive gluing trajectory interpolation point is formed; when all the point clouds on the gluing centerline are traversed, all the adaptive gluing trajectory interpolation points obtained are formed into a gluing trajectory point set.
[0013] Step 6, gluing: the gluing robot walks clockwise or counterclockwise according to the gluing trajectory point set in step 5, and the walking time between two adjacent gluing trajectory points in the gluing trajectory point set is the same.
[0014] In step 4, the Laplace operator is used to cluster the glue-coated plane obtained in step 3, and erode from the inner and outer sides to the center line respectively; wherein, the k nearest neighbors involved in the Laplace matrix in the Laplace operator are initialized to 0.01 times the number of clustered point clouds of the glue-coated plane.
[0015] In step 4, the Laplace operator is used Characterize the contraction strength of the point cloud at the tth iteration; Characterizes the attractiveness of the point cloud at the tth iteration; when t = 0, by controlling and The size of the point cloud is reduced, so that the point cloud can converge quickly through iteration while keeping the shape basically unchanged.
[0016] Among them, S 0 is the average neighborhood range of the point cloud within the glue plane cluster.
[0017] The iteration termination condition of the Laplace operator is Or the maximum number of iterations Iter_max is exceeded; Characterizes the attractive force of the point cloud at the t+1th iteration.
[0018] The maximum number of iterations Iter_max is related to the radial thickness ΔR of the glue-coated plane cluster; when ΔR≤1cm, Iter_max=3-4; when ΔR>1cm, Iter_max=5-6.
[0019] In step 5, the method for obtaining the gluing trajectory point set includes the following steps:
[0020] Step 5-1, calculate the center of mass O: calculate the center of mass O of all point clouds on the glue coating midline in step 4, and use the center of mass O as the center of clockwise rotation.
[0021] Step 5-2, clockwise sorting: traverse any two points P on the glue coating midline in sequence i and P j , and determine the vector OP i and vector OP j The cross product of; when the cross product is less than zero, it is determined that the vector OP i In vector OP j In the clockwise direction; when all point clouds on the glue coating midline are traversed, a clockwise sorted point set {P7'} is obtained.
[0022] Step 5-3, calculate the difference of the set parameters: set any two adjacent points P in the point set {P7'} i ' and P i+1 ', and P i+1 'Located in P i 'clockwise direction; calculate the point cloud P i ' and P i+1 'The setting parameter difference.
[0023] Step 5-4, forming an adaptive gluing trajectory interpolation point: when the set parameter difference is not less than the set parameter minimum threshold, a down-sampled adaptive gluing trajectory interpolation point is formed.
[0024] Step 5-5, obtaining the gluing trajectory point set: traverse all point clouds on the gluing centerline in sequence, and obtain all the adaptive gluing trajectory interpolation points to form the gluing trajectory point set S.
[0025] In step 5-3, the parameter difference is set to the normal vector difference Δn, and Δn=||n i+1 -n i ||; where n i+1 is the point cloud P i+1 'Normal vector; n i is the point cloud P i'; in step 5-4, when Δn>min_grad, a downsampled adaptive gluing trajectory interpolation point is formed; where min_grad is the minimum normal vector difference threshold.
[0026] Set the parameter difference to the Euclidean distance difference d, and d = || A i+1 -A i ||; Among them, A i+1 is the point cloud P i+1 'Position coordinates; A i is the point cloud P i '; in step 5-4, when d>min_dis, a downsampled adaptive gluing trajectory interpolation point is formed; wherein min_dis is the minimum Euclidean distance difference threshold.
[0027] In step 3, before using the clustering algorithm to perform cluster analysis on the pure workpiece point cloud, it is necessary to first set the clustering threshold parameters according to the smoothness of the contour of the workpiece surface to be coated; wherein the clustering threshold parameters include the smoothing threshold C th and the curvature threshold θ th ; The specific setting method of clustering threshold parameters is:
[0028] A. When the surface of the workpiece to be coated is smooth, C th ≥20,θ th ≤0.1.
[0029] B. When the surface of the workpiece to be coated has more than two obvious convex and concave parts or sharp corners greater than 1 / 4 of the maximum radial thickness, C th <20,θ th >0.1; wherein, obvious convexity and concavity means that the difference of normal terms of adjacent highest convexity and concavity points is greater than the maximum radial thickness, and the difference of tangent terms is less than 2 times the maximum radial thickness.
[0030] The present invention has the following beneficial effects:
[0031] 1. The present invention obtains the three-dimensional point cloud data of the workpiece through 3D vision, and then generates the trajectory points of the robot gluing operation through an adaptive trajectory generation algorithm. The present invention does not rely on the template of the artificial prefabricated gluing trajectory, has the characteristics of high robustness and strong adaptability, greatly liberates productivity and improves the intelligentization of production.
[0032] 2. The present invention uses Laplace operator to perform morphological corrosion on the point cloud to avoid these interferences and directly extract the center line, thereby avoiding the problem of angular noise and poor robustness when extracting the center line by scaling.
[0033] 3. The present invention can adaptively downsample the interpolation points of the gluing trajectory. For curved edges, due to the large change rate of the points' curvature, the points retained are dense, and the contour details of the gluing are retained. For straight edges, the curvature change is small, and the points retained are sparse, which speeds up the gluing speed. BRIEF DESCRIPTION OF THE DRAWINGS
[0034] Figure 1 The flowchart of the three-dimensional vision-based robot adaptive gluing trajectory generation algorithm of the present invention is shown.
[0035] Figure 2 A schematic diagram showing the original workpiece point cloud in the present invention.
[0036] Figure 3 A schematic diagram of a pure workpiece point cloud in the present invention is shown.
[0037] Figure 4 A schematic diagram showing cluster analysis of pure workpiece point cloud in the present invention is shown.
[0038] Figure 5 A schematic diagram showing the clustering of glue-coated planes separated in the present invention.
[0039] Figure 6 A schematic diagram showing the gluing track points in the present invention. DETAILED DESCRIPTION
[0040] The present invention will be further described in detail below in conjunction with the accompanying drawings and specific preferred embodiments.
[0041] In the description of the present invention, it should be understood that the terms "left side", "right side", "upper part", "lower part" and the like indicate the orientation or positional relationship based on the orientation or positional relationship shown in the drawings, which is only for the convenience of describing the present invention and simplifying the description, and does not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation. "First", "second" and the like do not indicate the importance of the components, and therefore cannot be understood as limiting the present invention. The specific dimensions used in this embodiment are only for illustrating the technical solution, and do not limit the scope of protection of the present invention.
[0042] like Figure 1 As shown, a robot adaptive gluing trajectory generation algorithm based on three-dimensional vision includes the following steps.
[0043] Step 1: Get the original workpiece point cloud: Place the workpiece with the surface to be coated facing up on the material table; Use a 3D camera to take a picture of the surface to be coated to obtain the original workpiece point cloud. Figure 2 The original workpiece point cloud shown is denoted as point set {P}.
[0044] Step 2: Get pure workpiece point cloud: remove the material platform point cloud from the original workpiece point cloud to get the following Figure 3 Pure workpiece point cloud shown.
[0045] The above-mentioned method for removing the material platform point cloud preferably includes the following steps.
[0046] Step 2-1, statistical filtering: Filter the original point cloud data {P} using the statistical filtering method to remove outliers and obtain the point cloud set {P1'}.
[0047] Step 2-2, through filtering: Set the upper left corner of the material table as the reference point, its coordinates in the camera coordinate system (X, Y), the material table height is H, the material table length is L, the material table width is W, the workpiece height is h, set the maximum workpiece error to Δh, the maximum error of the material table length is ΔL, and the maximum error of the material table height is ΔW, then the through filtering parameters (X, Y) in the XYZ direction are min , X max , Y min , Y max , Z min , Z max ) can be set to:
[0048]
[0049] The above X min and X max They are respectively the minimum and maximum allowable thresholds in the X direction during through filtering.
[0050] The above Y min and Y max They are respectively the minimum and maximum allowable thresholds in the Y direction during through filtering.
[0051] The above Z min and Z max They are respectively the minimum and maximum allowable thresholds in the Z direction during through filtering.
[0052] After the above point cloud set {P1'} is through-filtered, a filtered point cloud set {P2'} is obtained.
[0053] Step 2-3, removing the material table plane, specifically includes the following steps.
[0054] Step 2-3A, calculate normals: calculate normals for the point cloud set {P2'} to obtain P'2_Normals. The normal calculation process is accelerated using OpenMP technology.
[0055] Step 2-3B, split the table plane and the workpiece: take the point cloud {P2'} and its normal P'2_Normals as input, and set the maximum number of iterations M itera= 1000, distance weight W = 0.1, distance threshold Δ = min (h / 3, 10), the random sampling consensus method (RANSAC) is used to iteratively fit the parameters of the plane equation Ax + By + Cz = D, so as to extract the discharge platform plane {P' plan}, the rear rejection table plane {P' plan}, and then obtain the point cloud set {P3'} without the platform plane.
[0056] Step 2-4, workpiece judgment: Calculate the centroid of the point cloud {P3'}, and its centroid coordinates are (X, Y, Z). If Z>H+Δh, it means that after removing the plane point cloud of the material table, there is still a workpiece point cloud, and there is a workpiece on the material table, otherwise there is no workpiece on the material table. If there is a workpiece, execute step 2-5; if not, wait for the camera to take a picture again.
[0057] Step 2-5, statistical filtering again: perform statistical filtering on {P3'}, remove the remaining clutter on the plane of the worktable, obtain a pure workpiece point cloud, and record it as the point cloud set {P4'}.
[0058] Step 3, separate the glue-coated plane clusters: Use a clustering algorithm to perform cluster analysis on the pure workpiece point cloud obtained in step 2, so as to calculate the point cloud corresponding to the maximum OBB bounding box, which is the glue-coated plane cluster of the workpiece outer frame.
[0059] The above method of performing cluster analysis on pure workpiece point cloud using clustering algorithm preferably includes the following steps.
[0060] Step 3-1, set clustering threshold parameters: Clustering threshold parameters include smoothing threshold C th and the curvature threshold θ th , needs to be set according to the smoothness of the contour of the workpiece surface to be coated with glue. The specific setting method is preferably:
[0061] A. When the surface of the workpiece to be coated is smooth, C th ≥20,θ th ≤0.1. For example, for the outer contour of an ellipse, the preferred value is C th =30.0,θ th =0.05.
[0062] B. When the surface of the workpiece to be coated has more than two obvious convex and concave parts or sharp corners greater than 1 / 4 of the maximum radial thickness, C th <20,θ th >0.1; where obvious convexity and concavity means that the difference between the normal items of the adjacent highest convexity and concavity points is greater than the maximum radial thickness, and the difference between the tangent items is less than 2 times the maximum radial thickness. For example, for a star-shaped outer contour, the preferred value is C th =10.0,θ th =0.2.
[0063] Step 3-2, calculate cluster analysis parameters: Cluster analysis parameters include the minimum number of cluster points and the number of search neighborhood points; assuming that the number of point clouds in the point cloud set {P4'} is m, the minimum number of cluster points is m / 100, and the number of search neighborhood points is max(m / 1000, 20).
[0064] Step 3-3, point cloud sorting: Calculate the normal and curvature of each point in the point cloud set {P4'}, and sort the point cloud in ascending order of curvature.
[0065] Step 3-4, cluster growth: add the point with the smallest curvature as a seed to the cluster area, traverse the points in the search neighborhood, and calculate C th and θ th If the curvature is less than the threshold, the point is added to the clustering region, so that the cluster begins to grow; clustering is achieved through the region growing method, and the point cloud of the workpiece is divided into n different subsets Specific as Figure 4 As shown, Figure 4 Different colors represent different clusters.
[0066] Each of the above clusters is a smooth plane-like region with a small internal curvature change rate.
[0067] Step 3-5, rotated circumscribed bounding box: For each cluster, the smallest rotated circumscribed bounding box (Oriented Bounding Box, OBB) is calculated. In the present invention, since the glue coating plane is the outer frame of the workpiece, it is also the plane cluster with the largest envelope. Therefore, the glue coating plane is the cluster {P5'} for which the volume of the largest OBB bounding box is calculated, specifically:
[0068]
[0069] Through the above calculation, the glue coating plane of the workpiece frame can be adaptively separated, as shown in the following example: Figure 5 shown.
[0070] Step 4, obtaining the glue coating center line: cluster the glue coating planes obtained in step 3, and use morphology to erode the center line from the inner and outer sides respectively, so as to obtain the glue coating center line.
[0071] Due to the noise in point cloud imaging, the rubber-coated annular surface may have outlier noise points, corners and burrs. The traditional method of extracting the centerline is to extract the outer contour using Alpha shape and scale it. This method may extract these corner noises and is not robust. Using Laplace operator to perform morphological corrosion on the point cloud can avoid these interferences and directly extract the centerline.
[0072] In this embodiment, the Laplace operator is preferably used to cluster the glue-coated planes obtained in step 3, and erode them from the inner and outer sides toward the center line respectively.
[0073] The above Laplace operator is expressed as follows:
[0074]
[0075]
[0076]
[0077] In the formula, Characterizes the attraction of the point cloud at the tth iteration, and its weight represents the ability to maintain its original position. If the attraction weight is too strong, the point cloud may not shrink enough, thus affecting the accuracy of skeleton extraction. On the contrary, if the attraction weight is too weak, the point cloud may shrink too much and lose important shape features.
[0078] Characterizes the attractive force of the point cloud at the t+1th iteration.
[0079] Characterizes the contraction strength of the point cloud at the tth iteration, and its weight represents the strength of the point cloud contraction. If the initial contraction weight is small, the thinner parts of the model tend to expand outward; if the contraction weight is too large, the strong contraction force of the thicker area may attract the points of the thinner parts nearby, causing them to deviate from the model.
[0080] Characterizes the contraction strength at the t+1th iteration.
[0081] and is a diagonal matrix. When t=0, by controlling and The size of , so that the point cloud can converge quickly while keeping the shape basically unchanged, thereby ensuring that the point cloud of the contraction equation moves along the estimated normal direction.
[0082] In this embodiment, it is preferred More preferably, it is 1.0; More preferably, 1 / 4S 0 ; Among them, S 0 is the average neighborhood range of the point cloud in the glue plane cluster at t=0.
[0083] S t The average neighborhood range at iteration t within the rubber plane clustering.
[0084] L tis the Laplace matrix at the tth iteration, which is a weighted cotangent matrix constructed using Delaunay neighborhood points, with k nearest neighbors as parameters (existing known parameters), initialized to 0.01 times the number of {P5'} point clouds.
[0085] s L The hyperparameter is set to 3.0, which is matched with Iter_max to make the point cloud reach the optimal shrinkage state before the maximum number of iterations.
[0086] P t+1 , P t They are the point clouds at the t+1th and tth iterations respectively.
[0087] The above method of performing erosion using the Laplace operator preferably includes the following steps.
[0088] Step 4-1. Calculate P t+1 :According to the known P t , use formula (1) to find P t+1 .
[0089] In this embodiment, P5' is used as the initial point cloud Calculate L 0 ,initialization After that, the first iteration starts and the formula (1) is used to calculate
[0090] Step 4-2, Update and Using formulas (2) and (3), according to and calculate and
[0091] In this embodiment, in the first iteration, update and And so on.
[0092] Step 4-3: Calculate L t+1 :Using the new point cloud P t+1 Calculate the new Laplacian matrix L t+1 In this embodiment, in the first iteration, update L 1 , and so on.
[0093] Step 4-4, iteration, the iteration termination condition is Or the maximum number of iterations Iter_max is exceeded. In this embodiment, after the iteration is terminated, P6' will be obtained.
[0094] The above maximum number of iterations Iter_max is related to the radial thickness ΔR of the glue-coated plane cluster; when ΔR≤1cm, Iter_max=3-4; when ΔR>1cm, Iter_max=5-6.
[0095] The radial thickness ΔR = R out -R in , the specific calculation method is:
[0096] A. When the glue coating plane of the workpiece is clustered into a ring, R in is the radius of the inner contour of the glue plane cluster, R out The radius of the outer contour of the glued plane cluster.
[0097] B. When the glue-coating plane cluster of the workpiece is non-circular, the length of the intersection line of the ray from the centroid and the inner and outer contours of the glue-coating plane cluster is R. in and R out When the glue-coated planes are clustered unequally and the difference is large, ΔR takes the maximum radial thickness, that is, ΔR = max(R in -R out ).
[0098] Step 5, obtain the gluing trajectory point set: all the point clouds on the gluing centerline obtained in step 4 are first sorted clockwise, and then the set parameter difference between two adjacent points is calculated; when the set parameter difference is not less than the set parameter minimum threshold, a downsampled adaptive gluing trajectory interpolation point is formed; when all the point clouds on the gluing centerline are traversed, all the adaptive gluing trajectory interpolation points obtained are formed into a gluing trajectory point set.
[0099] The method for obtaining the above-mentioned gluing trajectory point set preferably includes the following steps.
[0100] Step 5-1, calculate the center of mass O: calculate the center of mass O of all point clouds on the glue coating midline in step 4, and use the center of mass O as the center of clockwise rotation.
[0101] Step 5-2, clockwise sorting: traverse any two points P on the glue coating midline in sequence i and P j , and determine the vector OP i and vector OP j The cross product of; when the cross product is less than zero, it is determined that the vector OP i In vector OP j In the clockwise direction; when all point clouds on the glue coating midline are traversed, a clockwise sorted point set {P7'} is obtained.
[0102] Step 5-3, calculate the difference of the set parameters: set any two adjacent points P in the point set {P7'} i ' and Pi+1 ', and P i+1 'Located in P i 'clockwise direction; calculate the point cloud P i ' and P i+1 'The setting parameter difference.
[0103] In this embodiment, the above-mentioned setting parameter difference has two preferred implementation modes.
[0104] A. Set the parameter difference to the normal vector difference Δn, and Δn=||n i+1 -n i ||; where n i+1 is the point cloud P i+1 'Normal vector; n i is the point cloud P i 'Normal vector.
[0105] B. Set the parameter difference to the Euclidean distance difference d, and d = || A i+1 -A i ||; Among them, A i+1 is the point cloud P i+1 'Position coordinates; A i is the point cloud P i ' location coordinates.
[0106] Step 5-4, forming an adaptive gluing trajectory interpolation point: when the set parameter difference is not less than the set parameter minimum threshold, a down-sampled adaptive gluing trajectory interpolation point is formed.
[0107] According to two preferred embodiments of setting the parameter difference, this step preferably has the following two judgment methods:
[0108] A. When Δn>min_grad, a downsampled adaptive gluing trajectory interpolation point is formed; where min_grad is the minimum normal vector difference threshold.
[0109] B. In step 5-4, when d>min_dis, a downsampled adaptive gluing trajectory interpolation point is formed; wherein min_dis is the minimum Euclidean distance difference threshold.
[0110] Step 5-5, obtaining the gluing trajectory point set: traverse all point clouds on the gluing centerline in sequence, and obtain all the adaptive gluing trajectory interpolation points to form the gluing trajectory point set S.
[0111] The present invention can adaptively downsample the interpolation points of the gluing trajectory. For curved edges, due to the large change rate of the points' curvature, the points retained are dense, and the contour details of the gluing are retained. For straight edges, the curvature change is small, and the points retained are sparse, which speeds up the gluing speed.
[0112] Step 6, gluing: the gluing robot walks clockwise or counterclockwise according to the gluing trajectory point set in step 5, and the walking time between two adjacent gluing trajectory points in the gluing trajectory point set is the same.
[0113] The present invention obtains the three-dimensional point cloud data of the workpiece through 3D vision, and then generates the trajectory points of the robot gluing operation through an adaptive trajectory generation algorithm. The present invention does not rely on the template of the artificial prefabricated gluing trajectory, has the characteristics of high robustness and strong adaptability, greatly liberates productivity and improves the intelligentization of production. The present invention has the advantages of high robustness and can realize adaptive gluing for complex trajectories.
[0114] The preferred embodiments of the present invention are described in detail above; however, the present invention is not limited to the specific details in the above embodiments. Within the technical concept of the present invention, various equivalent transformations can be made to the technical solutions of the present invention, and these equivalent transformations all belong to the protection scope of the present invention.
Claims
1. A robot adaptive gluing trajectory generation algorithm based on three-dimensional vision, characterized by: The steps include: Step 1, obtaining the original workpiece point cloud: placing the workpiece with the surface to be coated facing upward on the material table; taking a picture of the surface to be coated with glue using a 3D camera to obtain the original workpiece point cloud; Step 2, obtaining pure workpiece point cloud: removing the material platform point cloud from the original workpiece point cloud to obtain a pure workpiece point cloud; Step 3, separate the glue-coated plane clusters: use a clustering algorithm to perform cluster analysis on the pure workpiece point cloud obtained in step 2, so as to calculate the point cloud corresponding to the maximum OBB bounding box, which is the glue-coated plane cluster of the workpiece outer frame; Step 4, obtaining the glue coating center line: clustering the glue coating planes obtained in step 3, and using morphology to erode the center line from both the inner and outer sides, so as to obtain the glue coating center line; In step 4, the Laplace operator is used to cluster the glue-spreading plane obtained in step 3, and erodes from the inner and outer sides to the center line respectively; wherein, the k nearest neighbors involved in the Laplace matrix in the Laplace operator are initialized to 0.01 times the number of clustered point clouds of the glue-spreading plane; Step 5, obtaining the gluing trajectory point set: first sort all the point clouds on the gluing center line obtained in step 4 in clockwise order, then calculate the difference between the set parameters of two adjacent points; when the difference between the set parameters is greater than the minimum threshold of the set parameters, form a downsampled adaptive gluing trajectory interpolation point; when all the point clouds on the gluing center line are traversed, all the adaptive gluing trajectory interpolation points obtained are formed into the gluing trajectory point set, and the specific acquisition method includes the following steps: Step 5-1, calculate the center of mass O: calculate the center of mass O of all point clouds on the glue coating midline in step 4, and use the center of mass O as the center of clockwise rotation; Step 5-2, clockwise sorting: traverse any two points P on the glue coating midline in sequence i and P j , and determine the vector OP i and vector OP j The cross product of; when the cross product is less than zero, it is determined that the vector OP i In vector OP j In the clockwise direction; when all point clouds on the glue coating midline are traversed, a point set {P7'} in clockwise order is obtained; Step 5-3, calculate the difference of the set parameters: set any two adjacent points P in the point set {P7'} i ' and P i+1 ', and P i+1 'Located in P i 'clockwise direction; calculate the point cloud P i ' and P i+1 '; wherein the parameter difference is set to the normal vector difference Δn, and Δn = ||n i+1 -n i ||; where n i+1 is the point cloud P i+1 'Normal vector; n i is the point cloud P i 'Normal vector; Step 5-4, forming an adaptive gluing trajectory interpolation point: when the set parameter difference is greater than the set parameter minimum threshold, a downsampled adaptive gluing trajectory interpolation point is formed; wherein, when Δn>min_grad, a downsampled adaptive gluing trajectory interpolation point is formed; wherein, min_grad is the minimum normal vector difference threshold; Step 5-5, obtaining the gluing trajectory point set: traverse all point clouds on the gluing centerline in sequence, and obtain all the adaptive gluing trajectory interpolation points to form the gluing trajectory point set S; Step 6, gluing: the gluing robot walks clockwise or counterclockwise according to the gluing trajectory point set in step 5, and the walking time between two adjacent gluing trajectory points in the gluing trajectory point set is the same.
2. The robot adaptive gluing trajectory generation algorithm based on three-dimensional vision according to claim 1 is characterized by: In step 4, the Laplace operator is used Characterizes the contraction strength of the point cloud at the tth iteration; use Characterizes the attractive force of the point cloud at the tth iteration; When t = 0, by controlling and The size of the point cloud is reduced, so that the point cloud can be iterated and converged quickly while keeping the shape basically unchanged.
3. The robot adaptive gluing trajectory generation algorithm based on three-dimensional vision according to claim 2 is characterized by: Among them, S 0 is the average neighborhood range of the point cloud within the glue plane cluster.
4. The robot adaptive gluing trajectory generation algorithm based on three-dimensional vision according to claim 2 is characterized by: The iteration termination condition of the Laplace operator is Or the maximum number of iterations Iter_max is exceeded; Characterizes the attractive force of the point cloud at the t+1th iteration.
5. The robot adaptive gluing trajectory generation algorithm based on three-dimensional vision according to claim 4 is characterized in that: The maximum number of iterations Iter_max is related to the radial thickness ΔR of the glue-coated plane cluster; when ΔR≤1cm, Iter_max=3-4; when ΔR>1cm, Iter_max=5-6.
6. The robot adaptive gluing trajectory generation algorithm based on three-dimensional vision according to claim 1 is characterized by: In step 3, before using the clustering algorithm to perform cluster analysis on the pure workpiece point cloud, it is necessary to first set the clustering threshold parameters according to the smoothness of the contour of the workpiece surface to be coated; wherein the clustering threshold parameters include the smoothing threshold C th and the curvature threshold θ th ; The specific setting method of clustering threshold parameters is: A. When the surface of the workpiece to be coated is smooth, C th ≥20,θ th ≤0.1; B. When the surface of the workpiece to be coated has more than two obvious convex and concave parts or sharp corners greater than 1 / 4 of the maximum radial thickness, C th <20,θ th >0.1; wherein, obvious convexity and concavity means that the difference of normal terms of adjacent highest convexity and concavity points is greater than the maximum radial thickness, and the difference of tangent terms is less than 2 times the maximum radial thickness.
