Weld joint identification method and device, electronic equipment and readable storage medium
By using the midpoint of the starting point and end point of the welding seam and the disturbance point to select the plane in the welding seam identification, the problem of welding seam identification errors caused by the deviation of the workpiece model and point cloud and the extremely narrow plane in the existing technology is solved, and the welding seam is improved. Recognition accuracy.
Patent Information
- Application Number
- CN202410629450.0
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-21
- Publication Date
- 2024-08-30
AI Technical Summary
Existing straight-line weld recognition solutions based on interactive information are prone to weld recognition errors during the ship workpiece welding process due to deviations between the workpiece model and the collected point cloud and welds composed of extremely narrow planes.
By determining the workpiece point cloud of the workpiece to be welded, calculate the midpoint of the starting point and end point of the weld, establish the target coordinate system, and obtain the disturbance point based on the midpoint and the preset disturbance radius and disturbance angle, and obtain the sum of the midpoint and the midpoint from all planes. Disturb the plane group corresponding to the point and select the best plane combination for weld recognition.
The accuracy of weld seam identification is improved, and the selection of disturbance points ensures that the correct plane is selected, thereby reducing false identifications.
Smart Images

Figure CN118570147A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of weld identification, and in particular to a weld identification method, device, and readable storage medium. Background Art
[0002] In the existing linear weld recognition scheme based on interactive information, the workpiece is first roughly positioned, and the workpiece model point cloud is aligned with the collected workpiece point cloud to determine the workpiece posture and obtain the roughly aligned rotation matrix R and translation vector T. Then, the starting point p1 and end point p2 of the linear weld are selected on the workpiece model, and p1 and p2 are transferred to the robot base coordinate system through the rotation matrix R and translation vector T, that is, p1'=R·p1+T, p2'=R·p2+T, and then the plane in the collected point cloud is detected, and the two planes closest to p1' and p2' are used as candidate planes. After the intersection of the candidate planes is calculated, p1' and p2' are projected onto the intersection line to obtain the projection points p1" and p2", and the straight line segment between the projection points is the linear weld recognition result.
[0003] In the above scheme, the position information of p1' and p2' is needed to select two planes constituting the weld from all detected planes. Since p1' and p2' are transferred from the points on the workpiece model to the robot base coordinate system through the workpiece rough positioning R and T, and there may be a large deviation between the workpiece model and the collected point cloud, p1' and p2' may be far away from the actual weld. At this time, only the distance from the point to the plane is used to select the plane, and the wrong plane is often selected. In addition, in the welding process of ship workpieces, welds composed of extremely narrow planes are often encountered. When a weld composed of extremely narrow planes appears, the existing plane selection algorithm is likely to select the wrong plane, resulting in errors in weld identification. Summary of the invention
[0004] The object of the present invention is to provide a weld identification method, device, electronic device and readable storage medium, which can improve the accuracy of weld identification.
[0005] In order to achieve the above purpose, the technical solution adopted by the embodiment of the present invention is as follows:
[0006] In a first aspect, an embodiment of the present invention provides a weld identification method, the method comprising:
[0007] Determine a workpiece point cloud of a workpiece to be welded;
[0008] Determine the starting point and the end point of the weld to be welded of the workpiece point cloud in the robot base coordinate system;
[0009] Detect all planes in the workpiece point cloud;
[0010] Calculate the midpoint of the starting point and the end point;
[0011] Establishing a target coordinate system based on the starting point and the end point;
[0012] Based on the midpoint, a plurality of preset disturbance radii, a plurality of disturbance angles, and a target coordinate system, a plurality of disturbance points are obtained;
[0013] Respectively acquiring a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point from all planes;
[0014] Acquire a target plane group from the first plane group and each of the second plane groups;
[0015] The weld seams to be welded are identified based on the target plane group.
[0016] Optionally, the step of obtaining a plurality of disturbance points based on the midpoint and a plurality of preset disturbance radii and disturbance angles comprises:
[0017] For each disturbance radius and each disturbance angle, calculating a first product of a cosine value of the disturbance angle and a unit vector of an x-axis of the target coordinate system;
[0018] Calculate the second product of the sine value of the disturbance angle and the unit vector of the y-axis of the target coordinate system;
[0019] calculating a first sum of the first product and the second product;
[0020] calculating a third product of the disturbance radius and the first sum;
[0021] A second sum of the midpoint and the third product is calculated as a disturbance point.
[0022] Optionally, the step of respectively acquiring a first plane group corresponding to the midpoint from all planes includes:
[0023] Traversing each of the planes, and determining the third projection point of the midpoint on the plane;
[0024] Constructing a point set based on all points in the plane;
[0025] Determine a first target point closest to the third projection point from the point set and determine a first distance between the third projection point and the first target point;
[0026] determining a perpendicular distance between the midpoint and the plane;
[0027] Recording the labels of the planes and the vertical distances in a first array, to obtain a first array including a plurality of labels and a plurality of vertical distances;
[0028] Based on the first distance, determining a positional relationship between the plane and the weld to be welded;
[0029] updating the first array based on the position relationship;
[0030] A first plane group corresponding to the midpoint is determined from the updated first array.
[0031] Optionally, the step of determining the positional relationship between the plane and the weld to be welded based on the first distance includes:
[0032] comparing the first distance with a preset distance;
[0033] When the first distance is less than the preset distance, determining a normal vector of the plane;
[0034] Determine the angle between the normal vector and the z-axis;
[0035] When the included angle is greater than a first preset angle, determining the centroid of the plane;
[0036] Calculating a first difference between the centroid and the starting point and a second difference between the centroid and the end point;
[0037] When the first difference and the second difference are both smaller than zero, it is determined that the plane is located below the weld to be welded.
[0038] Optionally, the step of updating the first array based on the position relationship includes:
[0039] When the plane is located below the weld to be welded, the vertical distance between the plane and the midpoint is adjusted to a preset value, and the first array is updated.
[0040] Optionally, the method further comprises:
[0041] When the first distance is greater than or equal to the preset distance, the vertical distance between the plane and the midpoint is adjusted to a preset value, and the first array is updated.
[0042] Optionally, the step of determining a first plane group corresponding to the midpoint from the updated first array comprises:
[0043] Sort the updated vertical distances in the first array in ascending order;
[0044] Determine the plane corresponding to the minimum vertical distance as the first plane;
[0045] determining a first normal vector of the first plane;
[0046] Traversing each plane except the first plane, and determining, from each plane except the first plane, a first plane whose second angle with the first normal vector is greater than or equal to a second preset angle as the second plane, wherein the second preset angle is less than the first preset angle;
[0047] The first plane and the second plane are used as a first plane group of the midpoint.
[0048] Optionally, the step of identifying the weld to be welded based on the target plane group includes:
[0049] Calculating an intersection line of a first target plane and a second target plane, wherein the target plane group includes the first target plane and the second target plane;
[0050] Projecting the starting point and the end point onto the intersection line to obtain a first projection point and a second projection point;
[0051] The straight line segment between the first projection point and the second projection point is used as the weld to be welded of the workpiece to be welded.
[0052] In a second aspect, an embodiment of the present invention provides a weld identification device, the device comprising:
[0053] A determination module is used to determine a workpiece point cloud of a workpiece to be welded; and to determine a starting point and an end point of a weld to be welded of the workpiece point cloud in a robot base coordinate system;
[0054] A detection module, used for detecting all planes in the workpiece point cloud;
[0055] A calculation module, used for calculating the midpoint of the starting point and the end point;
[0056] A coordinate system building module, used for building a target coordinate system based on the starting point and the end point;
[0057] The determination module is further used to: obtain multiple disturbance points based on the midpoint, multiple preset disturbance radii, multiple disturbance angles and a target coordinate system; obtain a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point from all planes; and obtain a target plane group from the first plane group and each second plane group;
[0058] The recognition module is used to recognize the weld to be welded based on the target plane group.
[0059] In a third aspect, an embodiment of the present invention provides an electronic device, including a memory and a processor, wherein the memory stores a computer program, and the processor implements the steps of the weld identification method when executing the computer program.
[0060] In a fourth aspect, an embodiment of the present invention provides a readable storage medium having a computer program stored thereon, which implements the steps of the weld identification method when executed by a processor.
[0061] The present invention has the following beneficial effects:
[0062] The present invention determines the workpiece point cloud of the workpiece to be welded, determines the starting point and end point of the weld to be welded of the workpiece point cloud in the robot base coordinate system, detects all planes in the workpiece point cloud, calculates the midpoint of the starting point and the end point, establishes a target coordinate system based on the starting point and the end point, obtains multiple disturbance points based on the midpoint, multiple preset disturbance radii, multiple disturbance angles and the target coordinate system, obtains a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point from all planes, obtains a target plane group from the first plane group and each second plane group, and identifies the weld to be welded based on the target plane group. Based on the weld identification method of the present invention, the midpoint of the starting point and the end point of the weld and the disturbance point are used to select the plane, each disturbance point will select 2 planes, and then compare all the disturbance points and the planes selected by the midpoint, and select the best plane combination from them, because the disturbance point is generated near the midpoint of the selected point, and the correct plane can be selected based on the disturbance point, thereby improving the accuracy of identifying the weld. BRIEF DESCRIPTION OF THE DRAWINGS
[0063] In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings required for use in the embodiments are briefly introduced below. It should be understood that the following drawings only show certain embodiments of the present invention and therefore should not be regarded as limiting the scope. For ordinary technicians in this field, other related drawings can be obtained based on these drawings without creative work.
[0064] Figure 1 A block diagram of an electronic device provided by an embodiment of the present invention;
[0065] Figure 2 One of the flow charts of a weld identification method provided by an embodiment of the present invention;
[0066] Figure 3 A second flow chart of a weld identification method provided by an embodiment of the present invention;
[0067] Figure 4 A third flow chart of a weld identification method provided by an embodiment of the present invention;
[0068] Figure 5 A fourth flow chart of a weld identification method provided by an embodiment of the present invention;
[0069] Figure 6 A fifth flow chart of a weld identification method provided by an embodiment of the present invention;
[0070] Figure 7 A sixth flow chart of a weld identification method provided by an embodiment of the present invention;
[0071] Figure 8 A structural block diagram of a weld identification device provided in an embodiment of the present invention. DETAILED DESCRIPTION
[0072] In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Generally, the components of the embodiments of the present invention described and shown in the drawings here can be arranged and designed in various different configurations.
[0073] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the invention claimed for protection, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by ordinary technicians in this field without creative work are within the scope of protection of the present invention.
[0074] It should be noted that similar reference numerals and letters denote similar items in the following drawings, and therefore, once an item is defined in one drawing, further definition and explanation thereof is not required in subsequent drawings.
[0075] In the description of the present invention, it should be noted that if the terms "upper", "lower", "inside", "outside", etc. appear to indicate an orientation or position relationship, they are based on the orientation or position relationship shown in the accompanying drawings, or are the orientation or position relationship in which the product of the invention is usually placed when used. They are only for the convenience of describing the present invention and simplifying the description, and do not indicate or imply that the device or element referred to must have a specific orientation, be constructed and operated in a specific orientation, and therefore cannot be understood as a limitation on the present invention.
[0076] In addition, the terms “first”, “second”, etc., if used, are merely used to distinguish between the descriptions and should not be understood as indicating or implying relative importance.
[0077] In the description of the present invention, it is also necessary to explain that, unless otherwise clearly specified and limited, the terms "set", "install", "connect", and "connect" should be understood in a broad sense, for example, it can be a fixed connection, a detachable connection, or an integral connection; it can be a mechanical connection or an electrical connection; it can be a direct connection, or it can be indirectly connected through an intermediate medium, or it can be the internal communication of two elements. For ordinary technicians in this field, the specific meanings of the above terms in the present invention can be understood according to specific circumstances.
[0078] After extensive research, it was found that in the existing linear weld recognition scheme based on interactive information, the workpiece is first roughly positioned, and the workpiece model point cloud is aligned with the collected workpiece point cloud to determine the workpiece posture and obtain the roughly aligned rotation matrix R and translation vector T. Then, the starting point p1 and end point p2 of the linear weld are selected on the workpiece model, and p1 and p2 are transferred to the robot base coordinate system through the rotation matrix R and translation vector T, that is, p1'=R·p1+T, p2'=R·p2+T, and then the planes in the collected point cloud are detected, and the two planes closest to p1' and p2' are used as candidate planes. After the intersection of the candidate planes is calculated, p1' and p2' are projected onto the intersection line to obtain the projection points p1" and p2", and the straight line segment between the projection points is the linear weld recognition result.
[0079] In the above scheme, the position information of p1' and p2' is needed to select two planes constituting the weld from all detected planes. Since p1' and p2' are transferred from the points on the workpiece model to the robot base coordinate system through the workpiece rough positioning R and T, and there may be a large deviation between the workpiece model and the collected point cloud, p1' and p2' may be far away from the actual weld. At this time, only the distance from the point to the plane is used to select the plane, and the wrong plane is often selected. In addition, in the welding process of ship workpieces, welds composed of extremely narrow planes are often encountered. When a weld composed of extremely narrow planes appears, the existing plane selection algorithm is likely to select the wrong plane, resulting in errors in weld identification.
[0080] In view of the discovery of the above problems, the present embodiment provides a weld identification method, device, and readable storage medium, which can determine the workpiece point cloud of the workpiece to be welded, determine the starting point and end point of the weld to be welded in the workpiece point cloud in the robot base coordinate system, detect all planes in the workpiece point cloud, calculate the midpoint of the starting point and the end point, establish a target coordinate system based on the starting point and the end point, obtain multiple disturbance points based on the midpoint, multiple preset disturbance radii, multiple disturbance angles and the target coordinate system, respectively obtain a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point from all planes, obtain a target plane group from the first plane group and each second plane group, and identify the weld to be welded based on the target plane group. Based on the weld identification method of the present invention, the midpoints of the starting point and the end point of the weld to be welded and the disturbance point are used to select the plane. Two planes are selected for each disturbance point, and then all the disturbance points and the planes selected by the midpoint are compared to select the best plane combination. Because the disturbance point is generated near the midpoint of the selected point, the correct plane can be selected based on the disturbance point, thereby improving the accuracy of identifying the weld. The scheme provided in this embodiment is described in detail below.
[0081] This embodiment provides an electronic device that can identify welds. In a possible implementation, the electronic device can be a user terminal, for example, the electronic device can be, but is not limited to, a server, a smart phone, a personal computer (PC), a tablet computer, a personal digital assistant (PDA), a mobile Internet device (MID), etc.
[0082] Please refer to Figure 1 , Figure 1 1 is a schematic diagram of the structure of an electronic device 100 provided in an embodiment of the present invention. The electronic device 100 may also include Figure 1 More or fewer components as shown, or with Figure 1 Different configurations shown. Figure 1 Each component shown in the figure can be implemented by hardware, software or a combination thereof.
[0083] The electronic device 100 includes a weld identification device 110 , a memory 120 and a processor 130 .
[0084] The memory 120 and the processor 130 are electrically connected to each other directly or indirectly to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines. The weld identification device 110 includes at least one software function module that can be stored in the memory 120 in the form of software or firmware or solidified in the operating system (OS) of the electronic device 100. The processor 130 is used to execute the executable modules stored in the memory 120, such as the software function modules and computer programs included in the weld identification device 110.
[0085] The memory 120 may be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read-only memory (PROM), an erasable programmable read-only memory (EPROM), an electrically erasable read-only memory (EEPROM), etc. The memory 120 is used to store a program, and the processor 130 executes the program after receiving an execution instruction.
[0086] Please refer to Figure 2 , Figure 2 For application Figure 1 A flow chart of a weld identification method of an electronic device 100 is provided, and the method including each step is described in detail below.
[0087] S201: Determine a workpiece point cloud of a workpiece to be welded.
[0088] S202: Determine the starting point and the end point of the weld to be welded in the workpiece point cloud in the robot base coordinate system.
[0089] S203: Detect all planes in the workpiece point cloud.
[0090] S204: Calculate the midpoint between the start point and the end point.
[0091] S205: Establish a target coordinate system based on the starting point and the end point.
[0092] S206: Obtain multiple disturbance points based on the midpoint, multiple preset disturbance radii, multiple disturbance angles, and the target coordinate system.
[0093] S207: Obtaining from all planes a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point.
[0094] S208: Acquire a target plane group from the first plane group and each second plane group.
[0095] S209: Identify the weld to be welded based on the target plane group.
[0096] Use a 3D camera to collect the workpiece point cloud of the workpiece to be welded, import the workpiece model point cloud, and use the point cloud registration algorithm to align the collected workpiece point cloud with the workpiece model point cloud. Use the hand-eye calibration matrix and the robot TCP (tool center position) posture to transfer the collected workpiece point cloud to the robot base coordinate system. The workpiece model point cloud is located in a standard coordinate system. After registration, the rotation matrix R and translation vector T of the workpiece model point cloud to the collected workpiece point cloud are obtained. Select the starting point p1 and end point p2 of the linear weld to be welded on the workpiece model. Transfer p1 and p2 to the robot base coordinate system through the rotation matrix R and translation vector T to obtain the starting point p1' and end point p2' of the weld to be welded.
[0097] A plane detection algorithm may be used to detect all planes in the workpiece point cloud, wherein the plane detection algorithm may use a random Hough transform method, a deterministic voting algorithm, or a random sampling consensus algorithm, which is not specifically limited in the embodiment of the present invention.
[0098] Calculate the midpoint between the starting point p1' of the weld to be welded in the robot base coordinate system and the end point p2' of the weld to be welded in the robot base coordinate system: p middle =(p1'+p2') / 2.
[0099] There are many ways to construct a target coordinate system based on the starting point of the weld to be welded in the robot base coordinate system and the end point of the weld to be welded in the robot base coordinate system. In one implementation:
[0100] Calculate the direction vector formed by the line connecting the starting point p1' of the weld to be welded in the robot base coordinate system and the end point p2' of the weld to be welded in the robot base coordinate system, and record the direction vector as p 01_dir . Determine the direction vector p 01_dir The x-axis component p 01_dir,x , the component p in the y-axis direction 01_dir,y and the component p in the z-axis direction 01_dir,z , determine the direction vector p 01_dir The x-axis component p 01_dir,x Definitely worth it |p 01_dir,x |, determine the direction vector p 01_dir The y-axis component p01_dir, The absolute value of |p 01_dir,y |, and determine the direction vector p 01_dir The z-axis component p 01_dir,z The absolute value of |p 01_dir,z |, obtain the component with the largest absolute value among the three components, and calculate the target coordinate system based on the component with the largest absolute value.
[0101] If |p 01_dir,x | maximum, the target coordinate system is calculated as follows:
[0102] t 1,x =-p 01_dir,y / p 01_dir,x , t 1,y =1,t 1,z =0;
[0103] t2=p 01_dir ×t1;
[0104] Normalize t1 and t2 to get the target coordinate system.
[0105] If |p 01_dir,y | maximum, the target coordinate system is calculated as follows:
[0106] t 1,x =0,t 1,y =-p 01_dir,z / p 01_dir,y , t 1,z =1;
[0107] t2=p 01_dir ×t1;
[0108] Normalize t1 and t2 to get the target coordinate system.
[0109] If |p 01_dir,z | maximum, the target coordinate system is calculated as follows:
[0110] t 1,x =1,t 1,y =0,t 1,z =-p 01_dir,x / p 01_dir,z ;
[0111] t2=p 01_dir ×t1;
[0112] Normalize t1 and t2 to get the target coordinate system.
[0113] The planes are selected based on the midpoint and the disturbance point. Two planes are selected for each disturbance point. Then, the planes selected by all the disturbance points and the midpoint are compared to select the best plane combination.
[0114] The method of obtaining the target plane group from the first plane group and each second plane group may be:
[0115] The plane numbers in the first plane group are recorded in the array index_per_points, and the vertical distances are recorded in the array dis_per_points. The plane numbers of each second plane group are recorded in index_per_points, and the vertical distances are recorded in dis_per_points. Traverse the dis_per_points array to get the plane number corresponding to the minimum distance, which is the selected plane number.
[0116] Because the disturbance point is generated near the midpoint of the selected point, the correct plane can be selected based on the disturbance point, thereby improving the accuracy of weld identification.
[0117] There are many ways to obtain multiple disturbance points based on the midpoint, multiple preset disturbance radii, multiple disturbance angles, and the target coordinate system. In one implementation, for example, Figure 3 As shown, the following steps are included:
[0118] S206-1: For each disturbance radius and each disturbance angle, calculate the first product of the cosine value of the disturbance angle and the unit vector of the x-axis of the target coordinate system.
[0119] S206-2: Calculate the second product of the sine value of the disturbance angle and the unit vector of the y-axis of the target coordinate system.
[0120] S206-3: Calculate a first sum of the first product and the second product.
[0121] S206-4: Calculate the third product of the disturbance radius and the first sum.
[0122] S206-5: Calculate the second sum of the midpoint and the third product as the disturbance point.
[0123] For example, the disturbance radius can be set to {r1, r2, ..., r n}, a total of n disturbance radii, set the disturbance angle {θ1,θ2,...,θ m}, with a total of m disturbance angles. Generally speaking, the disturbance radius can be 3, 5, 7, etc., and the disturbance angle can be an angle uniformly sampled on a circle, such as 0, 90°, 180°, and 270°.
[0124] Traverse all disturbance radii and disturbance angles corresponding to the disturbance radius to obtain multiple disturbance points p per,ij , p per,ij =p middle +r i*(cos(θ j )·t1+sin(θ j )·t2), i=1...n, j=1...m.
[0125] There are many implementations for respectively obtaining the first plane group corresponding to the midpoint from all planes. In one implementation, Figure 4 As shown, the following steps are included:
[0126] S207-1: Traverse each plane and determine the third projection point of the midpoint on the plane.
[0127] S207-2: Construct a point set based on all points in the plane.
[0128] S207-3: Determine a first target point closest to the third projection point from the point set and determine a first distance between the third projection point and the first target point.
[0129] S207-4: Determine the vertical distance between the midpoint and the plane.
[0130] S207-5: Record the labels and vertical distances of the planes in a first array to obtain a first array including a plurality of labels and a plurality of vertical distances.
[0131] S207-6: Based on the first distance, determine the positional relationship between the plane and the weld to be welded.
[0132] S207-7: Update the first array based on the position relationship.
[0133] S207-8: Determine a first plane group corresponding to the midpoint from the updated first array.
[0134] For all detected planes, for each plane, a point set kdtree is constructed based on all points in plane i. The midpoint is projected onto plane i to obtain the third projection point p inplane , find the third projection point p in the point set kdtree corresponding to plane i inplane The nearest point is the first target point, and the third projection point p is calculated inplane The first distance between the first target point and the midpoint is calculated, and the perpendicular distance between the midpoint and plane i is calculated. The perpendicular distance between plane i and the midpoint and the index of plane i are recorded in the first array dis_planes[i].index. The size of the first array is equal to the number of planes. Each element in the first array is a structure containing two quantities, one is the index index_ and the other is the distance dis_. index_ is used to record the index of the current plane, and dis_ is used to record the perpendicular distance from the midpoint to plane i.
[0135] The positional relationship between the plane i and the weld to be welded is determined based on the first distance, the first array is updated based on the positional relationship, and a first plane group corresponding to the midpoint is determined from the updated first array.
[0136] There are many ways to implement the determination of the positional relationship between the plane and the weld to be welded based on the first distance. In one implementation, Figure 5 As shown, the following steps are included:
[0137] S301: Compare the first distance with a preset distance.
[0138] S302: When the first distance is less than a preset distance, determine a normal vector of the plane.
[0139] S303: Determine the angle between the normal vector and the z-axis.
[0140] S304: When the included angle is greater than the first preset angle, determine the centroid of the plane.
[0141] S305: Calculate a first difference between the centroid and the starting point and a second difference between the centroid and the end point.
[0142] S306: When the first difference and the second difference are both less than zero, determine that the plane is located below the weld to be welded.
[0143] Exemplary: when the first distance is less than the preset distance, the normal vector of the plane is determined, and it is determined whether the angle between the normal vector of plane i and the z-axis is greater than the first preset angle. If so, the center of mass of plane i is subtracted from the starting point p1' of the weld to be welded in the robot base coordinate system and the end point p2' of the weld to be welded in the robot base coordinate system to obtain the first difference diff_1 and the second difference diff_2.
[0144] If the first difference is less than 0 and the second difference is less than 0, it can be considered that the plane is located below the starting point of the selected weld to be welded in the robot base coordinate system and the end point of the weld to be welded in the robot base coordinate system. At this time, the vertical distance from the midpoint to the plane is adjusted to a preset value, where the preset value can be 10 10 .
[0145] If the first difference value <0 and the second difference value <0 are not satisfied, the vertical distance from the midpoint in the first array to the plane is not updated.
[0146] If the angle between the normal vector of the plane and the z-axis is less than or equal to the first preset angle, the vertical distance from the midpoint in the first array to the plane is not updated.
[0147] It should be noted that the first preset angle can be set to 75°, 80°, 85°, etc., and the embodiment of the present invention does not impose any specific limitation on this.
[0148] When the plane is located below the weld to be welded, the vertical distance between the plane and the midpoint is adjusted to a preset value, and the first array is updated.
[0149] When the first distance is greater than or equal to the preset distance, the vertical distance between the plane and the midpoint is adjusted to a preset value, and the first array is updated.
[0150] The method of obtaining each second plane group based on each disturbance point from all planes is similar to the method of obtaining the first plane group from all planes based on the midpoint. For each disturbance point, traverse each plane, determine the fourth projection point of each disturbance point on each plane, form a point set based on all points in the plane, determine the second target point closest to the fourth projection point from the point set and determine the second distance between the fourth projection point and the second target point, determine the vertical distance between the disturbance point and the plane, record the plane number and vertical distance in the second array, and obtain a second array containing multiple numbers and multiple vertical distances. It should be noted that different disturbance points correspond to different arrays when obtaining the second plane group, that is, the second disturbance point corresponds to the third array, the third disturbance point corresponds to the fourth array, and so on.
[0151] Based on the second distance, the positional relationship between the plane and the weld to be welded is determined, the second array is updated based on the positional relationship, and a second plane group corresponding to the disturbance point is determined from the updated second array.
[0152] The second distance is compared with the preset distance. When the second distance is less than the preset distance, the normal vector of the plane is determined, and the angle between the normal vector and the z-axis is determined. When the angle is greater than the first preset angle, the center of mass of the plane is determined, and the first difference between the center of mass and the starting point and the second difference between the center of mass and the end point are calculated. When the first difference and the second difference are both less than zero, it is determined that the plane is located below the weld to be welded.
[0153] There are many implementations for determining the first plane group corresponding to the midpoint from the updated first array. In one implementation, Figure 6 As shown, the following steps are included:
[0154] S401: sorting the vertical distances in the updated first array in ascending order.
[0155] S402: Determine a plane corresponding to the minimum vertical distance as a first plane.
[0156] S403: Determine a first normal vector of the first plane.
[0157] S404: traverse each plane except the first plane, and determine, from each plane except the first plane, a first plane whose second angle with the first normal vector is greater than or equal to a second preset angle as the second plane.
[0158] The second preset angle is smaller than the first preset angle.
[0159] S405: A first plane group having the first plane and the second plane as midpoints.
[0160] After traversing all planes, the first array is sorted from small to large according to the vertical distance, and the labels of the planes corresponding to each vertical distance will also be adjusted accordingly.
[0161] Suppose the first plane selected is labeled dis_planes[0].index_, which is the label corresponding to the plane with the minimum distance. Take out the normal n0 corresponding to the plane, traverse the other planes in the first array except the first plane, and find the first plane whose angle with n0 is greater than or equal to the second preset angle. The second plane selected is the label corresponding to the plane. The first plane group with the first plane and the second plane as the midpoint.
[0162] If there is no plane whose angle with n0 is greater than or equal to the second preset angle, the second plane selected is labeled 0 and the returned distance is set to the preset value, indicating that the point has failed to select a valid plane.
[0163] It should be noted that the second preset angle can be set to 45°.
[0164] There are many ways to implement the recognition of the weld to be welded based on the target plane group. In one implementation, Figure 7 As shown, the following steps are included:
[0165] S209-1: Calculate the intersection line between the first target plane and the second target plane.
[0166] The target plane group includes a first target plane and a second target plane.
[0167] S209-2: Project the starting point and the end point onto the intersection line to obtain a first projection point and a second projection point.
[0168] S209-3: The straight line segment between the first projection point and the second projection point is used as the weld to be welded of the workpiece to be welded.
[0169] Please refer to Figure 8 The embodiment of the present invention also provides a method for applying Figure 1 The weld seam identification device 110 of the electronic device 100 includes:
[0170] The determination module 111 is used to determine the workpiece point cloud of the workpiece to be welded; determine the starting point and the end point of the weld to be welded of the workpiece point cloud in the robot base coordinate system;
[0171] A detection module 112, used to detect all planes in the workpiece point cloud;
[0172] A calculation module 113, used for calculating the midpoint of the starting point and the end point;
[0173] A coordinate system building module 114, configured to build a target coordinate system based on the starting point and the end point;
[0174] The determination module 111 is further used to: obtain multiple disturbance points based on the midpoint, multiple preset disturbance radii, multiple disturbance angles and a target coordinate system; obtain a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point from all planes; obtain a target plane group from the first plane group and each second plane group;
[0175] The identification module 115 is used to identify the weld to be welded based on the target plane group.
[0176] The present invention further provides an electronic device 100, which includes a processor 130 and a memory 120. The memory 120 stores computer executable instructions, and when the computer executable instructions are executed by the processor 130, the weld identification method is implemented.
[0177] The embodiment of the present invention further provides a computer-readable storage medium, wherein the storage medium stores a computer program, and when the computer program is executed by the processor 130, the weld identification method is implemented.
[0178] In the embodiments provided by the present invention, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely schematic. For example, the flowcharts and block diagrams in the accompanying drawings show the possible architecture, functions and operations of the devices, methods and computer program products according to multiple embodiments of the present invention. In this regard, each box in the flowchart or block diagram can represent a module, a program segment or a part of a code, and the module, program segment or a part of the code contains one or more executable instructions for implementing the specified logical functions. It should also be noted that in some alternative implementations, the functions marked in the box can also occur in a different order from the order marked in the accompanying drawings. For example, two consecutive boxes can actually be executed substantially in parallel, and they can sometimes be executed in the opposite order, depending on the functions involved. It should also be noted that each box in the block diagram and / or flowchart, and the combination of boxes in the block diagram and / or flowchart can be implemented with a dedicated hardware-based system that performs a specified function or action, or can be implemented with a combination of dedicated hardware and computer instructions.
[0179] In addition, each functional module in each embodiment of the present invention can be integrated together to form an independent part, or each module can exist separately, or two or more modules can be integrated to form an independent part. If the function is implemented in the form of a software functional module and sold or used as an independent product, it can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention is essentially or the part that contributes to the prior art or the part of the technical solution can be embodied in the form of a software product, and the computer software product is stored in a storage medium, including several instructions for a computer device (which can be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the method described in each embodiment of the present invention. The aforementioned storage medium includes: U disk, mobile hard disk, read-only memory (ROM, Read-Only Memory), random access memory (RAM, Random Access Memory), disk or optical disk and other media that can store program code.
[0180] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.
[0181] The above are only various embodiments of the present invention, but the protection scope of the present invention is not limited thereto. Any person skilled in the art can easily think of changes or substitutions within the technical scope disclosed by the present invention, which should be included in the protection scope of the present invention. Therefore, the protection scope of the present invention should be based on the protection scope of the claims.
Claims
1. A weld identification method, It is characterized in that The method comprises: Determine a workpiece point cloud of a workpiece to be welded; Determine the starting point and the end point of the weld to be welded of the workpiece point cloud in the robot base coordinate system; Detect all planes in the workpiece point cloud; Calculate the midpoint of the starting point and the end point; Establishing a target coordinate system based on the starting point and the end point; Based on the midpoint, a plurality of preset disturbance radii, a plurality of disturbance angles, and a target coordinate system, a plurality of disturbance points are obtained; Acquire respectively from all planes a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point; Acquire a target plane group from the first plane group and each of the second plane groups; The weld to be welded is identified based on the target plane group.
2. The method according to claim 1, It is characterized in that The step of obtaining a plurality of disturbance points based on the midpoint and a plurality of preset disturbance radii and disturbance angles comprises: For each disturbance radius and each disturbance angle, calculating a first product of a cosine value of the disturbance angle and a unit vector of an x-axis of the target coordinate system; Calculate the second product of the sine value of the disturbance angle and the unit vector of the y-axis of the target coordinate system; calculating a first sum of the first product and the second product; calculating a third product of the disturbance radius and the first sum; A second sum of the midpoint and the third product is calculated as a disturbance point.
3. The method according to claim 1, It is characterized in that The step of respectively acquiring a first plane group corresponding to the midpoint from all planes comprises: Traversing each of the planes, and determining the third projection point of the midpoint on the plane; Constructing a point set based on all points in the plane; Determine a first target point closest to the third projection point from the point set and determine a first distance between the third projection point and the first target point; determining a perpendicular distance between the midpoint and the plane; Recording the labels of the planes and the vertical distances in a first array, to obtain a first array including a plurality of labels and a plurality of vertical distances; Based on the first distance, determining a positional relationship between the plane and the weld to be welded; updating the first array based on the position relationship; A first plane group corresponding to the midpoint is determined from the updated first array.
4. The method according to claim 3, It is characterized in that The step of determining the positional relationship between the plane and the weld to be welded based on the first distance comprises: comparing the first distance with a preset distance; When the first distance is less than the preset distance, determining a normal vector of the plane; Determine the angle between the normal vector and the z-axis; When the included angle is greater than a first preset angle, determining the centroid of the plane; Calculating a first difference between the centroid and the starting point and a second difference between the centroid and the end point; When the first difference and the second difference are both smaller than zero, it is determined that the plane is located below the weld to be welded.
5. The method according to claim 3, It is characterized in that The step of updating the first array based on the position relationship includes: When the plane is located below the weld to be welded, the vertical distance between the plane and the midpoint is adjusted to a preset value, and the first array is updated.
6. The method according to claim 4, It is characterized in that The method further comprises: When the first distance is greater than or equal to the preset distance, the vertical distance between the plane and the midpoint is adjusted to a preset value, and the first array is updated.
7. The method according to claim 4, It is characterized in that The step of determining a first plane group corresponding to the midpoint from the updated first array comprises: Sort the updated vertical distances in the first array in ascending order; Determine the plane corresponding to the minimum vertical distance as the first plane; determining a first normal vector of the first plane; Traversing each plane except the first plane, and determining, from each plane except the first plane, a first plane whose second angle with the first normal vector is greater than or equal to a second preset angle as the second plane, wherein the second preset angle is less than the first preset angle; The first plane and the second plane are used as a first plane group of the midpoint.
8. The method according to claim 1, It is characterized in that The step of identifying the weld to be welded based on the target plane group comprises: Calculating an intersection line of a first target plane and a second target plane, wherein the target plane group includes the first target plane and the second target plane; Projecting the starting point and the end point onto the intersection line to obtain a first projection point and a second projection point; The straight line segment between the first projection point and the second projection point is used as the weld to be welded of the workpiece to be welded.
9. A weld identification device, It is characterized in that The device comprises: A determination module is used to determine a workpiece point cloud of a workpiece to be welded; and to determine a starting point and an end point of a weld to be welded of the workpiece point cloud in a robot base coordinate system; A detection module, used for detecting all planes in the workpiece point cloud; A calculation module, used for calculating the midpoint of the starting point and the end point; A coordinate system building module, used for building a target coordinate system based on the starting point and the end point; The determination module is further used to: obtain multiple disturbance points based on the midpoint, multiple preset disturbance radii, multiple disturbance angles and a target coordinate system; obtain a first plane group corresponding to the midpoint and each second plane group corresponding to each disturbance point from all planes; and obtain a target plane group from the first plane group and each second plane group; The recognition module is used to recognize the weld to be welded based on the target plane group.
10. An electronic device, It is characterized in that The method comprises a memory and a processor, wherein the memory stores a computer program, and wherein the processor implements the steps of the method according to any one of claims 1 to 8 when executing the computer program.
Citation Information
Patent Citations
Welding joint quality detection method, device and system and electronic equipment
CN111462110A
Weld joint identification method and device, welding robot and storage medium
CN115409809A
Robot weld joint identification method and system based on area array structured light
CN116604212A
Circular weld joint welding treatment method, device, equipment and medium
CN118037729A
Cited By
Linear welding seam identification method and device
CN119131037A
