Workpiece processing path acquisition method, robot, and storage medium
By collecting and screening the workpiece data and automatically obtaining the workpiece processing path, the problem of cumbersome acquisition process and low accuracy in the existing technology is solved, and efficient and convenient workpiece processing is achieved.
Patent Information
- Application Number
- CN202411948462.6
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-27
- Publication Date
- 2025-03-21
- Estimated Expiration
- 2044-12-27
AI Technical Summary
The existing method of obtaining workpiece processing paths depends on manual experience, resulting in cumbersome acquisition process, poor accuracy, low efficiency, and inefficiency, and the inability to complete workpiece processing efficiently.
By collecting data on the workpiece, obtaining the target workpiece point cloud, filtering data points with curvature greater than the threshold as the initial path point, and calculating the target characteristics of the initial path point. If the setting conditions are met, it is used as the target path point. Aggregating to form the path point cloud for skeleton line extraction and linear fitting to obtain the processing path of the workpiece.
It realizes automatic acquisition of workpiece processing paths, saves human resources, improves the efficiency of processing path acquisition, and makes workpiece processing more efficient and convenient.
Smart Images

Figure CN119379684B_ABST
Abstract
Description
Technical Field
[0001] The technical field of the present application is the field of workpiece processing, and specifically relates to a method for obtaining a workpiece processing path, a robot, and a storage medium. Background Art
[0002] In the field of workpiece processing, for the processing of workpieces or workpiece joints, and for the segmentation of workpieces, it is necessary to determine the processing position of the workpiece in advance, and then generate the corresponding processing path, and finally perform processing according to the processing path in a preset processing method.
[0003] At present, the acquisition method of the processing path on the workpiece is mostly determined by a combination of manual and machine. The data acquisition device of the manually driven machine measures the processing position of the workpiece, obtains the coordinate information of the processing position, and generates the processing path. However, this working method is particularly dependent on manual work experience and manual machine operation experience. The acquisition of the processing path is extremely cumbersome and the accuracy is poor, so that when the workpiece is processed, the staff also needs to observe on the side to avoid mistakes. This greatly wastes precious human resources. On the other hand, it greatly reduces the efficiency of obtaining the processing path, which ultimately leads to the inability to efficiently complete the processing of the workpiece.
[0004] Therefore, how to obtain the processing path of the workpiece efficiently and conveniently is a technical problem that needs to be solved urgently. Summary of the invention
[0005] The present application aims to solve the technical problem of how to efficiently and conveniently obtain a processing path for a workpiece.
[0006] According to one aspect of an embodiment of the present application, the present application provides a method for acquiring a workpiece processing path, the method comprising:
[0007] Collect data on the workpiece to obtain the point cloud of the target workpiece;
[0008] Taking data points in the target workpiece point cloud whose curvature is greater than a curvature threshold as initial path points;
[0009] Calculating the target feature of the initial path point according to the normal vector of each initial path point, and if the target feature of the initial path point meets the set conditions, taking the initial path point as the target path point;
[0010] Extracting skeleton lines from at least one path point cloud formed by aggregating target path points;
[0011] Linear fitting is performed on the skeleton line to obtain a processing path of the workpiece.
[0012] According to one aspect of an embodiment of the present application, data collection is performed on a workpiece to obtain a target workpiece point cloud, including:
[0013] Collect data from a single perspective on the workpiece to obtain a workpiece point cloud;
[0014] Clustering and segmenting the workpiece point cloud to obtain a plurality of initial segmented point clouds;
[0015] Determining data collection points of a portion of the workpiece corresponding to the initial segmented point cloud according to the coordinates of each data point in the initial segmented point cloud;
[0016] Controlling a data acquisition device to move to the data acquisition point, performing data acquisition on the workpiece, and obtaining a segmented point cloud corresponding to the initial segmented point cloud;
[0017] The segmented point cloud is combined with the workpiece point cloud to obtain a target workpiece point cloud.
[0018] According to one aspect of an embodiment of the present application, calculating a target feature of the initial path point according to a normal vector of each of the initial path points, and if the target feature of the initial path point satisfies a set condition, taking the initial path point as a target path point includes:
[0019] Determine at least three initial path points that are adjacent to the initial path point and are not in the same straight line as selected points, and the plane where the selected points are located is the selected plane;
[0020] A vector determined according to the projection point and the initial path point is used as a selected vector, wherein the projection point refers to a projection of the initial path point on the selected plane;
[0021] If the angle between the normal vector of the initial path point and the selected vector is less than an angle threshold, the initial path point is used as the target path point.
[0022] According to one aspect of an embodiment of the present application, skeleton line extraction is performed on at least one path point cloud formed by aggregation of target path points, including:
[0023] Randomly select a target path point in the path point cloud as a recruitment point, and draw two straight lines with a set angle through the recruitment point;
[0024] Adjust the directions of the two straight lines so that the difference in the number of adjacent points between the two straight lines is maximized, and take the straight line with the larger number of adjacent points as the first straight line and the other straight line as the second straight line;
[0025] Among the non-recruiting points adjacent to the first straight line of the recruitment point, a non-recruiting point is selected as the next recruitment point, and the distance between the recruitment point and the next recruitment point is within a preset distance interval; wherein, if the next recruitment point cannot be obtained according to the first straight line of the most recently obtained recruitment point, the next recruitment point is obtained from the non-recruiting points adjacent to the second straight line of the most recently obtained recruitment point;
[0026] If the next recruitment point cannot be determined based on the first straight line and the second straight line of the latest recruitment point, all recruitment points are taken as skeleton points to obtain the skeleton line.
[0027] According to one aspect of an embodiment of the present application, linear fitting is performed on the skeleton line to obtain a processing path of the workpiece, including:
[0028] If the skeleton line can form a closed figure, obtaining the centroid of the skeleton line;
[0029] Taking the center of gravity as the origin, calculating the polar angle of each skeleton point in the skeleton line;
[0030] The skeleton points are sorted according to the polar angles, the skeleton point at the front of the sort is the starting point of the processing path, and the skeleton point at the back of the sort is the end point of the processing path;
[0031] According to the sorting result of the skeleton points, the skeleton line is linearly fitted to obtain a processing path, so that the processing device can traverse all the skeleton points in the processing path in sequence according to the sorting result of the skeleton points.
[0032] According to one aspect of an embodiment of the present application, linear fitting is performed on the skeleton line to obtain a processing path of the workpiece, including:
[0033] If the skeleton line cannot form a closed figure, a skeleton point is randomly selected in the skeleton line as a selected point;
[0034] Selecting a skeleton point farthest from the selected point in the skeleton line as the starting point of the processing path;
[0035] Sorting the skeleton points according to the distance between each skeleton point in the skeleton line and the starting point;
[0036] The skeleton line is linearly fitted according to the sorting result to obtain a processing path, so that the processing device can sequentially traverse all the skeleton points in the processing path according to the sorting result of the skeleton points.
[0037] According to one aspect of an embodiment of the present application, determining whether the skeleton line can form a closed figure includes:
[0038] Taking any skeleton point on the skeleton line as a test point;
[0039] The non-test point with the smallest distance from the target test point in the skeleton line is used as the test point, until all the skeleton points on the skeleton line are test points, and the target test point is the most recently determined test point;
[0040] A test distance between a first determined test point and a last determined test point is obtained. If the test distance is less than a distance threshold, the skeleton line can form a closed figure; otherwise, the skeleton line cannot form a closed figure.
[0041] According to one aspect of an embodiment of the present application, the present application provides a robot, comprising a memory, a processor, and a readable program stored in the memory, and when the processor executes the readable program, it implements any of the methods described above.
[0042] According to one aspect of an embodiment of the present application, the present application provides a readable storage medium having a readable program / instruction stored thereon. When the readable program / instruction is executed by a processor, any of the methods described above is implemented.
[0043] According to one aspect of an embodiment of the present application, the present application provides a program product, including a readable program / instruction, and when the readable program / instruction is executed by a processor, the method as described in any one of the above items is implemented.
[0044] This application acquires data of the workpiece to obtain a target workpiece point cloud, and then uses the data points in the target workpiece point cloud whose curvature is greater than the curvature threshold as the initial path point, and then calculates the target feature of the initial path point according to the normal vector of the initial path point. If the target feature of the initial path point meets the set conditions, the initial path point is used as the target path point, and the processing path of the workpiece is determined according to the target path point. Finally, the skeleton line is extracted from at least one path point cloud formed by the aggregation of the target path points, and the skeleton line is linearly fitted to obtain the processing path of the workpiece. This realizes the automatic acquisition of the processing path on the workpiece, saving a lot of human resources. On the other hand, it increases the efficiency of obtaining the processing path, and can complete the processing of the workpiece more efficiently and conveniently.
[0045] Other features and advantages of the present application will become apparent from the following detailed description, or may be learned in part by the practice of the present application.
[0046] It should be understood that the foregoing general description and the following detailed description are exemplary only and are not restrictive of the present application. BRIEF DESCRIPTION OF THE DRAWINGS
[0047] The above and other objects, features and advantages of the present application will become more apparent by describing in detail exemplary embodiments thereof with reference to the attached drawings.
[0048] Figure 1 A schematic diagram of a robot processing a workpiece according to an embodiment of the present application is shown.
[0049] Figure 2 A flow chart of a method for acquiring a workpiece processing path according to an embodiment of the present application is shown.
[0050] Figure 3 A flow chart of collecting data on a workpiece and obtaining a target workpiece point cloud according to an embodiment of the present application is shown.
[0051] Figure 4 A schematic diagram of the normal vector direction according to an embodiment of the present application is shown.
[0052] Figure 5 A flowchart of determining a target path point in an initial path point based on a normal vector of the initial path point according to an embodiment of the present application is shown.
[0053] Figure 6 A flowchart of extracting skeleton lines from at least one path point cloud formed by aggregation of target path points according to an embodiment of the present application is shown.
[0054] Figure 7 A distribution diagram of a first straight line and a second straight line according to an embodiment of the present application is shown.
[0055] Figure 8 A flowchart of performing linear fitting on skeleton lines to obtain a processing path for a workpiece according to an embodiment of the present application is shown.
[0056] Fig. 9 A flowchart of performing linear fitting on skeleton lines to obtain a processing path for a workpiece according to another embodiment of the present application is shown.
[0057] Fig.10 A flow chart for determining whether a skeleton line can form a closed figure according to an embodiment of the present application is shown.
[0058] Fig.11 A hardware structure diagram of a method for acquiring a workpiece path according to an embodiment of the present application is shown. DETAILED DESCRIPTION
[0059] Example embodiments will now be described more fully with reference to the accompanying drawings. However, example embodiments can be implemented in a variety of forms and should not be construed as limited to the examples set forth herein; rather, these example embodiments are provided so that the description of the present application will be more comprehensive and complete and the concepts of the example embodiments will be fully conveyed to those skilled in the art. The accompanying drawings are only schematic illustrations of the present application and are not necessarily drawn to scale. The same reference numerals in the figures represent the same or similar parts, and thus their repeated description will be omitted.
[0060] In addition, the described features, structures or characteristics may be combined in one or more example embodiments in any suitable manner. In the following description, many specific details are provided to provide a full understanding of the example embodiments of the present application. However, those skilled in the art will appreciate that the technical solution of the present application may be practiced while omitting one or more of the specific details, or other methods, components, steps, etc. may be adopted. In other cases, known structures, methods, implementations or operations are not shown or described in detail to avoid obscuring the present application and making the various aspects of the present application obscure.
[0061] Some of the blocks shown in the accompanying drawings are functional entities that do not necessarily correspond to physically or logically independent entities. These functional entities can be implemented in software form, or in one or more hardware modules or integrated circuits, or in different networks and / or processor devices and / or microcontroller devices.
[0062] See also Figure 1 , Figure 1 A schematic diagram of a robot processing a workpiece according to an embodiment of the present application is shown. The schematic diagram includes a robot and a workpiece. The robot is used to obtain a processing path of the workpiece and process the workpiece. The workpiece is used to be processed.
[0063] A control device may be provided in the robot to directly control the robot to execute the method for determining the processing path described in the present application, and to control the robot to process the workpiece.
[0064] In some embodiments, the control device is disposed outside the robot, and the control device is connected to the robot wirelessly or by wire to control the robot to execute the processing path method described in this application, and to control other devices of the robot to process the workpiece.
[0065] In some embodiments, the robot further includes a data acquisition device and a processing device. The data acquisition device is used to collect data from the workpiece. The processing device is used to process the workpiece. Processing includes all actions that change the appearance, structure, and connection relationship of the workpiece, such as welding, cutting, grinding, and polishing.
[0066] See also Figure 2 , Figure 2 A flowchart of a method for obtaining a workpiece processing path according to an embodiment of the present application is shown. The present application embodiment provides a method for obtaining a workpiece processing path, including:
[0067] Step S210, collecting data on the workpiece to obtain a point cloud of the target workpiece;
[0068] Step S220, taking a data point in the target workpiece point cloud whose curvature is greater than a curvature threshold as an initial path point;
[0069] Step S230, calculating the target feature of the initial path point according to the normal vector of each initial path point, and if the target feature of the initial path point meets the set conditions, the initial path point is used as the target path point;
[0070] Step S240, extracting skeleton lines from at least one path point cloud formed by aggregation of target path points;
[0071] Step S250, performing linear fitting on the skeleton line to obtain a processing path of the workpiece.
[0072] The above five steps are described in detail below.
[0073] In step S210, data is collected on the workpiece to obtain a target workpiece point cloud of the workpiece, wherein structured light measurement can be performed on the workpiece to obtain the target workpiece point cloud.
[0074] In some embodiments, a number of measurement points may be determined on the workpiece, and then coordinate information of each measurement point on the workpiece may be obtained. Finally, based on the coordinate information of each measurement point, data points corresponding to the obtained coordinate information may be materialized in the virtual space to obtain a target workpiece point cloud.
[0075] See also Figure 3 , Figure 3 The flowchart of collecting data on a workpiece and obtaining a target workpiece point cloud according to an embodiment of the present application is shown. The present application embodiment provides a step S210 of collecting data on a workpiece and obtaining a target workpiece point cloud, including:
[0076] Step S211, collecting data from a single perspective on the workpiece to obtain a workpiece point cloud;
[0077] Step S212, clustering and segmenting the workpiece point cloud to obtain a plurality of initial segmented point clouds;
[0078] Step S213, determining the data collection points of the part of the workpiece corresponding to the initial segmented point cloud according to the coordinates of each data point in the initial segmented point cloud;
[0079] Step S214, controlling the data acquisition device to move to the data acquisition point, performing data acquisition on the workpiece, and obtaining a segmented point cloud corresponding to the initial segmented point cloud;
[0080] Step S215, combining the segmented point cloud with the workpiece point cloud to obtain the target workpiece point cloud.
[0081] The above five steps are described in detail below.
[0082] It should be noted that the workpiece point cloud obtained in step S211 is used to simply describe the structure of the workpiece. In step S212, the workpiece point cloud is segmented to obtain multiple initial segmented point clouds. In step S213, each initial segmented point cloud corresponds to a part of the workpiece, and multiple data collection points are determined according to the initial segmented point cloud. These data collection points are used to determine the data collection position of the data collection device for the part of the workpiece corresponding to the initial segmented point cloud, so as to collect the workpiece from multiple angles (compared to step S211, step S212 belongs to omnidirectional collection), so as to collect comprehensive data on the part of the workpiece corresponding to the initial segmented point cloud. In step S214, the control device controls the data collection device to move to each data collection point, and performs omnidirectional data collection on the part of the workpiece, thereby obtaining the segmented point clouds corresponding to each initial segmented point cloud. Finally, in step S215, according to the position of the initial segmented point cloud corresponding to the segmented point cloud in the workpiece point cloud, the segmented point cloud is fused with the workpiece point cloud to obtain a more accurate target workpiece point cloud relative to the workpiece point cloud.
[0083] In step S211, it should be firstly clarified that data collection of a workpiece from a single perspective refers to data collection of the workpiece from only one direction or angle of the workpiece, such as collecting data of the workpiece from a top-down perspective. The workpiece point cloud obtained by this data collection method is used to represent the overall structure or approximate structure of the workpiece.
[0084] Exemplarily, the control device controls the data acquisition device to always emit a line laser to the workpiece in one direction, form a light on the workpiece surface, and obtain the coordinate information of the area covered by the light on the workpiece surface. At the same time, the robot is controlled to move along the axial direction of the workpiece so that the light formed by the line laser traverses the surface of one side of the workpiece, and then all the coordinate information of the surface of one side of the workpiece is obtained by using a preset measurement method to form a workpiece point cloud.
[0085] In some embodiments, the control device can also control the data acquisition device to emit a measurement pattern to the workpiece in a set direction. The measurement pattern can cover all areas or part of the area on one side of the workpiece surface. Then, based on the deformation of the measurement pattern, data of the area covered by the measurement pattern on the workpiece surface is obtained to obtain a workpiece point cloud.
[0086] When it is necessary to clarify, the area traversed by the light or the area covered by the measurement pattern may be the entire area or a part of the surface of a certain side of the workpiece, depending on the acquisition parameters preset in the control device. The acquisition parameters may be generated by the control device in response to the user's operation behavior.
[0087] In step S212, clustering and segmenting is performed on the obtained workpiece point cloud, and the workpiece point cloud is segmented to obtain a plurality of initial segmented point clouds.
[0088] In some embodiments, the workpiece point cloud is cut at a set distance along the axial direction of the workpiece point cloud to obtain a plurality of initial segmented point clouds.
[0089] In some embodiments, the workpiece point cloud is segmented along the axial direction of the workpiece point cloud to obtain multiple initial segmented point clouds, and the difference in the number of data points in each initial segmented point cloud is within a set range. That is, the number of data points in each initial segmented point cloud is approximate. This may cause the "length" of each initial segmented point cloud to be different (the length refers to the axial length of the workpiece point cloud occupied in the initial segmented point cloud). There are differences between complex and simple structures between different parts of the workpiece. In the part of the workpiece with a complex structure, its surface area will be larger. When the workpiece is measured from a certain direction, more measurement points may be distributed on the surface of the workpiece of the complex part. Therefore, the workpiece point cloud corresponding to this part of the workpiece has a greater density of data points, and then the workpiece point cloud corresponding to the complex part of the workpiece will be segmented more frequently to obtain multiple initial segmented point clouds. Subsequently, data collection points are determined for each initial segmented point cloud corresponding to the complex part of the workpiece. Since there are more initial segmented point clouds corresponding to the complex part of the workpiece, more data collection points can be distributed around the complex part of the workpiece, so that the complex part of the workpiece can obtain more accurate data collection than the simple part. In the embodiment of the present application, targeted data collection of complex and simple parts of the workpiece is achieved, so that the target workpiece point cloud obtained in the end is more accurate.
[0090] Through the method described in this embodiment, different numbers of data collection points can be assigned to the simple part and the complex part of the workpiece respectively, and targeted data collection can be performed on the simple part and the complex part of the workpiece. While ensuring accurate data collection of the workpiece, more computing resources will not be wasted on the simple part of the workpiece.
[0091] In addition, the embodiment of the present application can also separate the simple part and the complex part corresponding to the workpiece point cloud in the workpiece to obtain initial segmented point clouds of different "lengths". And it is entirely possible to determine the complexity of the initial segmented point cloud according to the length of the initial segmented point cloud, and then determine whether to allocate more data collection points according to the complexity of the initial segmented point cloud, so as to perform more detailed data collection on the part of the workpiece corresponding to the complex initial segmented point cloud, so as to avoid insufficient data collection on the part of the workpiece corresponding to the complex initial segmented point cloud due to fewer data collection points, and fail to find the position on the workpiece that needs to be processed and obtain the processing path.
[0092] In some embodiments, the initial segmented point cloud may be obtained in the following manner.
[0093] In the workpiece point cloud, any data point that is not divided into clusters is used as a seed point. The neighborhood of the seed point is formed with the first set distance as the radius; all data points in the neighborhood of the seed point are classified into the same cluster, and any data point in the cluster is continued to be selected as a seed point, the neighborhood of the seed point is determined, and the data points in the neighborhood of the seed point are added to the cluster to grow the cluster. That is, each data point in the cluster is used as a seed point, and the neighboring points of the seed point are determined with the first set distance as the radius. The neighboring points of the seed point continue to be added to the cluster to which the seed point belongs to continuously grow the cluster. Until the cluster cannot grow, that is, the neighboring points of any data point in the cluster as a seed point have been added to the current cluster. The point cloud formed by all the data points in the cluster is used as an initial segmented point cloud. Continue to use any data point of an undivided cluster in the workpiece point cloud as a seed point to determine the next cluster, until after a cluster is determined, there is no data point of an undivided cluster in the workpiece point cloud, and the cluster segmentation of the workpiece point cloud is completed.
[0094] In step S213, the data collection points of the part of the workpiece corresponding to each initial segment point cloud are determined according to the coordinate information of the data points in each initial segment point cloud. Since the workpiece point cloud is used to describe the overall structure of the workpiece, and the initial segment point cloud is a part of the workpiece point cloud, the initial segment point cloud corresponds to the part of the workpiece point cloud, and each initial segment point cloud corresponds to a part of the workpiece.
[0095] In some embodiments, the determination of the data collection points for the initial segmented point cloud includes two parts, namely, the determination of the number of data collection points and the setting of the positions of the data collection points.
[0096] The collection area of the collection device is the area on the workpiece surface where the collection device can collect data once. It can also be the area on the workpiece surface where a single collection device can collect data. The collection device can be single, and the data collection of the workpiece is completed by moving the collection device. There can also be multiple collection devices, which are distributed at different positions to complete the data collection of the workpiece.
[0097] The number of data acquisition points corresponding to the initial segmented point cloud can be determined in different ways according to different data acquisition devices. Data acquisition devices generally include three types. (1) The acquisition area of the data acquisition device is determined and does not change with the distance between the data acquisition device and the workpiece. That is, the acquisition accuracy of the first type of data acquisition device is fixed. (2) The acquisition area of the data acquisition device can be adjusted freely and is not affected by the distance between the data acquisition device and the workpiece. The acquisition area of the data acquisition device is negatively correlated with the acquisition accuracy. (3) The acquisition area of the data acquisition device can only increase as the distance between the data acquisition device and the workpiece increases. The larger the acquisition area, the lower the data acquisition accuracy. That is, the greater the distance between the data acquisition device and the workpiece, the lower the data acquisition accuracy.
[0098] (1) For the first data acquisition device, the number of data acquisition points of the initial segmented point cloud is determined in the following manner.
[0099] The minimum enclosing space of the initial segmented point cloud is determined with the centroid of the initial segmented point cloud as the center. It should be noted that the shape of the minimum enclosing space includes but is not limited to a quadrangular prism and a sphere.
[0100] According to the collection area of the data collection device and the surface area of the minimum enclosing space, the number of data collection points is determined on the surface of the minimum enclosing space. In some embodiments, the ratio of the surface area of the minimum enclosing space to the collection area is calculated, and the natural number closest to the area ratio and greater than the area ratio is used as the number of data collection points, which can just meet the collection area of the data collection device to traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud. The area of the collection area is the collection area of the data collection device.
[0101] In some embodiments, the sum of the natural number closest to the area ratio and greater than the area ratio and the set value is used as the number of data collection points, so as to avoid the data collection device being unable to traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud due to the complex structure of the workpiece.
[0102] That is, the number of data acquisition points must be sufficient to enable the acquisition area of the data acquisition device to traverse all positions of the workpiece part corresponding to the initial segmented point cloud.
[0103] (2) For the second data acquisition device, the number of data acquisition points of the initial segmented point cloud is determined in the following manner.
[0104] The minimum enclosing space of the initial segmented point cloud is determined with the centroid of the initial segmented point cloud as the center. It should be noted that the shape of the minimum enclosing space includes but is not limited to a quadrangular prism and a sphere.
[0105] The collection area of the data collection device is determined according to the preset data collection accuracy. The data collection accuracy can be set by the control device according to the instruction information triggered by the user's operation behavior. Then, the number of data collection points is determined according to the data collection area and the surface area of the minimum enclosed space.
[0106] According to the collection area of the data collection device and the surface area of the minimum enclosing space, the number of data collection points is determined on the surface of the minimum enclosing space. In some embodiments, the ratio of the surface area of the minimum enclosing space to the collection area is calculated, and the natural number closest to the area ratio and greater than the area ratio is used as the number of data collection points, which can satisfy that the collection area of the data collection device can traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud. The area of the collection area is the collection area of the data collection device.
[0107] In some embodiments, the sum of the natural number closest to the area ratio and greater than the area ratio and the set value is used as the number of data collection points, so as to avoid the data collection device being unable to traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud due to the complex structure of the workpiece.
[0108] (3) For the third data acquisition device, the following method is used to determine the number of data acquisition points of the initial segmented point cloud.
[0109] The minimum enclosing space of the initial segmented point cloud is determined with the centroid of the initial segmented point cloud as the center. It should be noted that the shape of the minimum enclosing space includes but is not limited to a quadrangular prism and a sphere.
[0110] The acquisition area of the data acquisition device is determined according to the preset data acquisition accuracy. The distance between the data acquisition device and the workpiece is determined according to the data acquisition area, because the distance between the data acquisition device and the workpiece is positively correlated with the acquisition area. Therefore, the size of the acquisition area is adjusted by adjusting the distance between the data acquisition device and the workpiece.
[0111] The acquisition space is determined according to the distance between the data acquisition device and the workpiece. The acquisition space is larger than the minimum enclosing space, and there is a scaling relationship between the acquisition space and the minimum enclosing space. That is, the acquisition space is a space proportionally enlarged from the minimum enclosing space.
[0112] The number of data collection points located in the collection space is determined based on the collection area of the data collection device and the surface area of the minimum enclosing space. In some embodiments, the ratio of the surface area of the minimum enclosing space to the collection area is calculated, and the natural number closest to the area ratio and greater than the area ratio is used as the number of data collection points, which can just meet the collection area of the data collection device to traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud. The area of the collection area is the collection area of the data collection device.
[0113] In some embodiments, the sum of the natural number closest to the area ratio and greater than the area ratio and the set value is used as the number of data collection points, so as to avoid the data collection device being unable to traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud due to the complex structure of the workpiece.
[0114] The following method can be used to determine the location of data collection points.
[0115] For the first data acquisition device and the second data acquisition device, the data acquisition points are distributed on the surface of the minimum enclosing space.
[0116] First, through neural network training, the positions of data collection points are automatically generated, so that the collection area of the data collection device can traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud.
[0117] Second, determine the same number of experimental areas as the data collection points. Each data collection point corresponds to an experimental area. The area of each experimental area is the same as the sampling area, and the shape of each experimental area is the same as the sampling area. Arrange the experimental areas closely on the surface of the minimum enclosing space. Make multiple experimental areas spread across various positions in the minimum enclosing space. Take the center position of each experimental area as the position of the corresponding data collection point.
[0118] If there are any remaining experimental areas, the remaining experimental areas are moved to the joint of any multiple experimental areas to increase the accuracy of the segmented point cloud obtained subsequently.
[0119] For the third data acquisition device, the data acquisition points are distributed on the surface of the acquisition space.
[0120] First, the positions of data acquisition points are automatically generated through neural network training, so that the acquisition area of the data acquisition device can traverse all positions of the part of the workpiece corresponding to the initial segmented point cloud.
[0121] Second, determine the same number of experimental areas as the data collection points. Each data collection point corresponds to an experimental area. The area of each experimental area is the same as the sampling area, and the shape of each experimental area is the same as the sampling area. Arrange the experimental areas closely on the surface of the minimum enclosing space. Make multiple experimental areas spread over various positions of the minimum enclosing space. Obtain the position of the data collection point corresponding to each experimental area in the collection space, which is the position of each data collection point.
[0122] In step S214, the control device controls the data acquisition device to move to the data acquisition point, collect data on the workpiece, and obtain segmented point clouds corresponding to each initial segmented point cloud. The multiple data acquisition points around the workpiece enable the data acquisition device to collect data on the workpiece from multiple perspectives to obtain segmented point clouds. That is, in step S211, data collection from a single perspective is sufficient only to obtain a workpiece point cloud representing the structure of the workpiece. In step S214, detailed data collection is required for the part of the workpiece corresponding to the initial path point cloud, so multi-perspective data collection is performed.
[0123] In step S215, each initial segment point cloud corresponds to a position in the workpiece point cloud. According to the position of the initial segment point cloud in the workpiece point cloud, the segment point cloud corresponding to the initial segment point cloud is fused into the workpiece point cloud to obtain the target workpiece point cloud.
[0124] In some embodiments, a plurality of alignment points are provided on the workpiece, and the fusion of a segmented point cloud and a workpiece point cloud can be performed in the following manner: first, the portion of the workpiece corresponding to the segmented point cloud is determined, and then at least two alignment points on the portion of the workpiece corresponding to the segmented point cloud are used as target alignment points, and the first mapping point corresponding to the target alignment point is determined in the segmented point cloud, and the second mapping point corresponding to the target alignment point is determined in the workpiece point cloud. The segmented point cloud is rotated and translated until the first mapping point and the second mapping point coincide, and the fusion of the segmented point cloud and the workpiece point cloud can be completed. Each segmented point cloud is fused with the workpiece point cloud to obtain the target workpiece point cloud.
[0125] In some implementations, since the coordinate information of each data point in both the workpiece point cloud and the segment point cloud comes from the same coordinate system, the workpiece point cloud and the segment point cloud can be directly fused to obtain the target workpiece point cloud.
[0126] In the embodiment of the present application, the target workpiece point cloud is obtained in this way. First, the workpiece is roughly data collected to locate the workpiece and obtain the simple structure of the workpiece. Secondly, the workpiece point cloud is segmented and data collection points are obtained respectively. Among them, it is more targeted to determine the data collection points for the initial segmented point cloud, so that each initial segmented point cloud has a relatively appropriate number of data collection points, and the accuracy of data collection is guaranteed without wasting computing resources. Secondly, the segmented point cloud obtained by multi-directional data collection is obtained through these data collection points. Since the data collection points are obtained respectively according to the initial segmented point cloud, they are more suitable for the part of the workpiece corresponding to the initial segmented point cloud, and then the segmented point cloud of the part of the workpiece corresponding to each initial segmented point cloud can be obtained more accurately. Finally, the segmented point cloud is merged with the workpiece point cloud to obtain the target workpiece point cloud. In the above process, the segmented point cloud focuses on the details of the part of the workpiece, but lacks the coordination of the overall structure. The workpiece point cloud focuses on the overall structure of the workpiece, but lacks the detailed description of the workpiece. By fusing the workpiece point cloud and each segment point cloud, the details of the workpiece can be optimally described, and the description of the workpiece as a whole can be more coordinated.
[0127] In step S220, the curvature of each data point in the target workpiece point cloud is calculated. This is because the position in the workpiece that needs to be processed (that is, the position where the processing path to be determined by the present application is located) generally has significantly different characteristics compared to the position of the workpiece that does not need to be processed. For example, the position in the workpiece that needs to be processed generally exists in the form of a groove, or at the joint of different parts of the workpiece. Whether it is a groove or a joint of different parts of the workpiece, two different planes will be clamped. Exemplarily, the internal angle (also called the internal angle) formed by different sides of the workpiece. The groove can also be regarded as the internal angle formed by different sides of the workpiece to some extent. Therefore, the curvature of the part that needs to be processed on the workpiece must be larger than the plane. This is because the position on the workpiece that does not need to be processed is generally located at a relatively flat position on the surface of the workpiece, so the position on the workpiece that does not need to be processed has a smaller curvature than the position on the workpiece that needs to be processed.
[0128] However, the above method is only used to directly determine the positions on the workpiece that need to be processed, and then determine them as the processing path. It is easily affected by the structure of the workpiece itself and the influence of the outside world. Therefore, only the above method is used to preliminarily screen the data points in the target workpiece point cloud to obtain the initial path points. In order to reduce the amount of data to be processed when determining the processing path later, save computing resources and improve computing efficiency.
[0129] For determining the curvature of a data point in the target workpiece point cloud, in some embodiments, for any data point in the target workpiece point cloud, a neighborhood of the data point is determined with a preset length as the radius. The neighborhood of the data point is fitted with a surface to obtain a fitting plane, and then based on the coordinate information of each data point in the neighborhood, a mathematical method is used to calculate the curvature of the fitting plane as the curvature of the data point.
[0130] The data points in the target workpiece point cloud whose curvature is greater than the curvature threshold are used as initial path points. In some embodiments, the curvature threshold is obtained through multiple experiments in the laboratory. The current curvature threshold can make the initial path points smaller, but ensure that the initial path points almost include all the target path points, and will not affect the formation of each processing path on the workpiece.
[0131] In some embodiments, based on the different types of workpieces or their applications in different industries, each type of workpiece has a corresponding curvature threshold. The workpiece type corresponding to the workpiece is obtained; the curvature threshold corresponding to the workpiece is determined according to the workpiece type; and the data point in the target workpiece point cloud whose curvature is greater than the curvature threshold is used as the initial path point.
[0132] In some embodiments, the curvature and normal vector of each data point in the target workpiece point cloud may be determined in the following manner.
[0133] Taking any data point in the target workpiece point cloud as the center and the second distance as the radius, determine the neighborhood of the data point; according to the coordinate information of the data point in the neighborhood of the data point, use the covariance matrix to calculate the eigenvalue of the neighborhood of the data point as the eigenvalue of the data point; use the eigenvector corresponding to the minimum eigenvalue of the data point as the normal vector of the data point, and use the ratio of the minimum eigenvalue of the data point to the sum of all eigenvalues as the curvature of the data point. In the embodiment of the present application, the curvature and normal vector of each data point in the target workpiece point cloud can be quickly and accurately determined by the above method.
[0134] In step S230, after the initial path points are initially acquired, there are too many noise data points, such as data points located on the "edge" of the target workpiece point cloud, which is also the angle formed by two adjacent sides of the workpiece, but it is an external angle (also called a positive angle). The curvature of the data points located on the "edge" of the target workpiece point cloud will also be relatively large, so in step S220, such positions that are obviously not required to be processed on the workpiece will be mistakenly used as initial path points.
[0135] The reason for this is that curvature has no direction, so whether it is bending toward the workpiece (such as the "edge" in the target workpiece point cloud) or bending away from the center of the workpiece (such as the groove in the workpiece), the curvature will be large and considered as the initial path point. In view of this situation, the normal vector with direction can be used as a reference to distinguish the above situations. For example, the normal vectors of all initial path points are obtained, and the target features of each initial path point are calculated based on the normal vectors of each initial path point.
[0136] Regarding the acquisition of the normal vector, first determine the surface formed by the neighborhood of the initial path point. The straight line vector passing through this initial path point and perpendicular to the surface is the normal vector of this path point. The normal vector has two directions, the first direction is the same as the curvature direction of the fitted surface. The second direction is opposite to the first direction. See Figure 4 As shown, Figure 4 A schematic diagram of the normal vector direction according to an embodiment of the present application is shown.
[0137] Please continue reading Figure 4 , we can see that for the initial path points located at the outer angle, the first direction of their normal vectors is toward the workpiece. For the initial path points located at the inner angle, the first direction of their normal vectors is toward the outside of the workpiece. That is, the initial path points whose first direction of the normal vectors is toward the workpiece can be used as target path points.
[0138] In some embodiments, the target feature of the initial path point can represent the direction of the normal vector of the initial path point in a numerical value or other form, such as different directions of the first direction of the normal vector of the initial path point corresponding to different target features. The first direction of the normal vector of the initial path point toward the workpiece is one type of target feature, and the first direction of the normal vector of the initial path point toward the outside of the workpiece is another type of target feature.
[0139] According to different target features, the initial path points can be screened by setting the setting conditions. The setting conditions are used to screen out the initial path points whose first direction of the normal vector is facing outside the workpiece, and these initial path points are used as target path points. The target path points are obtained by screening the initial path points.
[0140] In some embodiments, the first direction of the normal vector of the initial path point can be directly used as the target feature of the initial path point, so as to select the target path point from the initial path points by setting conditions.
[0141] See also Figure 5 , Figure 5 A flowchart of determining a target path point in an initial path point according to a normal vector of the initial path point according to an embodiment of the present application is shown. The embodiment of the present application provides a step S230 of determining a target path point in an initial path point according to a normal vector of the initial path point, including:
[0142] Step S231, determining at least three initial path points adjacent to the initial path point and not in the same straight line as selected points, and the plane where the selected points are located is the selected plane;
[0143] Step S232, taking a vector determined according to the projection point and the initial path point as a selected vector, where the projection point refers to a projection of the initial path point on the selected plane;
[0144] Step S233, if the angle between the normal vector of the initial path point and the selected vector is less than the angle threshold, the initial path point is used as the target path point.
[0145] The above three steps are described in detail below.
[0146] Since it is necessary to determine whether each initial path point is a target path point, taking any initial path point as an example, it is determined whether the initial path point is a target path point in the following manner.
[0147] In step S231, at least three initial path points that are adjacent to the initial path point and not in the same straight line are determined as selected points, and the plane where the selected points are located is the selected plane.
[0148] In step S232, the projection of the initial path point on the selected plane is taken as the projection point. Based on the projection point and the initial path point, a vector passing through the initial path point and the projection point in sequence can be calculated as the selected vector.
[0149] In some embodiments, the direction of the selected vector is the direction from the initial path point to the projection point.
[0150] In step S233, if the angle between the normal vector of the initial path point and the selected vector is less than the angle threshold, the initial path point is used as the target path point. That is, the angle between the normal vector of the initial path point and the selected vector is used as the target feature, and the angle between the normal vector of the initial path point and the selected vector is less than the angle threshold as a setting condition, and the target path point is determined from a plurality of initial path points.
[0151] The initial path point whose normal vector and the selected vector have an angle less than the angle threshold. In the specific experiment, the first direction of the normal vector of such initial path point is toward the outside of the workpiece. Therefore, if the angle between the normal vector of the initial path point and the selected vector is less than the angle threshold, the initial path point is used as the target path point. Through the pre-set calculation method, the target feature of the initial path point can be directly calculated according to the normal vector of the initial path point, so that the target feature is digitized. This can more conveniently calculate the target feature of the initial path point, and at the same time, it can more efficiently determine the target path point in the initial path point.
[0152] In step S240, there may be multiple processing paths on the workpiece, and the target path points belonging to the same processing path must be clustered together, because the distance between the target path points belonging to the same processing path is small. Then, the target path points can be clustered according to the distance between the target path points to obtain at least one path point cloud representing the processing path.
[0153] In some embodiments, since the target path points may represent many processing paths, the target path points are clustered according to the distances between the target path points to obtain at least one target path point set, and each target path point set corresponds to a path point cloud representing the processing path.
[0154] On the one hand, since there are many target path points in the path point cloud, the control device needs to know in what order to traverse the target path points when controlling the robot to perform processing in order to complete the processing of the workpiece. On the other hand, even if the traversal order of the target path points is known, if a large number of target path points are traversed one by one, the computing resources required by the control device will be greatly increased, thereby reducing the processing efficiency. Since the processing path generally exists in the form of lines, the path point cloud can be simplified into the form of "lines". For example, the skeleton line of the path point cloud is extracted to obtain the skeleton line of the path point cloud to replace the path point cloud.
[0155] See also Figure 6 , Figure 6 A flowchart of extracting skeleton lines from at least one path point cloud formed by aggregating target path points according to an embodiment of the present application is shown. The present application embodiment provides a step S240 of extracting skeleton lines from at least one path point cloud formed by aggregating target path points according to an embodiment of the present application, including:
[0156] Step S241, randomly select a target path point in the path point cloud as a selection point, and draw two straight lines with a set angle through the selection point;
[0157] Step S242, adjusting the directions of the two straight lines so that the difference in the number of adjacent points between the two straight lines is maximized, and taking the straight line with the larger number of adjacent points as the first straight line and the other straight line as the second straight line;
[0158] Step S243, among the non-recruiting points adjacent to the first straight line of the recruitment point, select a non-recruiting point as the next recruitment point, and the distance between the recruitment point and the next recruitment point is within a preset distance interval; wherein, if the next recruitment point cannot be obtained according to the first straight line of the latest recruitment point, the next recruitment point is obtained from the non-recruiting points adjacent to the second straight line of the latest recruitment point;
[0159] Step S244: If the next recruitment point cannot be determined based on the first straight line and the second straight line of the latest recruitment point, all recruitment points are used as skeleton points to obtain a skeleton line.
[0160] The above four steps are described in detail below.
[0161] Step S241, randomly select a target path point in the path point cloud as a selection point, and draw two straight lines with a set angle through the selection point, and the selection point is the intersection of the two straight lines. In some embodiments, a right angle or 45 degrees is used as the set angle of the two straight lines. This is because the angles of the connections between the various parts of the workpiece are mostly right angles or 45 degrees.
[0162] Specifically, the path point cloud is fitted with a surface to obtain a path plane. Two straight lines with a set angle are drawn through the selected points, and the planes where the two straight lines are located are parallel or belong to the path plane.
[0163] In step S242, the two straight lines are rotated at the same time to change their directions. The two straight lines are rotated 360 degrees around the intersection of the two straight lines in the plane where the two straight lines are located. In this process, the difference in the number of adjacent points of the two straight lines is recorded.
[0164] It should be noted that the neighboring points of two straight lines can be obtained in the following way: for any straight line, the number of target path points in the path point cloud whose distance to it is less than a preset length is calculated, which is the number of neighboring points of this straight line. The number of neighboring points of the two straight lines is obtained respectively and the difference is calculated to obtain the difference of the number of neighboring points of the two straight lines.
[0165] According to the difference in the number of adjacent points of the two straight lines at different angles, the two straight lines are rotated to an angle where the difference in the number of adjacent points is the largest. At this time, the straight line with more adjacent points is used as the first straight line, and the other straight line is used as the second straight line.
[0166] At this time, the line where the first straight line is located is the axial direction of the partial path point cloud. Figure 7 , Figure 7A schematic diagram of the distribution of the first straight line and the second straight line according to an embodiment of the present application is shown. Since the path point cloud is mostly in the shape of strips, it can also be called a rectangle. When the difference in the number of adjacent points of two straight lines is the largest, it means that there is a straight line that coincides with most of the path point cloud, and the extension direction of this straight line is the same as the extension direction of the path point cloud, that is, the first straight line. The biggest feature of the skeleton line is that it is used to indicate the extension direction of the path point cloud, so the adjacent points of the first straight line can all be used as admission points. However, in order to prevent the path point cloud from bending or having corners, the adjacent admission points are determined only based on the first straight line of the current admission point, and then the next admission point of the latest admission point is obtained based on the first straight line of the latest admission point. This ensures that the final skeleton line guarantees the extension direction of the path point cloud to the greatest extent.
[0167] In step S243, among the neighboring points of the first straight line of the current recruitment point, a target path point whose distance from the current recruitment point is within the set range and is not a non-recruitment point is determined as the next recruitment point. Each recruitment point has two corresponding straight lines, and the technical means described in steps S241 and S242 are used for each recruitment point to determine the first straight line and the second straight line of this recruitment point.
[0168] It should be made clear that the first straight line has two directions, and each recruiting point can theoretically determine a recruiting point on both sides of it. However, this situation is only applicable when the first recruiting point determines the next adjacent recruiting point. This is because there are no adjacent recruiting points on both sides of the first recruiting point, and the subsequently determined recruiting points have no adjacent recruiting points determined only in one of the directions of the first straight line. Therefore, in order to avoid determining two recruiting points again on both sides of the subsequently determined recruiting points, resulting in repeated determination of recruiting points. Setting: For any of the two directions of the first straight line, if there is already a recruiting point in the target path point within the preset distance interval from the current recruiting point, it is not necessary to determine the recruiting point in this direction. If there is no recruiting point within the preset distance interval from the current recruiting point, then among the neighboring points of the first straight line of the current recruiting point, determine any target path point that is not a recruiting point as the next recruiting point adjacent to the current recruiting point.
[0169] Please continue reading Figure 7 , Figure 7Another distribution of the first straight line and the second straight line is also shown. When the current recruitment point is at the corner of the path point cloud, there is already a recruitment point in the preset distance interval from the current recruitment point in the direction to the left of the first straight line of the current recruitment point, so the first recruitment point can no longer be determined in the direction to the left of the first straight line of the current recruitment point. In the right direction of the first straight line of the current recruitment point, there is no neighboring point of the first straight line in the preset distance interval from the current recruitment point, so at this time, the first recruitment point can no longer be determined based on the first straight line of the current recruitment point. However, there are still parts in the path point cloud where the skeleton line has not been extracted. At this time, find whether there is a target path point that is within the preset distance interval from the current recruitment point and is a non-skeleton point among the neighboring points of the second straight line of the current recruitment point. If so, any one of the target path points that is a non-skeleton point will be used as the next recruitment point of the current recruitment point. For the newly acquired recruitment point, the next recruitment point is still determined preferentially through the neighboring points of the first straight line.
[0170] It should be made clear that the current admission point refers to the most recently obtained admission point.
[0171] In step S244, the technical means described in step S243 are still used for the newly acquired admission point to determine the next admission point. Until the newly acquired admission point cannot determine the next admission point among the adjacent points of the first straight line and the second straight line, all admission points are used as skeleton points, and each skeleton point forms the skeleton line of the path point cloud, that is, the skeleton line extraction of the path point cloud is completed.
[0172] Through the method in the embodiment of the present application, the skeleton line of the path point cloud can be extracted, and the shape of the path point cloud can be maintained to the greatest extent without being affected by the bending of the path point cloud.
[0173] In step S250, the skeleton line is fitted, and the traversal order of the target path points in the skeleton line is determined, or the starting point and the end point of the processing path are determined, and then the processing direction of the processing path is determined. It is convenient for the control device to directly control the processing device of the robot to process the workpiece according to the processing path.
[0174] See also Figure 8 , Figure 8 A flowchart of performing linear fitting on a skeleton line to obtain a processing path of a workpiece according to an embodiment of the present application is shown. The present application embodiment provides a step S250 of performing linear fitting on a skeleton line to obtain a processing path of the workpiece, including:
[0175] Step S251a, if the skeleton line can form a closed figure, obtaining the centroid of the skeleton line;
[0176] Step S252a, taking the center of gravity as the origin, calculating the polar angle of each skeleton point in the skeleton line;
[0177] Step S253a, sorting the skeleton points according to the polar angles, the skeleton point at the front of the sort is the starting point of the processing path, and the skeleton point at the back of the sort is the end point of the processing path;
[0178] Step S254a, performing linear fitting on the skeleton line according to the sorting result of the skeleton points to obtain a processing path, so that the processing device sequentially traverses all the skeleton points in the processing path according to the sorting result of the skeleton points.
[0179] The above four steps are described in detail below.
[0180] Each path point cloud has a skeleton line. Let’s take a skeleton line as an example to determine the processing path.
[0181] In step S251a, if the skeleton line can form a closed figure, the centroid of the skeleton line is obtained. The skeleton line can be closed, which means that the skeleton line can form a closed figure, that is, the processing path corresponding to the skeleton line is a ring. The centroid of the skeleton line is calculated based on the coordinate information of each skeleton point in the skeleton line.
[0182] In step S252a, the polar angle of each skeleton point in the skeleton line is calculated with the center of gravity as the origin, and each skeleton point has a corresponding polar angle.
[0183] In step S253a, the skeleton points are sorted according to the polar angles, the skeleton point at the front of the sort is the starting point of the processing path, and the skeleton point at the back of the sort is the end point of the processing path.
[0184] In step S254a, the skeleton line is linearly fitted according to the sorting result of the skeleton points to obtain a processing path, so that the processing device traverses all the skeleton points in the processing path in sequence according to the sorting result of the skeleton points. In some embodiments, the skeleton line is linearly fitted using the least squares method.
[0185] In some embodiments, according to the sorting result of the skeleton points, the curve or straight line formed by sequentially connecting the skeleton points is the processing path. In some embodiments, the curve or straight line formed by sequentially connecting the skeleton points is optimized, and the angle formed at the skeleton points is removed to obtain a relatively soft curve as the processing path. This facilitates the processing device to process the workpiece more smoothly according to the processing path.
[0186] See also Fig. 9 , Fig. 9 A flowchart of performing linear fitting on a skeleton line to obtain a processing path of a workpiece according to another embodiment of the present application is shown. The present application embodiment provides a step S250 of performing linear fitting on a skeleton line to obtain a processing path of the workpiece, including:
[0187] Step S251b, if the skeleton line cannot form a closed figure, randomly select a skeleton point in the skeleton line as a selection point;
[0188] Step S252b, selecting a skeleton point farthest from the selected point in the skeleton line as the starting point of the processing path;
[0189] Step S253b, sorting the skeleton points according to the distance between each skeleton point in the skeleton line and the starting point;
[0190] Step S254b, performing linear fitting on the skeleton line according to the sorting result to obtain a processing path, so that the processing device can sequentially traverse all the skeleton points in the processing path according to the sorting result of the skeleton points.
[0191] The above four steps are described in detail below.
[0192] In step S251b, if the skeleton line cannot form a closed figure, a skeleton point is randomly selected in the skeleton line as a selected point.
[0193] In step S252b, a skeleton point farthest from the selected point is selected in the skeleton line as the starting point of the processing path.
[0194] In step S253b, the skeleton points are sorted according to the distance between each skeleton point in the skeleton line and the starting point, and the last skeleton point in the sorting is the end point of the processing path.
[0195] In step S254b, the skeleton line is linearly fitted according to the sorting result of the skeleton points to obtain a processing path, so that the processing device traverses all the skeleton points in the processing path in sequence according to the sorting result of the skeleton points. In some embodiments, the skeleton line is linearly fitted using the least squares method.
[0196] In some embodiments, according to the sorting result of the skeleton points, the curve or straight line formed by sequentially connecting the skeleton points is the processing path. In some embodiments, the curve or straight line formed by sequentially connecting the skeleton points is optimized, and the angle formed at the skeleton points is removed to obtain a relatively soft curve as the processing path. This facilitates the processing device to process the workpiece more smoothly according to the processing path.
[0197] In some embodiments, after determining the processing path, since the processing path includes a straight processing path and a curved processing path, and the curved processing path requires continuous change of the moving direction of the processing device, the processing path is divided into a straight processing path and a curved processing path, and different processing modes are used for the straight processing path and the curved processing path.
[0198] In some embodiments, the curvature of each point on the processing path is calculated; if the curvature difference between adjacent points is greater than a first curvature threshold, any point among the adjacent points is used as a breakpoint to divide the processing path to obtain multiple sub-processing paths; the average curvature of each point on the sub-processing path is obtained, and if the average curvature is greater than a second curvature threshold, the sub-processing path is used as a curve processing path, otherwise, as a straight line processing path; the processing posture of the processing device is calculated for the curve processing path. The straight line processing path is directly processed in the corresponding straight line processing mode.
[0199] Since the processing path may be at the connection between the parts of the workpiece, at the angle between the two sides of the workpiece, or in the form of a groove, especially the curved processing path, a control device is also required to control the moving direction of the processing device. In order to better process the curved processing path, the processing posture of the processing device is required. Especially when processing the curved processing path. The specific method of obtaining the processing posture of the processing device is as follows: according to the processing direction of the curved processing path and the curvature of each processing point on the curved processing path, the tangential component and the normal component of each processing point on the curved processing path are calculated; the tangential component and the normal component are used as the first axis and the second axis of the processing point respectively, and the cross product result of the tangential component and the normal component is used as the third axis of the processing point; the contact end of the processing device is set at an angle to the first axis, the second axis, and the third axis respectively as the processing posture of the processing device.
[0200] It should be clarified that, in some embodiments, the above processing posture can also be used as the processing posture for a straight line processing path.
[0201] See also Fig.10 , Fig.10 A flowchart of determining whether a skeleton line can form a closed figure according to an embodiment of the present application is shown. The embodiment of the present application provides steps for determining whether a skeleton line can form a closed figure, including:
[0202] Step S301, taking any skeleton point on the skeleton line as a test point;
[0203] Step S302, taking the non-test point with the smallest distance from the target test point in the skeleton line as the test point, until all the skeleton points on the skeleton line are test points, and the target test point is the most recently determined test point;
[0204] Step S303, obtaining a test distance between the first determined test point and the last determined test point, if the test distance is less than a distance threshold, the skeleton line can form a closed figure, otherwise, the skeleton line cannot form a closed figure.
[0205] The above three steps are described in detail below.
[0206] In step S301, any skeleton point on the skeleton line is used as a test point.
[0207] In step S302, the latest determined skeleton point is used as the target test point, and the non-test point with the smallest distance from the target test point in the skeleton line is used as the next test point, where the non-test point refers to a skeleton point that is not used as a test point, until all skeleton points on the skeleton line are test points, and the target test point is the latest determined test point.
[0208] If there are several non-test points in the skeleton line with the smallest distance to the target test point, any one of them is selected as the next test point.
[0209] In step S303, the test distance between the first determined test point and the last determined test point is obtained. If the skeleton line can form a closed figure, the last determined test point must be close to the first determined test point. Therefore, if the test distance is less than the distance threshold, the skeleton line can form a closed figure, otherwise, the skeleton line cannot form a closed figure.
[0210] In the embodiment of the present application, it is possible to quickly determine whether the skeleton line can form a closed figure.
[0211] The method for obtaining the workpiece processing path of the embodiment of the present application can be as follows: Fig.11 The hardware device shown is implemented. Fig.11 To describe the hardware device according to the embodiment of the present application. Fig.11 The hardware device shown is only an example and should not bring any limitation to the functions and scope of application of the embodiments of the present application.
[0212] like Fig.11 As shown, the hardware device may be in the form of a general-purpose computing device. The components of the hardware device may include, but are not limited to: at least one processing unit 810, at least one storage unit 820, and a bus 830 connecting different system components (including the storage unit 820 and the processing unit 810).
[0213] The storage unit stores program codes, which can be executed by the processing unit 810, so that the processing unit 810 performs the steps according to various exemplary embodiments of the present invention described in the description of the exemplary method described above in this specification. For example, the processing unit 810 can perform the following steps: Figure 2 The steps shown in .
[0214] The storage unit 820 may include a readable medium in the form of a volatile storage unit, such as a random access storage unit (RAM) 8201 and / or a cache storage unit 8202 , and may further include a read-only storage unit (ROM) 8203 .
[0215] The storage unit 820 may also include a program / utility 8204 having a set (at least one) of program modules 8205, such program modules 8205 including but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which or some combination may include an implementation of a network environment.
[0216] Bus 830 may represent one or more of several types of bus structures, including a memory unit bus or memory unit controller, a peripheral bus, an accelerated graphics port, a processing unit, or a local bus using any of a variety of bus architectures.
[0217] The hardware device may also communicate with one or more external devices 700 (e.g., keyboards, pointing devices, Bluetooth devices, etc.), may also communicate with one or more devices that enable a user to interact with the hardware device, and / or communicate with any device that enables the hardware device to communicate with one or more other computing devices (e.g., routers, modems, etc.). Such communication may be performed through an input / output (I / O) interface 850. In addition, the hardware device may also communicate with one or more networks (e.g., local area networks (LANs), wide area networks (WANs), and / or public networks, such as the Internet) through a network adapter 860. As shown, the network adapter 860 communicates with other modules of the hydrogen refueling device through a bus 830. It should be understood that, although not shown in the figure, other hardware and / or software modules may be used in conjunction with the hardware device, including but not limited to: microcode, device drivers, redundant processing units, external disk drive arrays, RAID systems, tape drives, and data backup storage systems.
[0218] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a terminal device, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0219] In an exemplary embodiment of the present application, a computer program medium is further provided, on which computer-readable instructions are stored. When the computer-readable instructions are executed by a processor of a computer, the computer is enabled to execute the method described in the above method embodiment.
[0220] According to one embodiment of the present application, a program product for implementing the method in the above method embodiment is also provided, which can adopt a portable compact disk read-only memory (CD-ROM) and include program code, and can be run on a terminal device, such as a personal computer. However, the program product of the present invention is not limited thereto, and in this document, a readable storage medium can be any tangible medium containing or storing a program, which can be used by or in combination with an instruction execution system, apparatus, or device.
[0221] The program product may be any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. The readable storage medium may be, for example, but not limited to, a system, device or component of electricity, magnetism, light, electromagnetic, infrared, or semiconductor, or any combination thereof. More specific examples (non-exhaustive list) of readable storage media include: an electrical connection with one or more wires, a portable disk, a hard disk, a random access memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disk read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination thereof.
[0222] Computer readable signal media may include data signals propagated in baseband or as part of a carrier wave, in which readable program code is carried. Such propagated data signals may take a variety of forms, including but not limited to electromagnetic signals, optical signals, or any suitable combination of the above. Readable signal media may also be any readable medium other than a readable storage medium, which may send, propagate, or transmit a program for use by or in conjunction with an instruction execution system, apparatus, or device.
[0223] The program code embodied on the readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wired, optical cable, RF, etc., or any suitable combination of the foregoing.
[0224] Program code for performing the operations of the present invention may be written in any combination of one or more programming languages, including object-oriented programming languages such as Java, C++, etc., and conventional procedural programming languages such as "C" or similar programming languages. The program code may be executed entirely on the user computing device, partially on the user device, as a separate software package, partially on the user computing device and partially on a remote computing device, or entirely on a remote computing device or server. In the case of a remote computing device, the remote computing device may be connected to the user computing device through any type of network, including a local area network (LAN) or a wide area network (WAN), or may be connected to an external computing device (e.g., via the Internet using an Internet service provider).
[0225] It should be noted that, although several modules or units of the equipment for action execution are mentioned in the above detailed description, this division is not mandatory. In fact, according to the embodiments of the present application, the features and functions of two or more modules or units described above can be embodied in one module or unit. On the contrary, the features and functions of one module or unit described above can be further divided into being embodied by multiple modules or units.
[0226] In addition, although the steps of the method in the present application are described in a specific order in the drawings, this does not require or imply that the steps must be performed in this specific order, or that all the steps shown must be performed to achieve the desired results. Additionally or alternatively, some steps may be omitted, multiple steps may be combined into one step, and / or one step may be decomposed into multiple steps, etc.
[0227] Through the description of the above implementation methods, it is easy for those skilled in the art to understand that the example implementation methods described here can be implemented by software, or by combining software with necessary hardware. Therefore, the technical solution according to the implementation method of the present application can be embodied in the form of a software product, which can be stored in a non-volatile storage medium (which can be a CD-ROM, a USB flash drive, a mobile hard disk, etc.) or on a network, including several instructions to enable a computing device (which can be a personal computer, a server, a mobile terminal, or a network device, etc.) to execute the method according to the implementation method of the present application.
[0228] Those skilled in the art will readily appreciate other embodiments of the present application after considering the specification and practicing the inventions applied for herein. The present application is intended to cover any modification, use or adaptation of the present application, which follows the general principles of the present application and includes common knowledge or customary techniques in the art that the present application does not apply for. The specification and embodiments are intended to be exemplary only, and the true scope and spirit of the present application are indicated by the appended claims.
Claims
1. A method for obtaining a workpiece processing path, characterized in that: The method comprises: Collect data on the workpiece to obtain the point cloud of the target workpiece; Taking data points in the target workpiece point cloud whose curvature is greater than a curvature threshold as initial path points; Determine at least three initial path points that are adjacent to the initial path point and are not in the same straight line as selected points, and the plane where the selected points are located is the selected plane; A vector determined according to the projection point and the initial path point is used as a selected vector, wherein the projection point refers to a projection of the initial path point on the selected plane; If the angle between the normal vector of the initial path point and the selected vector is less than the angle threshold, the initial path point is used as the target path point; Extracting skeleton lines from at least one path point cloud formed by aggregating target path points; Linear fitting is performed on the skeleton line to obtain a processing path of the workpiece.
2. The method according to claim 1, characterized in that Collect data on the workpiece to obtain the target workpiece point cloud, including: Collect data from a single perspective on the workpiece to obtain a workpiece point cloud; Clustering and segmenting the workpiece point cloud to obtain a plurality of initial segmented point clouds; Determining data collection points of a portion of the workpiece corresponding to the initial segmented point cloud according to the coordinates of each data point in the initial segmented point cloud; Controlling a data acquisition device to move to the data acquisition point, performing data acquisition on the workpiece, and obtaining a segmented point cloud corresponding to the initial segmented point cloud; The segmented point cloud is combined with the workpiece point cloud to obtain a target workpiece point cloud.
3. The method according to claim 1, characterized in that Extracting skeleton lines from at least one path point cloud formed by aggregating target path points includes: Randomly select a target path point in the path point cloud as a recruitment point, and draw two straight lines with a set angle through the recruitment point; Adjust the directions of the two straight lines so that the difference in the number of adjacent points between the two straight lines is maximized, and use the straight line with the larger number of adjacent points as the first straight line and the other straight line as the second straight line; Among the non-recruiting points adjacent to the first straight line of the recruitment point, a non-recruiting point is selected as the next recruitment point, and the distance between the recruitment point and the next recruitment point is within a preset distance interval; wherein, if the next recruitment point cannot be obtained according to the first straight line of the most recently obtained recruitment point, the next recruitment point is obtained from the non-recruiting points adjacent to the second straight line of the most recently obtained recruitment point; If the next recruitment point cannot be determined based on the first straight line and the second straight line of the latest recruitment point, all recruitment points are taken as skeleton points to obtain the skeleton line.
4. The method according to claim 1, characterized in that: Performing linear fitting on the skeleton line to obtain a processing path of the workpiece includes: If the skeleton line can form a closed figure, obtaining the centroid of the skeleton line; Taking the center of gravity as the origin, calculating the polar angle of each skeleton point in the skeleton line; The skeleton points are sorted according to the polar angles, the skeleton point at the front of the sort is the starting point of the processing path, and the skeleton point at the back of the sort is the end point of the processing path; According to the sorting result of the skeleton points, the skeleton line is linearly fitted to obtain a processing path, so that the processing device can traverse all the skeleton points in the processing path in sequence according to the sorting result of the skeleton points.
5. The method according to claim 1, characterized in that Performing linear fitting on the skeleton line to obtain a processing path of the workpiece includes: If the skeleton line cannot form a closed figure, a skeleton point is randomly selected in the skeleton line as a selected point; Selecting a skeleton point farthest from the selected point in the skeleton line as the starting point of the processing path; Sorting the skeleton points according to the distance between each skeleton point in the skeleton line and the starting point; The skeleton line is linearly fitted according to the sorting result to obtain a processing path, so that the processing device can sequentially traverse all the skeleton points in the processing path according to the sorting result of the skeleton points.
6. The method according to claim 4 or 5, characterized in that: Determining whether the skeleton line can form a closed figure includes: Taking any skeleton point on the skeleton line as a test point; The non-test point with the smallest distance from the target test point in the skeleton line is used as the test point, until all the skeleton points on the skeleton line are test points, and the target test point is the most recently determined test point; A test distance between a first determined test point and a last determined test point is obtained. If the test distance is less than a distance threshold, the skeleton line can form a closed figure; otherwise, the skeleton line cannot form a closed figure.
7. A robot comprising a memory, a processor and a readable program stored in the memory, characterized in that: The processor executes the readable program to implement the method according to any one of claims 1 to 6.
8. A readable storage medium, characterized in that: A readable program / instruction is stored thereon, and when the readable program / instruction is executed by a processor, the method according to any one of claims 1 to 6 is implemented.
9. A program product, comprising a readable program / instruction, characterized in that: When the readable program / instructions are executed by a processor, the method according to any one of claims 1 to 6 is implemented.
Citation Information
Patent Citations
Method for automatically generating machining program of countless-analog workpiece robot
CN115937468A
Cycloid milling track generation method for complex shell
CN117193168A