A process trajectory automatic generation method and device, and an electronic device
By projecting point cloud data onto a two-dimensional plane and planning a two-dimensional process path, the problems of workpiece error adaptability and computational efficiency in the prior art are solved, and efficient and high-precision process trajectory generation is achieved.
Patent Information
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- SHANG FEI ZHI NENG JI SHU YOU XIAN GONG SI
- Filing Date
- 2025-11-19
- Publication Date
- 2026-06-23
AI Technical Summary
Existing CAD-based methods cannot perceive and adapt to the actual manufacturing errors of workpieces, while methods based on dynamic point cloud data involve large computational loads and long processing times, making it difficult to achieve efficient and high-precision process trajectory generation.
By acquiring the point cloud data of the workpiece, it is projected from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set. The process path is then planned in the two-dimensional plane, the surface normal vector is calculated, and finally the two-dimensional path is mapped to three-dimensional space to generate a three-dimensional process trajectory.
It achieves efficient and high-precision process trajectory generation, improves computational efficiency and robustness, and ensures that trajectory points fit the workpiece surface and adapt to changes in the actual physical state of the workpiece.
Smart Images

Figure CN121374591B_ABST
Abstract
Description
Technical Field
[0001] This invention relates to the field of robotics, and in particular to a method and apparatus for automatically generating process trajectories, as well as electronic equipment. Background Technology
[0002] In high-end equipment manufacturing sectors such as aviation, aerospace, automobile manufacturing, and shipbuilding, the demand for automated processes such as grinding, polishing, deburring, spraying, and non-destructive testing of complex curved workpieces is becoming increasingly urgent. One of the core technologies for automating these processes is planning precise process trajectories for robots that conform to the workpiece surface.
[0003] Existing trajectory planning algorithms rely on a single data source, either static CAD models or dynamic point cloud data. However, both static CAD modeling and dynamic point cloud data present practical technical challenges: in traditional industrial scenarios, generating process trajectories using CAD models relies entirely on idealized models, failing to perceive and adapt to actual manufacturing errors, clamping deviations, and physical state changes such as deformation and wear that occur during long-term use; while real-time planning algorithms based on dynamic point cloud data are highly dependent on the quality of the point cloud data, resulting in computationally intensive and time-consuming processes for generating process trajectories, making it difficult to meet the efficiency requirements for online real-time generation.
[0004] Therefore, the industry urgently needs a technical solution that can balance the convenience of offline programming with the adaptability of online sensing, and can uniformly process 3D data from different sources, thereby achieving efficient and high-precision process trajectory generation. Summary of the Invention
[0005] This invention provides a method, apparatus, and electronic device for automatically generating process trajectories, which solves the shortcomings of existing technologies such as CAD-based digital modeling methods being unable to perceive and adapt to the actual manufacturing errors of workpieces, and dynamic point cloud data-based methods being computationally intensive, time-consuming, and inefficient, thereby achieving efficient and high-precision process trajectory generation.
[0006] This invention provides a method for automatically generating process trajectories, comprising: acquiring point cloud data representing the three-dimensional shape of a workpiece to be processed; projecting the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set; planning and generating a two-dimensional process path in the two-dimensional plane based on the contour represented by the two-dimensional projection point set; mapping the two-dimensional process path to the three-dimensional space, determining multiple three-dimensional space points in the point cloud data, and calculating the surface normal vector of each three-dimensional space point to generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0007] According to the method provided by the present invention, the point cloud data includes: model point cloud data generated by a discretization algorithm based on the CAD digital model of the workpiece to be processed; or measured point cloud data directly obtained by acquiring the surface of the workpiece to be processed through a three-dimensional scanning device.
[0008] According to the method provided by the present invention, the discretization algorithm specifically includes: sampling on the surface of the CAD digital model, and ensuring that the distance between any two points in the generated model point cloud data is not less than a preset minimum distance threshold.
[0009] According to the method provided by the present invention, projecting the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set specifically includes: analyzing the distribution characteristics of the point cloud data in three-dimensional space to determine the plane that minimizes its projection distortion, and using it as the preset two-dimensional plane; orthogonally projecting each three-dimensional spatial point in the point cloud data onto the two-dimensional plane to generate the two-dimensional projection point set.
[0010] According to the method provided by the present invention, in the two-dimensional plane, a two-dimensional process path is planned and generated based on the contour represented by the two-dimensional projection point set, including: within the contour represented by the two-dimensional projection point set, a set of reciprocating paths or looping paths for traversing the internal region of the contour is generated according to a preset path spacing, as the two-dimensional process path.
[0011] According to the method provided by the present invention, the step of calculating the surface normal vector of each of the three-dimensional spatial points includes: for any three-dimensional spatial point, finding neighboring three-dimensional spatial points whose distance from the three-dimensional spatial point is within a predetermined range in the point cloud data to which the three-dimensional spatial point belongs; determining a local tangent plane by mathematical fitting the neighboring three-dimensional spatial points; and using the normal direction of the local tangent plane as the surface normal vector of the three-dimensional spatial point.
[0012] According to the method provided by the present invention, the method further includes: using the three-dimensional process trajectory generated based on the model point cloud data as an offline trajectory template; acquiring the measured point cloud data of the workpiece to be processed; determining, through iterative optimization, a spatial pose transformation relationship that minimizes the distance between points on the offline trajectory template and corresponding points in the measured point cloud data; updating the offline trajectory template according to the spatial pose transformation relationship to generate a final execution trajectory adapted to the workpiece to be processed.
[0013] According to the method provided by the present invention, the method further includes: using the three-dimensional process trajectory generated based on the measured point cloud data as a standard teaching trajectory, so as to be directly called when processing subsequent workpieces.
[0014] The present invention also provides an automatic process trajectory generation device, comprising:
[0015] The point cloud data acquisition module is used to acquire point cloud data that characterizes the three-dimensional shape of the workpiece to be processed;
[0016] The two-dimensional point set generation module is used to project the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set;
[0017] A two-dimensional process generation module is used to plan and generate a two-dimensional process path in the two-dimensional plane based on the contour represented by the two-dimensional projection point set.
[0018] The three-dimensional process generation module is used to map the two-dimensional process path to the three-dimensional space, determine multiple three-dimensional space points in the point cloud data, calculate the surface normal vector of each three-dimensional space point, and generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0019] The present invention also provides an electronic device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the automatic process trajectory generation method as described above.
[0020] The present invention also provides a non-transitory computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the automatic process trajectory generation method as described above.
[0021] The present invention also provides a computer program product, including a computer program that, when executed by a processor, implements the automatic process trajectory generation method as described above.
[0022] The automatic process trajectory generation method and apparatus provided by this invention acquires point cloud data representing the three-dimensional shape of the workpiece to be processed, then projects the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set, and plans and generates a two-dimensional process path in the two-dimensional plane. This simplifies the complex and computationally intensive three-dimensional path planning problem into a mature and efficient two-dimensional plane path planning problem, greatly improving computational efficiency and robustness. Finally, the two-dimensional process path is mapped back to three-dimensional space to determine multiple three-dimensional spatial points in the point cloud data, and the surface normal vector of each three-dimensional spatial point is calculated, ensuring that the final generated trajectory points fit perfectly in the original three-dimensional space. Through the combination of the above steps, this invention significantly improves the automation level and computational efficiency of trajectory generation while ensuring the three-dimensional accuracy of the final trajectory, achieving efficient and high-precision process trajectory generation. Attached Figure Description
[0023] To more clearly illustrate the technical solutions in this invention or the prior art, the drawings used in the description of the embodiments or the prior art will be briefly introduced below. Obviously, the drawings described below are some embodiments of this invention. For those skilled in the art, other drawings can be obtained from these drawings without creative effort.
[0024] Figure 1 This is a flowchart illustrating the automatic process trajectory generation method provided by the present invention.
[0025] Figure 2 This is a schematic diagram of converting a CAD digital model into model point cloud data provided by the present invention.
[0026] Figure 3 This is a schematic diagram illustrating the effect of the alpha-shapes algorithm provided by this invention.
[0027] Figure 4 This is a decision-making flowchart for sampling points provided by the present invention.
[0028] Figure 5 This is a schematic diagram of the method for updating trajectory templates through visual guidance provided by the present invention.
[0029] Figure 6 This is a schematic diagram of the automatic process trajectory generation device provided by the present invention.
[0030] Figure 7 This is a schematic diagram of the structure of the electronic device provided by the present invention. Detailed Implementation
[0031] To make the objectives, technical solutions, and advantages of this invention clearer, the technical solutions of this invention will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some, not all, of the embodiments of this invention. All other embodiments obtained by those skilled in the art based on the embodiments of this invention without creative effort are within the scope of protection of this invention.
[0032] Regarding the two types of methods mentioned in the existing technology:
[0033] The first category is offline programming methods based on CAD digital models. This method imports the 3D CAD model of the workpiece into a virtual environment, plans a trajectory on the ideal model using CAM (Computer-Aided Manufacturing) software or dedicated offline programming software, then generates a robot program and downloads it to the robot controller for execution. The advantage of this method is that programming can be completed without interrupting production time, and the generated trajectory is theoretically accurate. However, its disadvantage lies in its significant deviation from actual working conditions. Due to manufacturing tolerances, workpiece clamping errors, thermal deformation, and other factors, there is always a deviation between the surface contour of the actual workpiece and the theoretical CAD model. This causes the ideal trajectory generated offline to fail to truly conform to the actual workpiece, resulting in uneven processing quality (such as under-grinding or over-grinding), or even, in severe cases, collisions between the robot's end effector and the workpiece, damaging the equipment.
[0034] The second category is online generation methods based on sensors such as 3D vision. This method uses 3D sensors such as line laser profilometers and structured light cameras to scan the surface of the actual workpiece in real time, acquiring its 3D point cloud data, and then directly planning and generating trajectories on the point cloud data. This method can perceive the true shape of the workpiece, thereby generating trajectories that can adapt to actual deviations, ensuring processing quality. However, its disadvantages are also obvious: First, it is highly dependent on physical samples and cannot be pre-programmed during the product design stage or when there is no physical object; second, the process of on-site scanning, data processing, and trajectory calculation is time-consuming, reducing production cycle time and efficiency. In addition, the point cloud data collected by sensors may contain problems such as noise, holes, and missing data, posing a significant challenge to stable and reliable trajectory generation.
[0035] In addition, the existing methods generate trajectories that are mostly simple straight lines or circular interpolations, lacking advanced waveform interpolation functions that are deeply coupled with specific processes and affect processing quality. They have poor process adaptability and require experienced engineers to make a lot of tedious manual adjustments.
[0036] To address the problems existing in the prior art, this invention provides an automatic process trajectory generation method. Its core lies in efficiently and stably completing the core path planning steps of the complex three-dimensional trajectory planning problem in a two-dimensional plane, and then mapping it back to the original three-dimensional space. This combines the efficiency of path planning in a two-dimensional plane with the accuracy of the three-dimensional process trajectory after mapping the path from the two-dimensional plane to three-dimensional space. This method can handle not only theoretical CAD models but also directly process measured point cloud data, possessing high flexibility and industrial applicability.
[0037] In practical implementation, the method provided in this embodiment of the invention can be deployed in a robot automation system, which includes:
[0038] Electronic device: used to perform data processing and algorithm calculations, such as an industrial control computer, server or embedded computer, the electronic device including a processor and a memory, the memory storing a computer program for performing the method of the present invention;
[0039] Robot system: includes robot body, robot controller and end effector (such as grinding head, spray gun or detection probe);
[0040] And 3D scanning devices, such as line laser scanners or structured light cameras, as required;
[0041] Auxiliary connection components include a data transmission module (ensuring high-speed data transmission between devices) and tooling fixtures (used to fix the workpiece to be processed, ensuring processing stability). The above devices are connected via wired or wireless communication.
[0042] Before introducing the technical solutions of the embodiments of the present invention, the terminology of the embodiments of the present invention will be explained illustratively.
[0043] Point cloud data: A collection of massive three-dimensional coordinate points used to comprehensively characterize the three-dimensional shape features of the workpiece to be processed, and is the basic data source for trajectory generation.
[0044] Model point cloud data: Point cloud data generated from the CAD digital model of the workpiece to be processed through discretization algorithms (such as Monte Carlo sampling), which is theoretical three-dimensional topographic data.
[0045] Measured point cloud data: Point cloud data that reflects the true physical state of the workpiece is obtained by directly collecting data from the surface of the workpiece to be processed using a 3D scanning device (such as a line laser scanner or a structured light camera).
[0046] Two-dimensional projection point set: The set of two-dimensional coordinate points formed by orthogonally projecting three-dimensional point cloud data from three-dimensional space onto a preset two-dimensional plane (the plane with the least projection distortion).
[0047] Two-dimensional process path: The trajectory generated within the workpiece contour represented by a two-dimensional projection point set according to a preset path spacing, including reciprocating paths or loop paths, is used to simplify the complexity of three-dimensional trajectory planning.
[0048] Surface normal vector: A vector perpendicular to the local tangent plane to which a point in three-dimensional space belongs. It is used to characterize the surface attitude of the point and is the core parameter for generating attitude information of three-dimensional process trajectory.
[0049] 3D process trajectory: After mapping the 2D process path back to 3D space, the resulting complete trajectory contains the coordinates of each 3D point and the surface normal vector (attitude information), which can be directly used to guide the robot to perform processing operations.
[0050] Three-dimensional spatial point: The basic unit that constitutes point cloud data or three-dimensional process trajectory. Each point contains clear three-dimensional coordinate information (X, Y, Z) and is used to locate the position of the workpiece surface.
[0051] Local tangent plane: A plane obtained by fitting a certain three-dimensional space point to neighboring three-dimensional space points. This plane is tangent to the workpiece surface at that point and is the basis for calculating the surface normal vector.
[0052] Offline trajectory templates: 3D process trajectories generated based on model point cloud data can be pre-made during non-production periods for quick recall and adaptation during subsequent batch processing.
[0053] Spatial pose transformation: The spatial transformation relationship (including translation, rotation and other parameters) determined by iterative optimization is used to correct the deviation between the offline trajectory template and the measured point cloud data, so that the trajectory can be adapted to the actual pose of the workpiece.
[0054] Final execution trajectory: The trajectory obtained by compensating the offline trajectory template through spatial pose transformation is adapted to the actual physical state of the workpiece to be processed. It is the basis for the robot to finally perform the processing operation.
[0055] The following is combined with Figures 1-5 This invention describes the automatic process trajectory generation method provided in the embodiments of the present invention.
[0056] Figure 1 This is one of the flowcharts illustrating the automatic process trajectory generation method provided in this embodiment of the invention. The method includes the following:
[0057] Step 101: Obtain point cloud data that characterizes the three-dimensional shape of the workpiece to be processed.
[0058] This step is the initial stage of the method of this invention, and its function is to provide initial, digitized geometric input for all subsequent calculation steps. In this step, acquisition refers to providing the method with raw data to characterize the three-dimensional geometry of the workpiece through one or more technical means. Point cloud data, as a standard three-dimensional data structure, refers to a set of discrete data points in a shared coordinate system, which can effectively describe the outer surface contour of an object. Each data point contains its coordinate information in three-dimensional space.
[0059] The purpose of this step is to establish a unified starting point for data processing. In complex industrial environments, the three-dimensional shape information of a workpiece may exist in various forms, such as CAD digital models as design drawings or as physical entities. This step converts this shape information from different sources into standardized point cloud data, enabling subsequent steps such as projection, planning, and mapping to be performed based on a unified data format. This simplifies the complexity of the algorithm and improves the universality of the method.
[0060] Step 102: Project the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set.
[0061] In step 102, projection is a mathematical mapping operation that transforms each three-dimensional point in the obtained three-dimensional point cloud data into a corresponding two-dimensional coordinate point on a certain two-dimensional plane.
[0062] In addition, the preset two-dimensional plane refers to a reference plane defined in three-dimensional space, which serves as the target carrier for this projection operation. The selection and positioning of this plane are intended to ensure that the projection process can retain the overall topological shape and contour features of the workpiece represented by the original point cloud to the greatest extent possible, and avoid serious geometric distortion caused by improper projection angle.
[0063] The purpose of step 102 is to simplify the complex and computationally intensive 3D spatial path planning problem into a mature and efficient 2D planar path planning problem. By transforming massive amounts of 3D point cloud data into a simpler 2D point set, the subsequent path planning algorithm can run in a lower-dimensional space. This significantly reduces the computational complexity and execution time of the algorithm, and improves the robustness of path generation.
[0064] The final output of this step is a two-dimensional projection point set, which is a collection of multiple two-dimensional coordinate points. This set visually outlines the boundary contour of the workpiece to be processed on a two-dimensional plane, providing a clear geometric basis for subsequent steps to plan specific process paths within this contour.
[0065] Step 103: In the two-dimensional plane, based on the contour represented by the two-dimensional projection point set, plan and generate a two-dimensional process path.
[0066] In this step, planning generation is an algorithm-driven process aimed at systematically and systematically creating a path that effectively covers the target area, rather than simply connecting points. The key to this planning process lies in the contour represented by a set of two-dimensional projected points. This means that the two-dimensional projected point set generated in the previous step is used as a geometric constraint boundary. The planning algorithm ensures that the generated path lies strictly within this contour, thereby guaranteeing that all subsequent robot machining actions occur within the effective area of the workpiece, avoiding idle travel or movement outside the workpiece.
[0067] The two-dimensional process path obtained in this step is a path defined by an ordered sequence of two-dimensional coordinate points or a mathematical curve. It is essentially an abstract motion pattern, such as a reciprocating scanning pattern or a spiral contraction pattern from the outside in. The two-dimensional path itself does not contain three-dimensional height and orientation information, but it fully encodes the lateral movement logic and coverage strategy that the robotic tool should follow.
[0068] Through this step, the two-dimensional process path output by the embodiment of the present invention will serve as a clear index, providing guidance for the next step to recover the three-dimensional shape of the trajectory from the original three-dimensional point cloud.
[0069] Step 104: Map the two-dimensional process path to the three-dimensional space, determine multiple three-dimensional space points in the point cloud data, calculate the surface normal vector of each three-dimensional space point, and generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0070] The main purpose of this step is to combine the two-dimensional process path with the original high-precision three-dimensional point cloud data to generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0071] This step involves two main processes:
[0072] The first process is to "map the two-dimensional process path to three-dimensional space to determine multiple three-dimensional spatial points." Here, this mapping is an operation that uses the two-dimensional process path as an index to query and locate points in the original point cloud data. Specifically, for each point on the two-dimensional process path, the method in this embodiment searches for the corresponding three-dimensional spatial point in the acquired point cloud data in terms of projection. By repeating this operation, a series of ordered three-dimensional spatial points corresponding to the two-dimensional process path can be determined. This process ensures that the final generated trajectory can be accurately attached to the original workpiece surface in terms of position.
[0073] The second process is "calculating the surface normal vector for each 3D spatial point." This process aims to assign pose information to each 3D location point determined in the previous step. Specifically, for each 3D spatial point, the method in this embodiment analyzes the distribution of points within a local neighborhood of the original point cloud data, and determines the normal direction of the local surface at the point's location through mathematical fitting and other methods. This normal direction is then used as the surface normal vector of the 3D spatial point to guide the pose of the robot's end effector.
[0074] The final output 3D process trajectory is an ordered data sequence. Each element in this sequence contains a 3D coordinate value and a surface normal vector value. This trajectory data can be directly used for subsequent robot motion control.
[0075] The automatic process trajectory generation method provided in this invention acquires point cloud data representing the three-dimensional shape of the workpiece to be processed. Then, it projects the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set. A two-dimensional process path is then planned and generated in the two-dimensional plane, simplifying the complex and computationally intensive three-dimensional path planning problem into a mature and efficient two-dimensional plane path planning problem, greatly improving computational efficiency and robustness. Finally, the two-dimensional process path is mapped back to three-dimensional space to determine multiple three-dimensional spatial points in the point cloud data, and the surface normal vector of each three-dimensional spatial point is calculated, ensuring that the final generated trajectory points fit perfectly in the original three-dimensional space. Through the combination of the above steps, this invention significantly improves the automation level and computational efficiency of trajectory generation while ensuring the three-dimensional accuracy of the final trajectory, achieving efficient and high-precision process trajectory generation.
[0076] Furthermore, in this embodiment of the invention, the point cloud data is acquired in the following two ways:
[0077] The first method: Based on the CAD digital model, generate model point cloud data through a discretization algorithm.
[0078] This approach is suitable for scenarios where a theoretical design model of the workpiece is available. Specifically, when the design department provides a CAD digital model of the workpiece to be processed (e.g., a file in a standard format such as STEP, IGES, or Parasolid), this embodiment generates model point cloud data by executing a discretization algorithm to perform dense sampling on the surface of the CAD model.
[0079] In a preferred embodiment, to ensure the stability and accuracy of subsequent calculations, the discretization algorithm employs the Poisson Disk Sampling method. Compared to simple random sampling (Monte Carlo sampling), Poisson Disk Sampling offers the significant advantage of generating a highly uniformly distributed set of points. The core of the algorithm is ensuring that the Euclidean distance between any two points in the final generated model point cloud data is no less than a preset minimum distance threshold. This characteristic effectively avoids excessive clustering or sparseness of the point cloud in local regions, thus providing a high-quality, unbiased data foundation for accurate local surface fitting and surface normal vector calculation in subsequent steps. The number of sampling points or the minimum distance threshold can be set according to the workpiece size, surface complexity, and accuracy requirements of subsequent processes.
[0080] The second method involves using a 3D scanning device to collect data on the surface of the workpiece to be processed and obtaining measured point cloud data.
[0081] This approach is suitable for industrial scenarios where there is no CAD model or where reverse teaching based on a physical standard sample is required. Specifically, in this embodiment, a configured 3D scanning device is used to scan the surface of a physical workpiece to directly obtain measured point cloud data containing its true shape, size, and potential deformation.
[0082] The 3D scanning device may include a line laser profile scanner fixedly mounted on a robot workstation, or a handheld structured light scanner held by another robot / operator. The scanning process converts the workpiece surface into millions or even tens of millions of data points with 3D coordinates (X, Y, Z). In practical applications, due to factors such as ambient lighting and the reflective properties of the object surface, the acquired raw measured point cloud data may contain noise and outliers. Therefore, after this step, necessary preprocessing of the measured point cloud data is included, such as using filtering algorithms like Statistical Outlier Removal or Radius Outlier Removal to improve the purity and quality of the point cloud data.
[0083] Through any of the above technologies, whether it is a virtual model derived from theoretical design or a real workpiece from the physical world, its three-dimensional shape information has been successfully converted into a unified point cloud data format, laying a solid foundation for executing the subsequent standardized and automated trajectory generation process.
[0084] In this embodiment of the invention, the discretization algorithm is a crucial step in converting a CAD digital model into model point cloud data. This algorithm generates model point cloud data by sampling the surface of the CAD digital model. To ensure the quality and uniformity of the point cloud data, the algorithm specifically incorporates the following key steps:
[0085] First, the algorithm performs uniform sampling on the surface of the CAD digital model. The sampling process is based on the geometric characteristics of the model surface and employs an adaptive sampling strategy. Specifically, for each local region of the model surface, the sampling density is dynamically adjusted according to its curvature and complexity. In regions with greater curvature or complex geometric features, the sampling points are more densely packed to ensure that the details of these key areas are fully captured; while in regions with less curvature or relatively flat areas, the sampling points are relatively sparse to reduce unnecessary computational overhead.
[0086] During the generation of sampling points, the algorithm introduces a preset minimum distance threshold. This threshold ensures that the distance between any two points in the generated model point cloud data is not less than this threshold. This avoids redundant calculations caused by overly dense sampling points and ensures a uniform distribution of the point cloud data. Specifically, after generating a new sampling point, the algorithm checks the distance between that point and previously generated sampling points. If the distance is less than the preset minimum distance threshold, the point is discarded, and a new sampling point is generated until the distance requirement is met.
[0087] After initial sampling, the algorithm optimizes the generated model point cloud data. The optimization process includes removing duplicate points, filling holes, and smoothing the point cloud data. Through these optimization steps, the generated model point cloud data not only has a uniform distribution but also better reflects the geometric features of the CAD digital model, providing a high-quality data foundation for subsequent process trajectory generation.
[0088] Through the above steps, the discretization algorithm of this invention can efficiently convert CAD digital models into model point cloud data while ensuring the uniformity and quality of the point cloud data. This algorithm is not only applicable to various complex CAD models, but also can flexibly adjust the sampling strategy according to different processing requirements, providing reliable data support for the automated processing of complex curved surface workpieces.
[0089] Taking the storage of triangular facets in a CAD model as an example, see [link / reference]. Figure 2 For static digital model input, the different data formats are first standardized into triangular facets for storage, based on the data format of the imported CAD digital model. The specific steps are as follows:
[0090] 1) STL file processing. For STL type files, since their structure is already composed of triangular faces, these triangular faces can be directly extracted and stored as a triangular face set. This step ensures direct use of the data without the need for additional conversion or processing.
[0091] 2) STEP File Processing. For STEP type files, the data structure typically contains parametric surface descriptions. First, these parametric surfaces are parametrically processed within a planar rectangular unit in UV space. Then, control points are sampled within this plane, and the Delaunay triangulation algorithm is used to convert these control points into triangular patches. Finally, the generated triangular patches are mapped back to the 3D surface, completing the data parsing normalization.
[0092] 3) Generation of the triangular facet set. Through the above steps, a unified triangular facet set can be obtained from both STL and STEP files. This set not only contains the geometric information of the workpiece but also provides the basic data for subsequent discretization algorithms.
[0093] 4) Discretization. After obtaining the set of triangular facets, these facets are further discretized. By sampling on each facet and ensuring that the distance between any two points is not less than a preset minimum distance threshold, model point cloud data is generated. This step ensures the uniform distribution and high quality of the point cloud data, providing accurate data support for subsequent process trajectory generation.
[0094] Taking the discretization of point cloud data using the Monte Carlo sampling method as an example, the specific steps include:
[0095] 1) Calculate the total area of the triangular facets. First, iterate through all the triangular facets, calculate the area of each facet, and then calculate the total area ΣS. i This step lays the foundation for subsequent sampling point allocation.
[0096] 2) Determine the total number of sampling points. Based on the preset number of sampling points per unit area n, calculate the total number of sampling points N = nΣS i This total number N will be used for sampling the entire model.
[0097] 3) Assign sampling points to triangular facets. For each triangular facet A... i According to its area as a percentage of the total area S i / ΣS i Calculate the number of sampling points n that it should occupy. i = n S i / ΣS i .
[0098] 4) Monte Carlo Sampling. Sampling points are generated on each triangular facet using the Monte Carlo sampling method. Specifically, for the selected triangular facet, the coordinates of the sampling points are randomly generated using the barycentric coordinate system:
[0099] P=αA+βB+γC
[0100] Where A, B, and C are the vertices of the triangular facets, and α, β, and γ are positive numbers satisfying α + β + γ = 1. These coefficients are calculated using uniformly distributed random numbers r1 and r2.
[0101]
[0102] Where r1, r2 ~ μ(0,1).
[0103] 5) Generate discrete point cloud. Using the sampling method described above, the continuous geometric features are transformed into a discrete point cloud, which serves as the input for the next step of process trajectory generation. This step ensures the uniform distribution and high quality of the point cloud data, providing accurate data support for subsequent process trajectory generation.
[0104] The above embodiments have detailed how to convert CAD models into unified triangular facet storage, providing a foundation for subsequent discretization algorithms and process trajectory generation. This process not only improves data processing efficiency but also ensures data accuracy and consistency, providing reliable data support for the automated machining of complex curved surface workpieces.
[0105] In step 102, projecting the point cloud data from three-dimensional space onto a preset two-dimensional plane is a key step in achieving efficient path planning. The specific implementation process is as follows:
[0106] (1) Determine the projection plane.
[0107] First, the distribution characteristics of the point cloud data in three-dimensional space are analyzed. Principal component analysis (PCA) of the point cloud data is performed to determine its main distribution directions. PCA helps identify the main geometric features of the point cloud data in three-dimensional space, particularly its major axis, minor axis, and normal direction. Based on the PCA results, a plane that best matches the distribution of the point cloud data is selected, minimizing projection distortion on this plane. This plane is then used as the preset two-dimensional plane for subsequent projection operations.
[0108] (2) Orthographic projection
[0109] After determining the preset two-dimensional plane, each three-dimensional spatial point in the point cloud data is orthogonally projected onto this two-dimensional plane. Specifically, for each three-dimensional spatial point P... 3D Calculate its orthogonal projection point P on the preset two-dimensional plane. 2D Orthogonal projection is calculated by using the distance formula from a point to a plane to project 3D points onto the plane along the normal direction, thus generating a 2D projected point set. This process not only preserves the geometric features of the point cloud data but also significantly reduces the complexity of the data, providing a foundation for subsequent 2D path planning.
[0110] (3) Optimize projection results
[0111] After projection, the generated 2D projected point set is optimized. The optimization process includes removing overlapping or outlier points that may be introduced during projection, and smoothing the projected point set to ensure its quality and consistency. Through these optimization steps, the generated 2D projected point set can more accurately reflect the contour and shape features of the original point cloud data, providing high-quality input data for subsequent 2D process path planning.
[0112] Through the above steps, this embodiment of the invention can efficiently project 3D point cloud data onto a 2D plane while ensuring the accuracy of the projection and minimizing distortion. This method not only simplifies the complexity of path planning but also provides reliable data support for subsequent 2D process path generation, significantly improving the efficiency and accuracy of overall process trajectory generation.
[0113] In step 103, the planning of the two-dimensional process path is based on the contour represented by the two-dimensional projection point set, with the aim of generating a set of paths that can efficiently traverse the internal region of the contour. The specific implementation process is as follows:
[0114] (1) Contour extraction and analysis.
[0115] First, contour extraction is performed on the 2D projection point set. Contour lines are extracted from the point set using computational geometry methods (such as the α-shapes algorithm or the convex hull algorithm). These contour lines clearly define the boundaries of the area to be processed. For complex contours, there may be an outer contour and multiple inner holes (i.e., inner contours). By analyzing the geometric features of these contours, the starting point, ending point, and key feature points of the contour are determined, providing a basis for subsequent path planning.
[0116] (2) Path spacing settings.
[0117] Based on process requirements and workpiece characteristics, the path spacing is preset. Path spacing refers to the distance between two adjacent processing paths, and this parameter directly affects processing efficiency and quality. For example, in grinding or spraying processes, the path spacing needs to be adjusted according to the tool's coverage area and processing accuracy requirements. After presetting the path spacing, the number and distribution of paths are calculated based on the geometry and dimensions of the contour.
[0118] (3) Path generation method selection.
[0119] When generating a two-dimensional process path within a contour, you can choose a reciprocating path or a wraparound path.
[0120] Reciprocating paths are suitable for regular-shaped contours, such as rectangles or circles. The path starts at one end of the contour, moves in a straight line along a preset direction, and then reverses direction at the other end, forming a zigzag pattern. This pathing method can efficiently cover the entire processing area and is suitable for large-area processing tasks.
[0121] Wrap-around paths are suitable for complex contours, especially areas with multiple internal holes. The path begins at the boundary of the contour and gradually contracts inward along its shape, forming a wrap-around path. This approach better adapts to the geometry of complex contours, avoiding intersections and overlaps between paths.
[0122] (4) Path generation and optimization.
[0123] Based on the selected path generation method, a two-dimensional process path is generated within the contour according to a preset path spacing. For reciprocating paths, a series of parallel line segments are generated by calculating the boundary points and directions of the contour; for wraparound paths, a series of closed paths are generated by gradually shrinking the contour boundaries. After path generation, the paths are optimized, including smoothing path corners, adjusting path density, and removing possible redundant paths, to ensure path continuity and processing efficiency.
[0124] Through the above steps, embodiments of the present invention can efficiently plan two-dimensional process paths adapted to the internal region of a contour in a two-dimensional plane. These paths not only fully cover the processing area, but also allow for flexible adjustment of the path form and spacing according to different process requirements, thereby providing high-quality two-dimensional basic paths for subsequent three-dimensional process trajectory generation, significantly improving the efficiency and accuracy of overall process trajectory generation.
[0125] In this embodiment of the invention, principal component analysis (PCA) and rigid body transformation are used to transform three-dimensional point cloud data into two-dimensional point cloud data on the principal plane. Furthermore, a contour extraction algorithm is used to find the outer contour and inner hole of the planar polygon in order to plan a two-dimensional process path. The specific steps are as follows:
[0126] First, based on the input point cloud features (whether generated by CAD digital model discretization or directly acquired by a sensing system), the principal component orientation of the point cloud data is determined by PCA. Then, rigid body transformation is applied to map the point cloud data onto the principal plane to generate two-dimensional point cloud data.
[0127] Secondly, the alpha-shapes algorithm is used to extract contours from the 2D point cloud data, identifying the outer contours and inner holes of planar polygons. By adjusting shape parameters, the alpha-shapes algorithm can flexibly extract detailed features at different levels, such as... Figure 3 As shown.
[0128] Next, set the initial search direction and the horizontal and vertical intervals h and v, and perform a line scan on the planar point cloud. Use the ray casting method to determine whether the sampling point is within the planar polygon. For points generated on the inner contour, use a bisection method to progressively approximate the contour boundary point to ensure that the sampling point can accurately cover the contour area.
[0129] Finally, based on the extracted contour information, a two-dimensional process path is planned. Within the contour represented by the two-dimensional projection point set, a set of reciprocating or looping paths is generated according to the preset path spacing to traverse the internal region of the contour, serving as the two-dimensional process path.
[0130] In this embodiment of the invention, in order to accurately extract the contour and plan the process path, it is necessary to determine the relationship between the sampling points and the planar polygon M. Figure 4 A decision flowchart for sampling points is provided to handle the relationship between sampling point P1, the next sampling point P2, and the planar polygon M. Specifically, it includes:
[0131] 1) Obtaining sampling points. Obtain the current sampling point P1 and the next sampling point P2.
[0132] 2) Relationship Determination. Determine the relative positional relationship between sampling points P1 and P2 and the planar polygon M. This involves four main cases:
[0133] Case 1: P1 and P2 are both inside polygon M.
[0134] Case 2: P1 and P2 are both outside polygon M.
[0135] Case 3: P1 is inside polygon M, while P2 is outside polygon M.
[0136] Case 4: P1 is outside polygon M, while P2 is inside polygon M.
[0137] 3) Decision-making and handling. Depending on the specific circumstances, appropriate measures will be taken:
[0138] For case 1 (P1 and P2 are both inside M), these two points are retained because they are both inside the polygon and have no impact on contour extraction.
[0139] For case 2 (P1 and P2 are both outside M), these two points are not retained because they are not inside the polygon and do not contribute to contour extraction.
[0140] For case 3 (P1 is inside M, P2 is outside M), retain point P1 and find the contour point between P1 and P2, because the transition from P1 to P2 may cross the contour boundary.
[0141] For case 4 (P1 is outside M, P2 is inside M), retain point P2 and find the contour point between P2 and P1, again because the transition from P2 to P1 may cross the contour boundary.
[0142] 4) Finding contour points. In cases where it is necessary to find contour points (cases 3 and 4), use an appropriate algorithm (such as the ray method or bisection method) to determine the contour points between P1 and P2. These contour points are points on the polygon boundary and are crucial for accurately defining the polygon contour.
[0143] Furthermore, to ensure the accuracy of the process trajectory and the machining quality, this embodiment of the invention employs an efficient local fitting strategy when calculating the surface normal vectors of points in three-dimensional space. The specific implementation process is as follows:
[0144] First, for each 3D spatial point, the system searches for neighboring points in its corresponding point cloud data. These neighboring points are determined by setting a predetermined distance range, which takes into account both the density of the point cloud and the geometric complexity of the workpiece surface. To improve retrieval efficiency, the system utilizes a spatial indexing structure (such as a KD-tree) to quickly locate all neighboring points within the predetermined distance to the target point.
[0145] Next, the system performs a mathematical fit on these neighboring points to determine their local tangent plane. The fitting process typically employs Moving Least Squares (MLS), which minimizes the sum of squared distances from neighboring points to the fitted plane to obtain an optimally fitted plane. This plane accurately reflects the geometric characteristics of the local region, providing a basis for subsequent normal vector calculations.
[0146] Finally, the system calculates the normal direction of the fitted plane to obtain the surface normal vector of the point in 3D space. The direction of the normal vector directly reflects the geometric "orientation" of the point on the local surface, which is crucial for the posture adjustment of the robotic tool. To further improve the accuracy and stability of the normal vector, the system also optimizes the calculation results, for example, by using smoothing algorithms to reduce the influence of noise and ensure the consistency and continuity of the normal vector within the local region.
[0147] Using the above method, the embodiments of the present invention can efficiently and accurately calculate the surface normal vector of each three-dimensional spatial point, providing accurate posture information for the machining of complex curved surfaces, thereby significantly improving machining quality and efficiency.
[0148] Furthermore, based on the generation of three-dimensional process trajectories, this embodiment of the invention provides two optimization and application schemes to improve the adaptability of the trajectory and processing efficiency.
[0149] (1) Optimization of offline trajectory templates.
[0150] First, the 3D process trajectory generated based on the model point cloud data is used as an offline trajectory template. This template is generated based on an idealized CAD model, ensuring the theoretical accuracy and process requirements of the trajectory. The generation process of the offline trajectory template does not depend on a specific workpiece instance, so it can be completed in advance during the design phase, saving programming time in actual production.
[0151] Before actual processing, measured point cloud data of the workpiece to be processed is acquired using a 3D scanning device. This measured data reflects the actual shape and size of the workpiece, including actual physical state changes such as manufacturing errors and clamping deviations.
[0152] To ensure the offline trajectory template is adaptable to the actual workpiece, the system employs an iterative optimization algorithm to determine the minimum spatial pose transformation relationship between the distances between points on the offline trajectory template and their corresponding points in the measured point cloud data. Specifically, the Iterative Closest Point (ICP) algorithm or other optimization methods are used to gradually adjust the spatial position and orientation of the template trajectory until the distance between the template trajectory and the measured point cloud is minimized. This process effectively compensates for actual deviations in the workpiece, ensuring the accuracy of the trajectory.
[0153] Based on the determined spatial pose transformation relationship, the offline trajectory template is updated to generate a final execution trajectory adapted to the workpiece to be processed. The updated trajectory not only retains the technological accuracy of the theoretical trajectory but also adapts to the actual state changes of the workpiece, thereby achieving high-precision automated operation in actual processing.
[0154] like Figure 5 As shown, this embodiment of the invention provides a method for updating a trajectory template through visual guidance to adapt to changes in the pose of actual workpieces and improve the flexibility of the automation system. The specific steps are as follows:
[0155] 1) Generation of trajectory template and feature surface point cloud. The trajectory template P and feature surface point cloud C are generated using a 3D digital model. The trajectory template P is a predetermined trajectory generated based on an ideal workpiece model, while the feature surface point cloud C contains the key surface features of the workpiece.
[0156] 2) Acquisition of actual point cloud data. Point cloud data Cr of the actual workpiece is acquired through a visual perception system. This data reflects the state of the workpiece during actual clamping and positioning, and may deviate from the theoretical model.
[0157] 3) Point cloud registration. Using the Iterative Closest Point (ICP) algorithm or other registration techniques, the theoretical point cloud C and the actual point cloud Cr are registered to determine the pose deviation T. The pose deviation T includes the difference between the actual pose and the theoretical pose of the workpiece.
[0158] 4) Track template update. The track template P is updated based on the pose deviation T. This step compensates for the deviation T by adjusting it to the theoretical track template, generating process point information adapted to the actual pose of the current tooling, thus obtaining the actual track Pr.
[0159] 5) Execution of the actual trajectory. The updated trajectory Pr guides the robot in machining operations. Because the trajectory has been adjusted according to the actual workpiece pose, it can more accurately fit the workpiece surface, improving machining quality and efficiency.
[0160] The above embodiments demonstrate how to achieve automatic updating of trajectory templates through visual guidance and point cloud registration technology to adapt to changes in the pose of actual workpieces. This process not only improves the flexibility of the automation system but also ensures the accuracy and consistency of machining operations.
[0161] (2) Application of standard teaching trajectory.
[0162] In addition to optimizing the offline trajectory template, this invention also provides a standard teaching trajectory generated based on measured point cloud data. This trajectory is generated directly from the point cloud data of the actual workpiece, and can realistically reflect the actual shape and processing requirements of the workpiece. The generation process of the standard teaching trajectory takes into account the actual physical state of the workpiece, thus having higher adaptability in subsequent processing.
[0163] When processing the workpieces to be processed later, the standard taught trajectory can be directly called. This method is particularly suitable for production scenarios with multiple batches and few varieties, which can significantly improve processing efficiency and reduce the workload of repetitive programming. By directly calling the standard taught trajectory, the robot can quickly achieve consistent processing results on different workpieces, while ensuring the stability of processing quality.
[0164] Through the two solutions described above, the embodiments of the present invention not only effectively solve the problem of disconnect between traditional offline programming and the actual workpiece state, but also achieve efficient and stable machining in multiple batch production. The optimization of the offline trajectory template ensures accurate matching between the theoretical trajectory and the actual workpiece, while the application of the standard teaching trajectory further enhances the flexibility and efficiency of machining. The combination of these two methods provides an efficient, flexible, and high-precision solution for the automated machining of complex curved surface workpieces.
[0165] The effects achieved by the method in this embodiment of the invention are as follows:
[0166] 1) The method of this invention supports both static CAD models and dynamic point cloud input, enabling it to flexibly adapt to the actual production needs of multiple varieties or large batches. This flexibility allows users to select the most suitable data input method according to different production scenarios and workpiece characteristics, whether based on an idealized CAD model in the design phase or on real-time scanned point cloud data of the actual workpiece.
[0167] 2) By inputting process parameters and performing waveform interpolation at process points, this method enables the same workpiece to quickly adapt to various different process requirements. This feature significantly improves the efficiency and flexibility of the automation system, while also enhancing processing quality. The input of process parameters allows the system to automatically adjust trajectory planning according to different processing objectives (such as grinding, polishing, and spraying), thereby optimizing the process.
[0168] 3) The method in this embodiment of the invention supports the combination of process templates and point cloud registration technology, providing a precise processing solution for freely placed tooling. This combination not only improves the flexibility of the automation system, but also enables the system to adapt to changes in the actual physical state of the workpiece, such as manufacturing errors and clamping deviations, thereby ensuring the accuracy and consistency of the processing.
[0169] The automatic process trajectory generation device provided in the embodiments of the present invention is described below. The automatic process trajectory generation device described below and the automatic process trajectory generation method described above can be referred to in correspondence.
[0170] This invention provides an automatic process trajectory generation device, see [link to relevant documentation]. Figure 6 ,include:
[0171] The point cloud data acquisition module 610 is used to acquire point cloud data that characterizes the three-dimensional shape of the workpiece to be processed;
[0172] The two-dimensional point set generation module 620 is used to project the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set;
[0173] The two-dimensional process generation module 630 is used to plan and generate a two-dimensional process path in the two-dimensional plane based on the contour represented by the two-dimensional projection point set.
[0174] The three-dimensional process generation module 640 is used to map the two-dimensional process path to the three-dimensional space, determine multiple three-dimensional space points in the point cloud data, calculate the surface normal vector of each three-dimensional space point, and generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0175] Figure 7 An example is a schematic diagram of the physical structure of an electronic device, such as... Figure 7As shown, the electronic device may include a processor 810, a communications interface 820, a memory 830, and a communication bus 840. The processor 810, communications interface 820, and memory 830 communicate with each other via the communication bus 840. The processor 810 can call logical instructions in the memory 830 to execute an automatic process trajectory generation method. This method includes: acquiring point cloud data representing the three-dimensional shape of the workpiece to be processed; projecting the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set; planning and generating a two-dimensional process path in the two-dimensional plane based on the contour represented by the two-dimensional projection point set; mapping the two-dimensional process path to the three-dimensional space; determining multiple three-dimensional space points in the point cloud data; calculating the surface normal vector of each three-dimensional space point; and generating a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0176] Furthermore, the logical instructions in the aforementioned memory 830 can be implemented as software functional units and, when sold or used as independent products, can be stored in a computer-readable storage medium. Based on this understanding, the technical solution of the present invention, or the part that contributes to the prior art, or a part of the technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention. The aforementioned storage medium includes various media capable of storing program code, such as USB flash drives, portable hard drives, read-only memory (ROM), random access memory (RAM), magnetic disks, or optical disks.
[0177] On the other hand, the present invention also provides a computer program product, which includes a computer program that can be stored on a non-transitory computer-readable storage medium. When the computer program is executed by a processor, the computer can execute the automatic process trajectory generation method provided by the above methods. The method includes: acquiring point cloud data representing the three-dimensional shape of the workpiece to be processed; projecting the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set; planning and generating a two-dimensional process path in the two-dimensional plane based on the contour represented by the two-dimensional projection point set; mapping the two-dimensional process path to the three-dimensional space, determining multiple three-dimensional space points in the point cloud data, and calculating the surface normal vector of each three-dimensional space point to generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0178] In another aspect, the present invention also provides a non-transitory computer-readable storage medium storing a computer program thereon. When executed by a processor, the computer program implements the automatic process trajectory generation method provided by the above methods. The method includes: acquiring point cloud data characterizing the three-dimensional shape of a workpiece to be processed; projecting the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set; planning and generating a two-dimensional process path in the two-dimensional plane based on the contour characterized by the two-dimensional projection point set; mapping the two-dimensional process path to the three-dimensional space; determining multiple three-dimensional space points in the point cloud data; calculating the surface normal vector of each three-dimensional space point; and generating a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
[0179] The device embodiments described above are merely illustrative. The units described as separate components may or may not be physically separate. The components shown as units may or may not be physical units; that is, they may be located in one place or distributed across multiple network units. Some or all of the modules can be selected to achieve the purpose of this embodiment according to actual needs. Those skilled in the art can understand and implement this without any creative effort.
[0180] Through the above description of the embodiments, those skilled in the art can clearly understand that each embodiment can be implemented by means of software plus necessary general-purpose hardware platforms, and of course, it can also be implemented by hardware. Based on this understanding, the above technical solutions, in essence or the part that contributes to the prior art, can be embodied in the form of a software product. This computer software product can be stored in a computer-readable storage medium, such as ROM / RAM, magnetic disk, optical disk, etc., and includes several instructions to cause a computer device (which may be a personal computer, server, or network device, etc.) to execute the methods described in the various embodiments or some parts of the embodiments.
[0181] Finally, it should be noted that the above embodiments are only used to illustrate the technical solutions of the present invention, and not to limit them; although the present invention has been described in detail with reference to the foregoing embodiments, those skilled in the art should understand that modifications can still be made to the technical solutions described in the foregoing embodiments, or equivalent substitutions can be made to some of the technical features; and these modifications or substitutions do not cause the essence of the corresponding technical solutions to deviate from the spirit and scope of the technical solutions of the embodiments of the present invention.
Claims
1. A method for automatically generating process trajectories, characterized in that, include: Acquire point cloud data characterizing the three-dimensional morphology of the workpiece to be processed; The point cloud data is projected from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set; In the two-dimensional plane, a two-dimensional process path is planned and generated based on the contour represented by the two-dimensional projection point set; The two-dimensional process path is mapped to the three-dimensional space, multiple three-dimensional space points are determined in the point cloud data, and the surface normal vector of each three-dimensional space point is calculated to generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information. Projecting the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set specifically includes: analyzing the distribution characteristics of the point cloud data in three-dimensional space to determine the plane that minimizes its projection distortion, which is then used as the preset two-dimensional plane; and orthogonally projecting each three-dimensional point in the point cloud data onto the two-dimensional plane to generate the two-dimensional projection point set. In the two-dimensional plane, based on the contour represented by the two-dimensional projection point set, a two-dimensional process path is planned and generated, including: within the contour represented by the two-dimensional projection point set, according to a preset path spacing, a set of reciprocating or circling paths for traversing the internal region of the contour is generated as the two-dimensional process path. The step of calculating the surface normal vector of each of the three-dimensional space points includes: For any given three-dimensional spatial point, find the neighboring three-dimensional spatial points whose distance from the given three-dimensional spatial point is within a predetermined range in the point cloud data to which it belongs; The local tangent plane is determined by mathematically fitting the neighboring three-dimensional spatial points; The normal direction of the local tangent plane is taken as the surface normal vector of the point in the three-dimensional space. The method further includes: The three-dimensional process trajectory generated based on point cloud data is used as an offline trajectory template; Obtain the measured point cloud data of the workpiece to be processed; By iteratively optimizing, a spatial pose transformation relationship that minimizes the distance between points on the offline trajectory template and corresponding points in the measured point cloud data is determined. The offline trajectory template is updated according to the spatial pose transformation relationship to generate a final execution trajectory adapted to the workpiece to be processed.
2. The method according to claim 1, characterized in that, The point cloud data includes: model point cloud data generated by a discretization algorithm based on the CAD digital model of the workpiece to be processed; or measured point cloud data directly obtained by acquiring the surface of the workpiece to be processed using a 3D scanning device.
3. The method according to claim 2, characterized in that, The discretization algorithm specifically includes: sampling on the surface of the CAD digital model, and ensuring that the distance between any two points in the generated model point cloud data is not less than a preset minimum distance threshold.
4. The method according to claim 2, characterized in that, The method further includes: The three-dimensional process trajectory generated based on the measured point cloud data will be used as a standard teaching trajectory for direct reference when processing subsequent workpieces.
5. An automatic process trajectory generation device, characterized in that, The apparatus for use in the method according to any one of claims 1-4 comprises: The point cloud data acquisition module is used to acquire point cloud data that characterizes the three-dimensional shape of the workpiece to be processed. The two-dimensional point set generation module is used to project the point cloud data from three-dimensional space onto a preset two-dimensional plane to generate a two-dimensional projection point set; A two-dimensional process generation module is used to plan and generate a two-dimensional process path in the two-dimensional plane based on the contour represented by the two-dimensional projection point set. The three-dimensional process generation module is used to map the two-dimensional process path to the three-dimensional space, determine multiple three-dimensional space points in the point cloud data, calculate the surface normal vector of each three-dimensional space point, and generate a three-dimensional process trajectory containing three-dimensional coordinates and attitude information.
6. An electronic device comprising a memory, a processor, and a computer program stored in the memory and running on the processor, characterized in that, When the processor executes the computer program, it implements the automatic process trajectory generation method as described in any one of claims 1 to 4.