Methods, devices, equipment and media for trajectory programming of space tracking robots

By collecting and standardizing the operator's pose data in space using spatial tracking equipment, generating a 3D trajectory and visually verifying it, the problem of low efficiency in existing robot teaching programming is solved, and end-to-end automation of robot trajectory programming is achieved, enabling rapid response for flexible production.

CN123103670APending Publication Date: 2026-11-17ZHUHAI GREE PRECISION MOLD CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611511135.3
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-09-28
Publication Date
2026-11-17

AI Technical Summary

Technical Problem

Existing robot teaching and programming technologies are inefficient and time-consuming, making it difficult to adapt to the rapid response requirements of flexible production. This is mainly due to the lack of an end-to-end automated mapping link from "human intuitive spatial demonstration" to "robot underlying executable code". There are technical barriers such as inconsistent coordinate system references, incompatible mathematical representations of postures, and the tendency for high-frequency data stream processing to cause system lag.

Method used

The system collects pose data of the operator in space using a spatial tracking device, performs environmental initialization and standardization, generates a 3D trajectory and visualizes it for verification, performs spatial transformation and attitude calculation according to the target robot's underlying control protocol type, generates a control program, and sends it to the target robot for execution through a preset communication protocol.

Benefits of technology

It achieves end-to-end automated mapping from human intuitive spatial actions to robot's underlying executable code, significantly shortening the programming cycle, reducing reliance on operational experience, and meeting the rapid response requirements of flexible production.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN123103670A_ABST
    Figure CN123103670A_ABST
Patent Text Reader

Abstract

This invention discloses a method, apparatus, device, and medium for trajectory programming of a spatial tracking robot. The method involves acquiring pose data of an operator demonstrating motion using a spatial tracking device and initializing the environment; standardizing the pose data and persistently storing it; generating a 3D trajectory based on the standardized trajectory data and visually verifying it to obtain verified trajectory data; performing spatial transformation and attitude calculation on the verified trajectory data according to the target robot's underlying control protocol type to generate a control program for the target robot; and sending the control program and / or the verified trajectory data to the target robot for execution via a preset communication protocol to reproduce the operator's demonstrated motion trajectory. This method overcomes the problems of low programming efficiency and long cycle time caused by manual point-to-point teaching and offline modeling, improves programming and deployment efficiency, reduces reliance on operational experience, and can adapt to the rapid response requirements of flexible production.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This invention relates to the field of industrial robot control technology, and in particular to a method, apparatus, device and medium for programming the trajectory of a spatial tracking robot. Background Technology

[0002] With the widespread application of industrial robots in complex processes such as arc welding, gluing, precision assembly, and material handling, robot trajectory programming technology has become a core element in achieving automated operations. However, existing robot teaching programming technologies still face technical bottlenecks in practical deployments, including low programming efficiency, long development cycles, and difficulty in quickly responding to flexible production demands. The main reasons for these bottlenecks can be attributed to the following structural defects at the technical level: On the one hand, traditional manual online teaching methods heavily rely on operators using handheld physical teaching pendants for point-to-point interaction. This method requires operators to manually control the robot's end effector to move to the target pose and record each step. For tasks involving complex spatial curves or continuous trajectories, this not only results in lengthy operation chains and heavy manual workloads, but also severely limits trajectory accuracy due to the operator's experience and physiological stability. When facing product changes or process parameter adjustments, a full physical teaching process must be repeated, significantly lengthening the programming iteration cycle. Furthermore, this method poses personnel safety risks and physical operation limitations in special working environments such as high temperatures, toxic substances, confined spaces, or high cleanliness levels, making it difficult to meet the urgent needs of modern discrete manufacturing for rapid line changeovers and flexible adaptation.

[0003] On the other hand, while mainstream offline programming technology theoretically achieves a "simulation before execution" work mode, its underlying implementation logic heavily relies on high-precision 3D digital models and absolute coordinate system calibration. In actual engineering implementation, due to factors such as on-site mechanical installation tolerances, workpiece size fluctuations, fixture positioning errors, and robot kinematic parameter drift, spatial pose deviations inevitably exist between the digital twin model and the physical environment. This "model-reality" mismatch directly causes interference or deviation of the offline-planned motion path after it is imported into the on-site controller, requiring technicians to perform tedious secondary coordinate system calibration, trajectory compensation, and repeated debugging. For customized production scenarios with small batches and multiple varieties, the sunk costs of high-precision modeling and long-cycle debugging are too high, resulting in a severely insufficient cost-effectiveness, making offline programming unsuitable for the agile response tasks of flexible production lines.

[0004] In summary, the fundamental problem with existing technologies lies in the lack of an end-to-end automated mapping link from "human-intuitive spatial demonstration" to "bottom-level executable code for robots." There have long been technical barriers between high-frequency pose data acquired in space and heterogeneous robot control protocols, including inconsistent coordinate system benchmarks, incompatible mathematical representations of posture, system lag caused by high-frequency data stream processing, and a lack of reliable flow control in program delivery mechanisms. These shortcomings, compounded by each other, result in a highly fragmented programming process for complex trajectories, characterized by low fault tolerance, delayed verification, and slow deployment. Ultimately, this manifests as existing robot teaching and programming relying on manual point-by-point online teaching or high-precision offline modeling, leading to low efficiency, long cycles, and difficulty in adapting to the rapid response requirements of flexible production.

[0005] Therefore, there is an urgent need in this field for a robot trajectory programming method that can integrate spatial demonstration, data standardization, visualization verification, adaptive protocol conversion, and reliable delivery in order to overcome the aforementioned technical bottlenecks. Summary of the Invention

[0006] The embodiments of the present invention provide a method, apparatus, device and medium for programming the trajectory of a space tracking robot, which aims to solve the technical problem that existing robot teaching programming relies on manual point-by-point online teaching or high-precision offline modeling, resulting in low programming efficiency and long cycle for complex trajectories, making it difficult to adapt to the rapid response requirements of flexible production.

[0007] In a first aspect, embodiments of the present invention provide a trajectory programming method for a space-tracking robot. The method includes: collecting pose data of an operator demonstrating movement in space using a space tracking device and initializing the environment, wherein the pose data includes position data and attitude data; standardizing the pose data to obtain standardized trajectory data and storing the standardized trajectory data; generating a three-dimensional trajectory based on the standardized trajectory data and performing visual verification to obtain verified trajectory data; performing spatial transformation and attitude calculation on the verified trajectory data according to the underlying control protocol type of the target robot to generate a control program for the target robot; and sending the control program and the verified trajectory data to the target robot through a preset communication protocol, wherein the target robot executes the program to reproduce the movement trajectory demonstrated by the operator.

[0008] Secondly, embodiments of the present invention also provide a spatial tracking robot trajectory programming apparatus, including a method unit for executing the spatial tracking robot trajectory programming method as described above.

[0009] Thirdly, embodiments of the present invention also provide a computer device, the computer device including a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the steps of the above-described spatial tracking robot trajectory programming method.

[0010] Fourthly, embodiments of the present invention also provide a computer-readable storage medium storing a computer program, the computer program including program instructions, which, when executed by a processor, can implement the steps of the above-described spatial tracking robot trajectory programming method.

[0011] Compared with the prior art, the beneficial effects of the present invention are: In the technical solution of this invention, the spatial tracking robot trajectory programming method collects pose data of the operator's demonstrated motion using a spatial tracking device and initializes the environment; the pose data is standardized and persistently stored; a three-dimensional trajectory is generated based on the standardized trajectory data and visualized for verification, resulting in verified trajectory data; according to the target robot's underlying control protocol type, spatial transformation and attitude calculation are performed on the verified trajectory data to generate the target robot's control program; the control program and / or the verified trajectory data are sent to the target robot for execution via a preset communication protocol to reproduce the motion trajectory demonstrated by the operator. This method overcomes the problems of low programming efficiency and long cycle caused by manual point-to-point teaching and offline modeling, improves programming and deployment efficiency, reduces reliance on operational experience, and can adapt to the rapid response requirements of flexible production. Attached Figure Description

[0012] To more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings used in the following description of the embodiments will be briefly introduced. Obviously, the drawings described below are some embodiments of the present invention. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0013] Figure 1 A flowchart of the spatial tracking robot trajectory programming method provided by the present invention; Figure 2 This is a first sub-flowchart of the spatial tracking robot trajectory programming method provided by the present invention; Figure 3 This is a second sub-flowchart of the spatial tracking robot trajectory programming method provided by the present invention; Figure 4 The third sub-flowchart of the spatial tracking robot trajectory programming method provided by the present invention; Figure 5 The fourth sub-flowchart of the trajectory programming method for spatial tracking robots provided by the present invention; Figure 6 The fifth sub-flowchart of the trajectory programming method for spatial tracking robots provided by the present invention; Figure 7 The sixth sub-flowchart of the trajectory programming method for spatial tracking robots provided by the present invention; Figure 8 A schematic block diagram of a unit of the spatial tracking robot trajectory programming device provided by the present invention; Figure 9 A schematic block diagram of a computer device provided for an embodiment of the present invention. Detailed Implementation

[0014] The technical solutions of the embodiments of the present 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 the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of the present invention.

[0015] It should be understood that, when used in this specification and the appended claims, the terms "comprising" and "including" indicate the presence of the described features, integrals, steps, operations, elements and / or components, but do not exclude the presence or addition of one or more other features, integrals, steps, operations, elements, components and / or collections thereof.

[0016] It should also be understood that the terminology used in this specification is for the purpose of describing embodiments only and is not intended to limit the invention. As used in this specification and the appended claims, the singular forms “a,” “an,” and “the” are intended to include the plural forms unless the context clearly indicates otherwise.

[0017] It should also be further understood that the term "and / or" as used in this specification and the appended claims refers to any combination of one or more of the associated listed items and all possible combinations, and includes such combinations.

[0018] This invention addresses the technical problem of low efficiency and long cycles in programming complex trajectories, which relies on manual point-to-point online teaching or high-precision offline modeling in existing robot teaching and programming methods, making it difficult to adapt to the rapid response requirements of flexible production. It discloses a trajectory programming method for spatial tracking robots. This method is applied to a spatial tracking robot trajectory programming system. The spatial tracking robot trajectory programming system includes a hardware acquisition layer, a data processing layer, an application service layer, and an execution control layer. The hardware acquisition layer includes a spatial tracking device, an industrial robot body, a robot controller, and a host computer. The spatial tracking device includes a tracker and a positioning base station. The tracker outputs six-degree-of-freedom pose data, and the positioning base station provides spatial positioning reference for the tracker. The industrial robot body and the robot controller constitute the execution mechanism of the target robot. The host computer is an industrial computer running data acquisition programs, data processing programs, 3D visualization programs, a program generation engine, and communication service programs, and is equipped with a persistent storage module.

[0019] Reference Figures 1 to 7 The spatial tracking robot trajectory programming method includes the following steps: S110. Collect the pose data of the operator demonstrating movement in space through a spatial tracking device, and initialize the environment. The pose data includes position data and posture data. S120. The pose data is standardized to obtain standardized trajectory data, and the standardized trajectory data is stored. S130. Generate a three-dimensional trajectory based on the standardized trajectory data and perform visualization verification to obtain verified trajectory data; S140. Based on the underlying control protocol type of the target robot, perform spatial transformation and attitude calculation on the verified trajectory data to generate the control program for the target robot; S150. The control program and the verified trajectory data are sent to the target robot through a preset communication protocol, and the target robot executes them to reproduce the motion trajectory demonstrated by the operator.

[0020] First, the spatial tracking device collects the operator's pose data during the demonstration of movement in space, and simultaneously initializes the environment. After the operator enters the work area wearing or holding the spatial tracking device, the system responds to the origin setting command, setting the spatial coordinates of the spatial tracking device as the teaching origin and establishing a local reference coordinate system. During the operator's continuous spatial demonstration along the desired path, the spatial tracking device outputs six-degree-of-freedom pose data containing position and attitude data in real time. The computer control system reads the pose data stream cyclically through the underlying driver interface and performs moving average filtering on the raw data stream to eliminate high-frequency jitter noise, outputting a smooth initial pose sequence as the basis for subsequent processing.

[0021] The acquired pose data then enters the standardization process. The standardization module first converts the position data in the pose data from the metric units defaulted to by the spatial tracking device to the millimeter units commonly used in robot control. It then performs coordinate axis mapping according to the axial definition rules of the target robot's base coordinate system to ensure consistent spatial orientation. For the attitude data within the pose data, the system performs angle standardization, converting the original Euler angle sequence into a unified rotation matrix representation, eliminating differences in output formats between different tracking devices. After completing unit conversion, axial mapping, and angle standardization, the system combines the position and attitude data point by point into standardized trajectory points, forming standardized trajectory data. This standardized trajectory data is preferentially written to a circular buffer queue in computer memory. When the accumulated data in the buffer queue reaches a preset threshold or the buffer time reaches a set time limit, the system automatically triggers a batch write operation, persistently storing the entire batch of standardized trajectory data to a relational database at once, achieving efficient data persistence.

[0022] After persistent storage is completed, the system generates a 3D trajectory based on the standardized trajectory data and performs visual verification. The visual verification module automatically reads the standardized trajectory data from the relational database and reconstructs the motion path in time series in the 3D graphics rendering interface. The 3D graphics rendering interface reads the latest standardized trajectory points in the buffer queue at a fixed refresh cycle lower than the data acquisition frequency, achieving smooth trajectory animation preview and spatial attitude indication. Operators can visually check whether the continuity, curvature change, and attitude orientation of the trajectory curve meet the process requirements through the 3D graphics rendering interface. For jittery or erroneous trajectory segments generated during the demonstration, operators can directly perform trajectory editing operations in the 3D graphics rendering interface. The system responds with a deletion command and removes the corresponding abnormal trajectory segment data. After the abnormal data is cleaned up, the system confirms the remaining complete standardized trajectory data as verified trajectory data, providing a highly reliable data source for subsequent code generation.

[0023] After obtaining the verified trajectory data, the system performs spatial transformation and attitude calculation on the verified trajectory data according to the target robot's underlying control protocol type, generating the target robot's control program. The spatial transformation process uses pre-calibrated rotation matrices and translation vectors to map the position data in the verified trajectory data from the spatial tracking coordinate system to the target robot's base coordinate system. The attitude calculation process converts the original Euler angles in the verified trajectory data into a first rotation matrix, and calculates the target rotation matrix using the calibrated rotation matrix. The calculation formula is as follows: in Represents the target rotation matrix. Indicates the calibration rotation matrix. This represents the first rotation matrix obtained from the original Euler angles. The system further identifies the attitude representation format supported by the underlying control protocol type of the target robot. If the protocol supports the rotation vector format, the target rotation matrix is ​​converted into an axis-angle form rotation vector using the Rodrigues formula; if the protocol supports the quaternion format, a matrix-to-quaternion mapping conversion is performed, and a singular value detection mechanism is introduced during the conversion process to avoid gimbal deadlock. After completing the attitude representation format conversion, the system combines the target position data in the robot's base coordinate system with the standardized target attitude data to form the target pose data, and automatically fills in the motion command parameters according to the code template and parameter mapping rules built into the underlying control protocol type, generating a control program that conforms to the target robot's syntax specifications.

[0024] After the control program is generated, the system sends the control program or verified trajectory data to the target robot via a preset communication protocol. For target robots that support file import, the system directly encapsulates the control program into a standard program file and uploads it to the target robot controller via a file transfer protocol or offline simulation software interface. For target robots that only support streaming command reception, the system uses a state machine-based bidirectional handshake communication protocol. The host computer establishes a network service port and listens for connection requests. After the target robot client initiates a connection, it sends a start request signal. The host computer replies with a ready confirmation signal and enters the streaming transmission state. The host computer splits the verified trajectory data or control program into independent data blocks and adds them to the transmission queue, sending the data blocks to the target robot one by one. After successfully parsing and loading the current data block, the target robot controller returns a reception confirmation signal. If the host computer does not receive a signal before the confirmation timeout, it triggers a retransmission mechanism. After all data blocks have been transmitted, the host computer sends a stop signal. The target robot controller loads the complete instruction sequence and drives the robotic arm end effector to reproduce the motion trajectory demonstrated by the operator.

[0025] In summary, the spatial tracking robot trajectory programming method of this invention continuously captures the pose data of the operator's spatial demonstration using a spatial tracking device, replacing the traditional manual point-to-point teaching and high-precision offline modeling process. Standardized processing and a memory-buffered batch storage mechanism effectively decouple high-frequency data acquisition from underlying storage overhead. Three-dimensional visualization verification provides intuitive trajectory error correction capabilities. Spatial transformation and attitude calculation algorithms overcome the mathematical barriers between heterogeneous robot control protocols, and a pre-defined communication protocol ensures the timing reliability of command issuance. This spatial tracking robot trajectory programming method achieves end-to-end automated mapping from intuitive human spatial actions to the robot's underlying executable code, significantly shortening the programming cycle for complex trajectories, reducing reliance on operator expertise, eliminating the risk of pose deviation between the model and the real-world scenario, and meeting the process requirements of rapid line changeover and agile deployment in flexible production scenarios.

[0026] In one embodiment, step S110 includes: S111. In response to the origin setting operation, the position coordinates corresponding to the current pose of the spatial tracking device are set as the teaching origin. S112. During the operator's demonstration of movement, the six-degree-of-freedom pose data output by the spatial tracking device is read to obtain the initial pose sequence; S113. Filter the initial pose sequence to obtain a filtered pose sequence; S114. Generate the pose data based on the filtered pose sequence; S115. Obtain the calibration parameters between the spatial tracking coordinate system and the robot base coordinate system of the target robot, wherein the calibration parameters include the rotation matrix and the translation vector.

[0027] The operator initiates the data acquisition program on the host computer. This program calls the underlying driver interface of the spatial tracking device to establish a data communication link between the host computer and the device. Before formally teaching the trajectory, the operator places the tracker in the spatial tracking device at the desired reference origin and triggers a "set origin" command on the host computer interface. The data acquisition program responds to the origin setting operation, reads the 3D position coordinates output by the tracker at that moment, and sets these coordinates as the teaching origin, i.e., the zero point coordinates of the local reference system (0, 0, 0). Simultaneously, the program records the tracker's current attitude angle as the reference attitude. All subsequent position data is expressed based on the teaching origin, and attitude data is expressed based on the reference attitude. The significance of the origin setting operation is to zero out the starting position of the trajectory, providing a clear starting point reference for subsequently acquired trajectory data, facilitating subsequent trajectory editing, visualization verification, and spatial transformation.

[0028] After setting the origin, the operator holds the tracker or wears it on their wrist, the end of a tool, or other parts of the device, and demonstrates the movement in space according to the desired trajectory. During the demonstration, the data acquisition program continuously reads the six-DOF pose data output by the spatial tracking device at a preset acquisition frequency. The six-DOF pose data includes three position components (X-axis, Y-axis, and Z-axis coordinates) and three attitude components (yaw, pitch, and roll angles), representing the tracker's position and orientation in space, respectively. The data acquisition program appends each frame of six-DOF pose data, along with a timestamp, sequentially to the initial pose sequence. This initial pose sequence records the tracker's position and attitude at each moment during the operator's demonstration, in chronological order.

[0029] Due to unavoidable hand tremors during operator demonstrations using the hand tracker, and the inherent measurement noise in the spatial tracking device, the initial pose sequence contains high-frequency noise components. Without suppressing this high-frequency noise, the subsequently generated trajectory will exhibit unnecessary jagged fluctuations, affecting the smoothness of the robot's execution. The data acquisition program performs filtering on the initial pose sequence, applying a moving average filter to each coordinate component of the position data and each angle component of the attitude data, taking the average of the current frame and several preceding frames as the filtered output value for the current frame. After filtering, the high-frequency jitter in the initial pose sequence is effectively suppressed, resulting in a smooth filtered pose sequence. The filtered pose sequence retains the overall trend and key features of the operator's demonstrated motion while eliminating local abrupt changes caused by hand tremors and measurement noise. The data acquisition program generates the final pose data based on the filtered pose sequence. The position data in the pose data represents the offset relative to the teaching origin, and the attitude data represents the offset relative to the reference attitude.

[0030] Another core aspect of environment initialization is obtaining the calibration parameters between the spatial tracking coordinate system and the target robot's base coordinate system. The spatial tracking coordinate system is defined by the tracking device itself, while the robot base coordinate system is defined by the target robot. There are typically rotational and translational deviations between them. The operator controls a teaching pendant equipped with a tracker or the end effector of the target robot to sequentially reach multiple calibration points. There must be at least three calibration points, and they must be non-collinear to ensure a unique solution for the rigid body transformation. For each calibration point, the system records its first coordinate in the spatial tracking coordinate system and its second coordinate in the robot base coordinate system. After obtaining the corresponding coordinates of all calibration points, the system calculates the rotation matrix and translation vector using a rigid body transformation algorithm based on the correspondence between the first and second coordinates to obtain the calibration parameters. The rotation matrix is ​​a 3×3 orthogonal matrix representing the rotational relationship between the two coordinate systems; the translation vector is a 3×1 column vector representing the positional offset of the origin of the spatial tracking coordinate system relative to the origin of the robot base coordinate system. Once the calibration parameters are acquired, they are stored in the host computer for subsequent spatial transformation and attitude calculation steps.

[0031] As can be seen from the above embodiments, this embodiment establishes a local reference system benchmark by setting the origin, obtains complete six-degree-of-freedom pose information by high-frequency reading, eliminates hand tremors and measurement noise by filtering, and establishes a precise mapping between the spatial tracking coordinate system and the robot base coordinate system by coordinate system calibration. This embodiment provides a high-quality raw data foundation for subsequent standardization processing, visualization verification, program generation, and communication distribution, and is a prerequisite for the realization of the entire spatial tracking robot trajectory programming method.

[0032] Furthermore, the steps in S115 include: S1151. Control the teaching tool equipped with the space tracking device or the end effector of the target robot to sequentially reach multiple calibration points; S1152. Obtain the first coordinates of the plurality of calibration points in the spatial tracking coordinate system, and the second coordinates of the plurality of calibration points in the robot base coordinate system; S1153. Solve for the rotation matrix and the translation vector based on the first coordinate and the second coordinate to obtain the calibration parameters.

[0033] The purpose of obtaining calibration parameters is to establish a precise mapping relationship between the spatial tracking coordinate system and the target robot's base coordinate system. Since the positioning base station of the spatial tracking device and the target robot are installed independently at the work site, there are usually rotational and translational deviations between the spatial tracking coordinate system and the robot's base coordinate system. If trajectory data in the spatial tracking coordinate system is used directly to control the target robot without calibration, it will result in positional and directional deviations between the trajectory executed by the target robot and the trajectory expected by the operator. Therefore, before formally teaching the trajectory, the system needs to complete coordinate system calibration to obtain calibration parameters.

[0034] The operator pre-arranges multiple calibration points in the workspace, with at least three points and ensuring that these points are not collinear to guarantee a unique solution for the rigid body transformation. Calibration points can be easily identifiable and accessible fixed locations within the workspace, such as fixed markers on the worktable, feature points on the workpiece, or specially designed calibration pins. The operator controls the end effector of the teaching pendant or target robot, equipped with a spatial tracking device, to sequentially reach each calibration point. When the teaching pendant or target robot's end effector reaches a calibration point, the spatial tracking device reads the tracker's three-dimensional position coordinates at that moment and records these coordinates as the first coordinate of the calibration point in the spatial tracking coordinate system. Simultaneously, the target robot's controller reads the end effector's three-dimensional position coordinates at that moment and records these coordinates as the second coordinate of the calibration point in the robot's base coordinate system. This process is repeated for all calibration points to obtain the corresponding coordinate pair for each calibration point in both coordinate systems.

[0035] After obtaining the coordinate pairs of all calibration points, the system solves for the rotation matrix and translation vector based on the correspondence between the first and second coordinates. Let the first coordinate of the i-th calibration point in the spatial tracking coordinate system be... The second coordinate in the robot's base coordinate system is If the total number of calibration points is N, then the calibration problem is transformed into solving for the rotation matrix R and translation vector T that satisfy the following relationship: The solution process consists of three steps. First, the mean points of all first coordinates and all second coordinates are calculated, and each set of coordinates is subtracted from its mean point to obtain a decentralized coordinate sequence. Second, a 3×3 covariance matrix is ​​constructed based on the decentralized coordinate sequence, and singular value decomposition is performed on the covariance matrix. The rotation matrix R is then calculated from the decomposition results. Third, the rotation matrix R is substituted into the mean point relation to calculate the translation vector T. When the number of calibration points is greater than three, the system uses the least squares method to perform a global optimization solution for all coordinate pairs, ensuring that the rotation matrix R and translation vector T optimally fit the correspondence of all calibration points with minimal error.

[0036] After the solution is completed, the system verifies the calibration results. The operator controls the teaching pendant or the end effector of the target robot to reach a verification point that was not calibrated. The system uses the obtained rotation matrix R and translation vector T to transform the coordinates of the verification point in the spatial tracking coordinate system to the robot's base coordinate system, and compares the transformation result with the coordinates of the verification point in the robot's base coordinate system directly read by the target robot controller. If the deviation between the two is less than a preset threshold, the calibration is considered successful, and the rotation matrix R and translation vector T are stored as calibration parameters in the host computer for subsequent spatial transformation and attitude calculation steps. If the deviation exceeds the preset threshold, the operator is prompted to re-execute the calibration operation.

[0037] Through the above multi-point calibration method, the system can establish a precise mapping between the spatial tracking coordinate system and the robot base coordinate system without relying on external high-precision measurement equipment, providing a mathematical basis for the subsequent accurate conversion of the trajectory data demonstrated by the operator to the robot base coordinate system of the target robot.

[0038] In one embodiment, step S120 includes: S121. Convert the position data in the pose data from the output unit of the spatial tracking device to a general robot control unit; S122. Perform coordinate axis mapping on the position data according to the axial definition of the robot base coordinate system; S123. Standardize the angle of the pose data in the pose data; S124. Combine the position data after unit conversion and coordinate axis mapping with the attitude data after angle standardization to form standardized trajectory points, thereby obtaining the standardized trajectory data; S125. Write the standardized trajectory points into the memory buffer; S126. When the standardized trajectory points in the memory buffer meet the preset writing conditions, the standardized trajectory points in the memory buffer are written in batches to the persistent storage module.

[0039] After the data acquisition program generates pose data, it transmits the pose data to the data processing module in the host computer. The data processing module performs standardization processing on the pose data. The purpose of standardization is to convert the raw data output by the spatial tracking device into a unified intermediate data format that is independent of specific robot brands, so that subsequent program generation stages can adapt to target robots with different underlying control protocol types based on a unified format.

[0040] The first step in standardization is unit conversion. Position data output by spatial tracking devices is in meters, while industrial robot control commonly uses millimeters to express position coordinates. The data processing module multiplies the X, Y, and Z coordinates of the position data in the pose data by 1000 each, converting the unit from meters to millimeters. For example, an X-axis coordinate output by the spatial tracking device of 0.152 meters becomes 152 millimeters after unit conversion.

[0041] The second step in standardization is coordinate axis mapping. The coordinate system definition of the spatial tracking device may differ from that of the target robot's base coordinate system. For example, the spatial tracking device's coordinate system uses the Y-axis as the vertically upward direction, while some industrial robots use the Z-axis as the vertically upward direction. The data processing module performs coordinate axis mapping on the position data according to the axial definition of the robot's base coordinate system. The essence of coordinate axis mapping is to rearrange and adjust the signs of the three-dimensional coordinate components so that the mapped coordinate axis directions are consistent with those of the robot's base coordinate system. For example, when it is necessary to convert a Y-axis-up coordinate system to a Z-axis-up coordinate system, the mapping rule is: the X-axis of the robot's base coordinate system corresponds to the X-axis of the spatial tracking coordinate system, the Y-axis of the robot's base coordinate system corresponds to the negative Z-axis of the spatial tracking coordinate system, and the Z-axis of the robot's base coordinate system corresponds to the Y-axis of the spatial tracking coordinate system.

[0042] The third step in the standardization process is angle standardization. The data processing module performs angle standardization on the attitude data in the pose data, including unifying the yaw, pitch, and roll angles to a specified range (e.g., -180° to +180°), and adjusting the rotation sequence according to the target robot's attitude expression habits. After angle standardization, the attitude data is expressed in a unified degree system.

[0043] After completing the above three steps, the data processing module combines the position data (after unit conversion and coordinate axis mapping) with the attitude data (after angle standardization) to form standardized trajectory points. Each standardized trajectory point includes a timestamp, X-axis millimeter coordinates, Y-axis millimeter coordinates, Z-axis millimeter coordinates, yaw angle, pitch angle, roll angle, and target robot type identifier. Multiple standardized trajectory points are arranged in chronological order to form standardized trajectory data.

[0044] To address system performance issues arising from high-frequency data acquisition, the data processing module employs a memory buffer and batch write mechanism. After standardized trajectory points are generated, they are first temporarily stored in a memory buffer set in the host computer's memory, rather than immediately being written to the database. When the number of standardized trajectory points in the memory buffer reaches a preset write threshold, the data processing module triggers a batch write operation, writing all standardized trajectory points in the memory buffer to the persistent storage module at once. In this embodiment, the persistent storage module is a relational database, and the preset write threshold is 100 standardized trajectory points. After the batch write is completed, the memory buffer is cleared, and new standardized trajectory points are received again.

[0045] By employing memory buffering and batch write mechanisms, data acquisition and data persistence are decoupled, avoiding the pressure on database I / O caused by high-frequency data streams. If a database write is performed for every frame of data acquired, at a 50Hz acquisition frequency, 50 independent database write operations will occur per second, significantly increasing system latency due to frequent I / O calls. With batch writes, a write operation is performed only after accumulating 100 standardized trajectory points, reducing the database write frequency to less than once per second. This significantly improves system response speed while ensuring the complete and persistent storage of standardized trajectory data.

[0046] Furthermore, S125 also includes: S127. Read the standardized trajectory points from the memory buffer at a refresh frequency lower than the frequency at which the spatial tracking device outputs the pose data; S128. Display the trajectory in real time in the three-dimensional visualization interface based on the read standardized trajectory points.

[0047] After the standardized trajectory points are written to the memory buffer, the interface refresh module in the host computer reads the standardized trajectory points from the memory buffer at a refresh rate lower than the frequency at which the spatial tracking device outputs pose data. The frequency at which the spatial tracking device outputs pose data is the data acquisition frequency, which is 50Hz in this embodiment, meaning 50 frames of pose data are generated per second. The refresh rate of the interface refresh module is set to a fixed value lower than the data acquisition frequency, such as 10Hz, meaning the interface refresh module reads the latest standardized trajectory points from the memory buffer every 100 milliseconds. The interface refresh module does not perform any interface rendering operations between two refreshes, but instead waits for new standardized trajectory points to accumulate in the memory buffer.

[0048] The interface refresh module displays the trajectory in real time on the 3D visualization interface based on the read standardized trajectory points. Specifically, the interface refresh module reads all standardized trajectory points newly written since the last refresh from the memory buffer, maps the position coordinates of the standardized trajectory points to the 3D view space, and draws the trajectory curve by connecting adjacent trajectory points with line segments. As the operator continues to demonstrate movement, new standardized trajectory points are continuously written to the memory buffer. In each refresh cycle, the interface refresh module appends the newly added trajectory points to the trajectory curve in the 3D view, continuously extending the displayed range of the trajectory. The operator can observe the trajectory generation process in real time through the 3D visualization interface and intuitively judge whether the movement demonstrated by the operator meets expectations.

[0049] When rendering the trajectory, the interface refresh module simultaneously distinguishes between confirmed trajectory segments and those being generated using different colors or line types, making it easier for the operator to identify the current acquisition progress. Furthermore, the interface refresh module synchronously displays the position marker of the teaching origin and the real-time position indicator of the current tracker in the 3D visualization interface, allowing the operator to intuitively perceive the spatial relationship between the current acquisition position and the starting reference point.

[0050] The core purpose of using a refresh rate lower than the data acquisition frequency for interface display is to decouple data acquisition from interface rendering. Spatial tracking devices continuously output pose data at a high frequency. If the interface refresh rate matches the data acquisition frequency, the graphical interface needs to perform rendering operations immediately upon the arrival of each data frame. Under high-frequency acquisition conditions, frequent rendering calls significantly increase the computational overhead of the graphical interface, resulting in interface stuttering, response delays, or even program freezes, severely impacting the user experience. By reducing the refresh rate, the interface refresh module accumulates multiple frames of standardized trajectory points between refreshes, rendering all accumulated data at once with each refresh, significantly reducing the number of rendering calls. This low-frequency display strategy, while ensuring a smooth and natural visual trajectory animation for the operator, greatly reduces the computational overhead of the graphical interface. This allows the host computer to maintain millisecond-level interface responsiveness even during high-frequency data acquisition, avoiding the impact of excessive computational resources consumed by interface rendering on the real-time performance of data acquisition and buffer writing.

[0051] In one embodiment, step S130 includes: S131. Read the standardized trajectory data from the persistent storage module; S132. Generate a three-dimensional trajectory curve and attitude indication based on the standardized trajectory data; S133. Responding to the trajectory editing operation, perform deletion processing on the abnormal trajectory segments in the three-dimensional trajectory curve; S134. After the abnormal trajectory segment is processed, the processed standardized trajectory data is determined as the verified trajectory data.

[0052] The operator starts the 3D visualization verification program on the host computer. The 3D visualization verification program reads standardized trajectory data from the persistent storage module. During the reading process, the 3D visualization verification program loads all standardized trajectory points in timestamp order and parses the position coordinates, attitude angles, and target robot type identifiers of the standardized trajectory points into memory, preparing the data for subsequent 3D rendering and interactive editing.

[0053] The 3D visualization verification program generates 3D trajectory curves and attitude indicators based on standardized trajectory data. Specifically, it maps the X-axis, Y-axis, and Z-axis millimeter coordinates of each standardized trajectory point in the standardized trajectory data to a 3D view space, connecting adjacent standardized trajectory points sequentially with line segments to draw a complete 3D trajectory curve. Simultaneously, based on the yaw, pitch, and roll angles of each standardized trajectory point, the program renders attitude indicators on the 3D trajectory curve using arrows or three-axis coordinate icons, allowing the operator to intuitively observe the tool orientation at each point on the trajectory. The program supports trajectory animation playback. After initiating playback, the program highlights each standardized trajectory point sequentially according to timestamps, simulating the actual execution process of the trajectory. By observing the trajectory animation, the operator can judge whether the shape, direction, transition smoothness, and attitude changes of the trajectory meet expectations.

[0054] If the operator discovers abnormal segments in the trajectory during the visualization verification process, they can perform trajectory editing via the host computer interface. Typical examples of abnormal trajectory segments include: abrupt changes caused by accidental hand movements, jumps caused by temporary signal loss from the spatial tracking device, and dense, redundant point segments caused by operator pauses. The operator selects the range of standardized trajectory points corresponding to the abnormal trajectory segment in the 3D visualization interface and triggers a deletion command. The 3D visualization verification program responds to the trajectory editing operation by removing the standardized trajectory points corresponding to the abnormal trajectory segment from the trajectory data. After deletion, the 3D visualization verification program performs smooth transition processing on adjacent standardized trajectory points before and after the deletion location, ensuring a continuous transition of the trajectory curve at the deletion boundary and avoiding trajectory breaks or sharp corners caused by direct deletion. The operator then replays the processed trajectory to confirm that the trajectory shape meets expectations.

[0055] After processing the abnormal trajectory segments, the operator confirms the trajectory is correct and triggers a verification pass command. In response to the verification pass command, the 3D visualization verification program identifies the processed standardized trajectory data as the verified trajectory data. The verified trajectory data contains only valid standardized trajectory points confirmed by the operator, with all data corresponding to abnormal trajectory segments removed. The verified trajectory data serves as input for subsequent spatial transformation and attitude calculation steps, entering the control program generation stage.

[0056] Through the 3D visualization verification process, the operator can confirm the trajectory quality before the control program is generated and distributed. Abnormal data introduced by acquisition noise, operational errors or signal interference in the trajectory is eliminated at the source. This avoids the repeated debugging process of discovering errors and having to stop and re-teach after abnormal trajectories are directly distributed to the target robot, which significantly shortens the deployment cycle from trajectory planning to robot execution.

[0057] In one embodiment, step S140 includes: S141. Based on the rotation matrix and translation vector in the calibration parameters, transform the position data in the verified trajectory data from the spatial tracking coordinate system to the robot base coordinate system to obtain the target position data; S142. Perform attitude calculation based on the rotation matrix in the calibration parameters and the attitude data in the verified trajectory data to obtain the target attitude data; S143. Combine the target position data and the target attitude data into target pose data; S144. Perform instruction conversion on the target pose data according to the underlying control protocol type of the target robot to obtain the motion command of the target robot; S145. Generate the control program according to the motion command.

[0058] After the 3D visualization verification program outputs the verified trajectory data, the program generation engine in the host computer reads the verified trajectory data and performs spatial transformation and attitude calculation on the verified trajectory data according to the underlying control protocol type of the target robot selected by the operator, and finally generates the control program of the target robot.

[0059] The program generation engine first performs a spatial transformation on the verified trajectory data. The purpose of the spatial transformation is to convert the position data in the verified trajectory data from the spatial tracking coordinate system to the target robot's robot base coordinate system. Let the position coordinates of a certain trajectory point in the verified trajectory data in the spatial tracking coordinate system be... If the rotation matrix in the calibration parameters is R and the translation vector is T, then the target position coordinates of the trajectory point in the robot's base coordinate system are... Calculated using the following formula: The rotation matrix R is a 3×3 orthogonal matrix that represents the rotational relationship between the spatial tracking coordinate system and the robot base coordinate system; the translation vector T is a 3×1 column vector that represents the positional offset of the origin of the spatial tracking coordinate system relative to the origin of the robot base coordinate system.

[0060] The program generation engine traverses all trajectory points in the verified trajectory data, performs the above spatial transformation operation point by point, and obtains the target position data of all trajectory points in the robot's base coordinate system.

[0061] The program generation engine then performs attitude calculations on the validated trajectory data. The purpose of attitude calculation is to convert the attitude data in the validated trajectory data from the attitude representation in the spatial tracking coordinate system to the attitude representation in the target robot's robot base coordinate system. The first step of attitude calculation is to convert the Euler angles (yaw, pitch, roll) contained in the attitude data in the validated trajectory data into a first rotation matrix. The second step in attitude calculation is to combine the rotation matrix R in the calibration parameters with the first rotation matrix. Calculate the target rotation matrix : The program generation engine traverses all trajectory points in the verified trajectory data, performs the above attitude calculation operation point by point, and obtains the target attitude data of all trajectory points in the robot base coordinate system.

[0062] After spatial transformation and attitude calculation, the program generation engine combines the target position data and target attitude data into target pose data. Each point in the target pose data contains three-dimensional position coordinates and a corresponding attitude representation in the robot's base coordinate system.

[0063] The program generation engine performs instruction conversion on the target robot's pose data based on the target robot's underlying control protocol type. The underlying control protocol type determines the program syntax structure, posture representation format, and motion parameter definitions accepted by the target robot controller. The program generation engine determines the instruction template and parameter mapping rules based on the underlying control protocol type, filling the position and posture data from the target pose data into the motion instructions according to the format requirements of the instruction template. During the instruction conversion process, the program generation engine also converts motion parameters such as velocity, acceleration, and turning radius according to the units and formats required by the underlying control protocol type. After completing the instruction conversion point by point, the program generation engine obtains the motion instruction sequence for the target robot.

[0064] The program generation engine performs syntax validation on the motion command sequence. After confirming that the format of all motion commands conforms to the syntax specifications of the underlying control protocol type, it encapsulates the motion command sequence according to the program structure required by the protocol to generate the control program for the target robot. The control program is saved to a designated directory on the host computer in a file format recognizable by the target robot controller for use in subsequent communication and distribution processes.

[0065] Through the aforementioned spatial transformation and attitude calculation, the verified trajectory data is accurately converted from the spatial tracking coordinate system to the robot base coordinate system, and the corresponding control program is automatically generated according to the underlying control protocol type of the target robot, realizing end-to-end automatic conversion from general trajectory data to specific robot executable programs.

[0066] Furthermore, step S142 includes: S1421. Convert the Euler angles contained in the attitude data in the verified trajectory data into a first rotation matrix; S1422. Calculate the target rotation matrix based on the rotation matrix in the calibration parameters and the first rotation matrix; S1423. Determine the attitude representation format supported by the underlying control protocol type; S1424. Convert the target rotation matrix into target attitude data corresponding to the attitude representation format, wherein the attitude representation format includes rotation vector, quaternion, Euler angle or attitude matrix.

[0067] When performing attitude calculation, the program generation engine first converts the Euler angles contained in the attitude data of the verified trajectory data into a first rotation matrix. The attitude data in the verified trajectory data is expressed in three angular components: yaw, pitch, and roll. Following the rotation order specified by the target robot's underlying control protocol, the program generation engine constructs basic rotation matrices around the corresponding coordinate axes for yaw, pitch, and roll in sequence, and then multiplies these three basic rotation matrices sequentially to obtain the first rotation matrix. First rotation matrix It is a 3×3 orthogonal matrix that fully expresses the attitude of the spatial tracking device at the trajectory point.

[0068] After obtaining the first rotation matrix, the program generation engine calculates the target rotation matrix based on the rotation matrix in the calibration parameters and the first rotation matrix, and transforms the posture expressed by the first rotation matrix from the spatial tracking coordinate system to the robot base coordinate system.

[0069] The program generation engine then determines the attitude representation format supported by the underlying control protocol type. Different brands and models of robot controllers define attitude data differently; some robot controllers use rotation vectors to represent attitude, some use quaternions, some use Euler angles with a specific rotation order, and some directly use attitude matrices. Based on the underlying control protocol type selected by the operator, the program generation engine queries the attitude representation formats supported by that protocol to determine the target format for subsequent conversion.

[0070] The program generation engine converts the target rotation matrix into target attitude data corresponding to the attitude representation format. Depending on the attitude representation format supported by the underlying control protocol, the conversion methods fall into the following categories: If the underlying control protocol type supports rotation vector representation, the program generation engine converts the target rotation matrix into axis-angle form using Rodrigues' rotation formula. The axis-angle form consists of a rotation axis and a rotation angle, where the rotation axis is a unit vector and the rotation angle is the angle of rotation about the rotation axis.

[0071] If the underlying control protocol type supports quaternion representation, the program generation engine will convert the target rotation matrix into quaternions. The four components of the quaternion are calculated from the elements of the target rotation matrix using standard transformation relations.

[0072] If the underlying control protocol type supports Euler angle representation, the program generation engine performs angle decomposition on the target rotation matrix according to the rotation order specified by the underlying control protocol type, obtaining three angle values ​​under the corresponding rotation order. During the angle decomposition process, the program generation engine sorts and adjusts the decomposition results to avoid gimbal deadlock issues.

[0073] If the underlying control protocol type supports attitude matrix representation, the program generation engine directly outputs the target rotation matrix as the target attitude data without performing additional format conversion.

[0074] After the aforementioned attitude format conversion, the program generation engine obtains target attitude data that conforms to the requirements of the underlying control protocol type. This target attitude data, combined with the target position data obtained in the aforementioned spatial transformation stage, constitutes complete target pose data, which is then used in subsequent command conversion and control program generation stages.

[0075] Through the above attitude calculation process, the attitude information in the verified trajectory data is expressed from Euler angles in the spatial tracking coordinate system. After coordinate system transformation and format conversion, it is finally accurately mapped to the attitude representation format supported by the underlying control protocol of the target robot, ensuring that the target robot can correctly parse and execute the tool orientation demonstrated by the operator.

[0076] Furthermore, step S144 includes: S1441. Determine the instruction template and parameter mapping rules according to the underlying control protocol type; S1442. Determine the participation mode of position data and attitude data in the target pose data according to the trajectory reproduction mode. The trajectory reproduction mode includes a full six-degree-of-freedom reproduction mode and a position following and attitude constraint mode. S1443. In the full six-degree-of-freedom reproduction mode, both the position data and attitude data in the target pose data are used to generate the motion command. S1444. In the position following and attitude constraint mode, the position data in the target pose data is extracted to participate in the generation of the motion command, and the attitude data in the target pose data is constrained by one of fixed attitude, key point attitude or controller interpolation attitude. S1445. According to the instruction template and the parameter mapping rules, the target pose data is converted into motion instructions for the target robot.

[0077] After completing spatial transformation and attitude calculation to obtain the target pose data, the program generation engine enters the command conversion stage. This stage determines the command template and parameter mapping rules based on the target robot's underlying control protocol type, and determines the participation method of position and attitude data in the target pose data according to the trajectory reproduction mode. Finally, it converts the target pose data into motion commands for the target robot.

[0078] The program generation engine determines the instruction template and parameter mapping rules based on the underlying control protocol type. The instruction template is the syntactic structure of a single motion instruction received by the target robot controller, including the instruction name, parameter list, parameter order, and separators. Instruction templates differ for different underlying control protocol types; the program generation engine has multiple built-in instruction templates and calls the corresponding template based on the underlying control protocol type selected by the operator. The parameter mapping rules define the correspondence between each parameter in the target pose data and each field in the instruction template, including the order of position parameters, the expression format of attitude parameters, the unit and range of velocity parameters, the unit and range of acceleration parameters, the definition method of turning zone parameters, and the referencing method of tool coordinate parameters.

[0079] The program generation engine determines the participation method of position and attitude data in the target pose data based on the trajectory reproduction mode. The trajectory reproduction modes include a full six-degree-of-freedom reproduction mode and a position following and attitude constraint mode. The operator selects one of the modes in the host computer interface according to the actual process requirements.

[0080] In the full six-DOF reproduction mode, the program generation engine incorporates both position and attitude data from the target pose data into the generation of motion commands. The engine iterates through every point in the target pose data, fully filling the command template with the 3D coordinates from the position data and the attitude representation from the attitude data, generating motion commands containing complete position and attitude parameters. The full six-DOF reproduction mode is suitable for processes such as welding, precision assembly, and gluing, where tool orientation is critical. During execution, the target robot strictly adheres to the position and attitude of each point, completely reproducing the six-DOF trajectory demonstrated by the operator.

[0081] In position following and attitude constraint mode, the program generation engine only extracts position data from the target pose data to participate in the generation of motion commands, and performs constraint processing on the attitude data in the target pose data. Constraint processing methods include three types: fixed attitude, keypoint attitude, and controller interpolation attitude. The operator selects one according to process requirements. Fixed attitude means all points use a uniform tool orientation; the program generation engine fills the attitude field of each motion command with preset fixed attitude parameters. Keypoint attitude means the operator marks several key points during the visualization verification stage; the program generation engine only fills in the corresponding attitude parameters at the key points, leaving the attitude fields of non-key points blank or marked as interpolation mode, with the interpolation algorithm inside the target robot controller smoothly transitioning between adjacent key points. Controller interpolation attitude means the program generation engine only fills in attitude parameters at the start and end points of the trajectory; the attitude of all intermediate points is automatically calculated by the target robot controller. Position following and posture constraint mode is suitable for process scenarios such as material handling, simple outlining, and cleaning operations that are not sensitive to tool orientation or allow fixed orientation. By ignoring the slight jitter of the operator's posture during the demonstration, it improves the stability of the target robot's execution.

[0082] The program generation engine converts the target pose data point by point into motion commands for the target robot according to the instruction template and parameter mapping rules. During the conversion process, the engine performs unit conversion and format adaptation for velocity, acceleration, and turning parameters according to the parameter mapping rules. After all motion commands are generated, the engine encapsulates the sequence of motion commands into a control program for the target robot.

[0083] In one embodiment, after the control program is generated, the system sends the control program and / or verified trajectory data to the target robot via a preset communication protocol. Depending on the target robot's underlying control protocol type and on-site deployment conditions, the sending method is divided into a program file sending mode and a point-to-point sending mode.

[0084] In program file distribution mode, the program generation engine encapsulates the control program into a program file based on the underlying control protocol type. The format of the program file is consistent with the file format supported by the target robot controller. After encapsulation, the host computer sends the program file to the target robot or a simulation device connected to the target robot via a file transfer protocol. File transfer methods include direct transmission to the target robot controller's file system via network protocol, copying the program file to the target robot controller via a universal serial bus interface, or importing the program file into the target robot controller's virtual system via the target robot's offline programming and simulation software. The target robot responds to the operator's loading operation of the program file, parses the motion instruction sequence in the program file, and automatically executes it according to the set speed, acceleration, and turning radius parameters, reproducing the motion trajectory demonstrated by the operator.

[0085] In the point-to-point delivery mode, the default communication protocol is a state machine-based two-way handshake communication protocol. The host computer is configured as the server, and the target robot's robot controller is configured as the client. The host computer starts the communication service program and listens on the specified port. The target robot's robot controller runs the client script and establishes a communication connection with the host computer through the transmission control protocol.

[0086] After the communication connection is established, the host computer encapsulates the control program and / or verified trajectory data into multiple data blocks and adds them to the transmission queue. Each data block contains the position coordinates, attitude data, and motion parameters of one or a group of trajectory points. The operator triggers the start operation on the target robot's teach pendant, and the target robot sends a start request signal to the host computer. Upon receiving the start request signal, the host computer returns a ready confirmation signal to the target robot, indicating that the host computer has completed data preparation and the communication link is ready.

[0087] Subsequently, the host computer reads the current data block from the transmission queue and sends it to the target robot. Upon receiving the data block, the target robot parses it and executes the corresponding motion. After the current data block is completed, the target robot sends a reception confirmation signal back to the host computer. Upon receiving the confirmation signal, the host computer returns to the step of reading the current data block from the transmission queue and sends the next data block to the target robot. This process repeats until all data blocks in the transmission queue have been sent. After all data blocks have been sent, the host computer sends a stop signal to the target robot, notifying it that data transmission is complete. The target robot then completes its final motion and returns to standby mode.

[0088] The aforementioned state machine-based bidirectional handshake communication protocol ensures that each data block is correctly received and executed by the target robot before the next data block is sent through a block-by-block sending and block-by-block confirmation mechanism. This effectively prevents buffer overflow of the target robot caused by sending a large amount of data at once, avoids data out-of-order and packet loss problems, and guarantees the smoothness and continuity of complex trajectory movements.

[0089] If the host computer does not receive a reception confirmation signal from the target robot within the preset waiting time after sending the current data block, the preset confirmation timeout condition is met, and the host computer performs timeout processing. Timeout processing includes at least one of the following: retransmitting the current data block, pausing data block transmission, generating alarm information, or disconnecting the communication connection. After troubleshooting the communication fault based on the alarm information, the operator restarts the communication process. If it is necessary to repeat the same trajectory, the target robot sends a rerun request signal to the host computer. In response to the rerun request signal, the host computer reloads the data block from the transmission queue and executes the transmission process again, and the target robot reproduces the motion trajectory demonstrated by the operator.

[0090] Based on the above embodiments, it can be concluded that the spatial tracking robot trajectory programming method of the present invention can be widely applied in the industrial manufacturing field where trajectories are complex and variable, deployment cycles are sensitive, and tasks need to be switched quickly. The following uses two typical scenarios, small-batch multi-variety welding and large structural component gluing, as examples for illustration.

[0091] In small-batch, multi-variety welding scenarios, this method can be used for arc and laser welding of customized steel structural components, pressure vessels, or non-standard parts. These workpieces are diverse, produced in small batches, and have complex weld seam spatial orientations. Traditionally, each change of workpiece requires operators to re-teach point by point or rebuild the offline model, with the programming cycle often occupying a major portion of production preparation time. Using this method, the operator uses a handheld spatial tracking device to directly demonstrate the welding trajectory in the air along the weld seam. The system collects six-degree-of-freedom pose data in real time, eliminates hand tremors through moving average filtering, and after standardization, instantly presents the weld seam curve and welding torch posture in a 3D visualization interface. After the operator confirms the trajectory is correct, the system automatically performs spatial transformation and posture calculation according to the target robot's underlying control protocol type, generating a welding program containing the complete welding torch orientation in a full six-degree-of-freedom reproduction mode, and then sending it to the robot for execution point by point via state machine handshake communication. The entire process eliminates the need for building a 3D model and manual point-by-point teaching, reducing the programming time for complex spatial weld seams from several hours to minutes, effectively supporting the needs of flexible welding production lines for rapid switching between multiple product types.

[0092] In large-scale structural component adhesive application scenarios, this method can be applied to sealant coating operations on large curved surfaces such as wind turbine blades, automobile bodies, or rail transit components. These workpieces are large in size, have complex curved surfaces, numerous adhesive application path points, and strict process requirements regarding the angle relationship between the glue gun and the workpiece surface. Furthermore, the working environment contains glue mist and volatile gases, posing health risks to operators who are exposed to close proximity for extended periods. Using this method, the operator wears a spatial tracking device to demonstrate the adhesive application path near the workpiece surface. The system collects and persistently stores trajectory data in batches at high frequency, ensuring smooth response of the user interface through memory buffering and asynchronous refresh mechanisms. After the operator verifies the trajectory and trims abnormal segments in the 3D visualization interface, the system generates an adhesive application program using position following and attitude constraint modes. The glue gun maintains a fixed orientation perpendicular to the workpiece surface at key points, while intermediate points are smoothly interpolated by the robot controller, ensuring process consistency in the adhesive application angle and filtering out minor posture fluctuations during the demonstration. The generated program is transmitted to the target robot via file transfer or point-to-point streaming, allowing the operator to complete all programming work without entering the adhesive application area.

[0093] As can be seen from the above applications, the method of the present invention supports manufacturing scenarios with complex trajectories, frequent product switching, and limited operating environments, such as small-batch multi-variety welding and large curved surface gluing, and supports offline modeling-free, WYSIWYG teaching, automatic adaptation of multi-brand protocols, and stable and reliable program distribution. It has good practical value and development prospects.

[0094] Figure 8 This is a schematic block diagram of a trajectory programming device 600 for a spatial tracking robot provided in an embodiment of the present invention. Figure 8 As shown, corresponding to the above-described spatial tracking robot trajectory programming method, the present invention also provides a spatial tracking robot trajectory programming device 600. This spatial tracking robot trajectory programming device 600 includes a unit for executing the above-described spatial tracking robot trajectory programming method, and the device can be configured in terminals such as industrial computers, industrial PCs, workstations, and embedded controllers.

[0095] Specifically, please refer to Figure 8 The space tracking robot trajectory programming device 600 includes: The trajectory acquisition and initialization unit 610 is used to acquire the pose data of the operator demonstrating movement in space through the spatial tracking device and to initialize the environment. The pose data includes position data and attitude data. The standardized storage unit 620 is used to standardize the pose data to obtain standardized trajectory data and store the standardized trajectory data. The visualization verification unit 630 is used to generate a three-dimensional trajectory based on the standardized trajectory data and perform visualization verification to obtain verified trajectory data. The spatial transformation and program generation unit 640 is used to perform spatial transformation and attitude calculation on the verified trajectory data according to the underlying control protocol type of the target robot, and generate the control program of the target robot. The communication sending unit 650 is used to send the control program and the verified trajectory data to the target robot through a preset communication protocol, so that the target robot can execute the program to reproduce the motion trajectory demonstrated by the operator.

[0096] In one embodiment, the trajectory acquisition initialization unit 610 includes: The origin setting unit is used to respond to the origin setting operation and set the position coordinates corresponding to the current pose of the spatial tracking device as the teaching origin. The pose reading unit is used to read the six-degree-of-freedom pose data output by the spatial tracking device during the operator's demonstration of movement, and obtain the initial pose sequence. A filtering unit is used to filter the initial pose sequence to obtain a filtered pose sequence. A pose data generation unit is used to generate pose data based on the filtered pose sequence. The calibration parameter acquisition unit is used to acquire calibration parameters between the spatial tracking coordinate system and the robot base coordinate system of the target robot. The calibration parameters include a rotation matrix and a translation vector.

[0097] In one embodiment, the calibration parameter acquisition unit includes: The calibration point arrival unit is used to control the teaching tool equipped with the space tracking device or the end effector of the target robot to sequentially arrive at multiple calibration points; The coordinate acquisition unit is used to acquire the first coordinates of the plurality of calibration points in the spatial tracking coordinate system, and the second coordinates of the plurality of calibration points in the robot base coordinate system; The calibration parameter solving unit is used to solve the rotation matrix and the translation vector based on the first coordinate and the second coordinate to obtain the calibration parameters.

[0098] In one embodiment, the standardized storage unit 620 includes: A unit conversion unit is used to convert the position data in the pose data from the output unit of the spatial tracking device into a robot control general unit; A coordinate axis mapping unit is used to perform coordinate axis mapping on the position data according to the axial definition of the robot base coordinate system; An angle standardization unit is used to standardize the pose data in the pose data. The standardized trajectory point combination unit is used to combine position data after unit transformation and coordinate axis mapping with attitude data after angle standardization into standardized trajectory points to obtain the standardized trajectory data. A buffer writing unit is used to write the standardized trajectory points into a memory buffer; A batch persistence unit is used to write the standardized trajectory points in the memory buffer to the persistent storage module in batches when the standardized trajectory points in the memory buffer meet the preset write conditions. An asynchronous refresh and read unit is used to read the standardized trajectory points from the memory buffer at a refresh frequency lower than the frequency at which the spatial tracking device outputs the pose data; The real-time trajectory display unit is used to display the trajectory in a three-dimensional visualization interface in real time based on the read standardized trajectory points.

[0099] In one embodiment, the visualization verification unit 630 includes: A data reading unit is used to read the standardized trajectory data from the persistent storage module; A three-dimensional trajectory generation unit is used to generate a three-dimensional trajectory curve and attitude indication based on the standardized trajectory data; An abnormal trajectory deletion unit is used to respond to trajectory editing operations and perform deletion processing on abnormal trajectory segments in the three-dimensional trajectory curve; The verification data determination unit is used to determine the processed standardized trajectory data as the verified trajectory data after the abnormal trajectory segment has been processed.

[0100] In one embodiment, the spatial transformation and program generation unit 640 includes: The spatial transformation unit is used to transform the position data in the verified trajectory data from the spatial tracking coordinate system to the robot base coordinate system based on the rotation matrix and translation vector in the calibration parameters, so as to obtain the target position data. The attitude calculation unit is used to perform attitude calculation based on the rotation matrix in the calibration parameters and the attitude data in the verified trajectory data to obtain the target attitude data; A target pose combination unit is used to combine the target position data and the target pose data into target pose data; The instruction conversion unit is used to convert the target pose data into instructions according to the underlying control protocol type of the target robot, so as to obtain the motion instructions of the target robot. A control program generation unit is used to generate the control program based on the motion command.

[0101] In one embodiment, the attitude calculation unit includes: Euler angle transformation unit, used to convert the Euler angles contained in the attitude data in the verified trajectory data into a first rotation matrix; The target rotation matrix calculation unit is used to calculate the target rotation matrix based on the rotation matrix in the calibration parameters and the first rotation matrix. The attitude format determination unit is used to determine the attitude representation format supported by the underlying control protocol type. The attitude format conversion unit is used to convert the target rotation matrix into target attitude data corresponding to the attitude representation format, wherein the attitude representation format includes rotation vector, quaternion, Euler angle or attitude matrix.

[0102] In one embodiment, the instruction conversion unit includes: The template determination unit is used to determine the instruction template and parameter mapping rules according to the underlying control protocol type; The reproduction mode determination unit is used to determine the participation mode of position data and attitude data in the target pose data according to the trajectory reproduction mode. The trajectory reproduction mode includes a full six-degree-of-freedom reproduction mode and a position following and attitude constraint mode. The full reproduction processing unit is used to include both position data and attitude data in the target pose data in the generation of the motion command in the full six-degree-of-freedom reproduction mode. The position following processing unit is used to extract the position data from the target pose data in the position following and attitude constraint mode to participate in the generation of the motion command, and to perform constraint processing on the attitude data in the target pose data using one of fixed attitude, key point attitude or controller interpolation attitude. The instruction generation unit is used to convert the target pose data into motion instructions for the target robot according to the instruction template and the parameter mapping rules.

[0103] The aforementioned spatial tracking robot trajectory programming device 600 can be implemented as a computer program, which can be used in, for example... Figure 9 It runs on the computer device shown.

[0104] Please see Figure 9 , Figure 9 This is a schematic block diagram of a computer device 500 provided in an embodiment of this application. The computer device 500 can be a terminal or a server. The terminal can be an electronic device with data processing and communication functions, such as an industrial computer, industrial PC, workstation, or embedded controller. The server can be a standalone server or a server cluster composed of multiple servers.

[0105] See Figure 9The computer device 500 includes a processor 502, a memory, and a network interface 505 connected via a system bus 501. The memory may include a non-volatile storage medium 503 and internal memory 504.

[0106] The non-volatile storage medium 503 may store an operating system 5031 and a computer program 5032. The computer program 5032 includes program instructions that, when executed, cause the processor 502 to perform a spatial tracking robot trajectory programming method.

[0107] The processor 502 provides computing and control capabilities to support the operation of the entire computer device 500.

[0108] The internal memory 504 provides an environment for the operation of the computer program 5032 in the non-volatile storage medium 503. When the computer program 5032 is executed by the processor 502, the processor 502 can execute a spatial tracking robot trajectory programming method.

[0109] This network interface 505 is used for network communication with other devices. Those skilled in the art will understand that... Figure 9 The structure shown is merely a block diagram of a portion of the structure related to the present application and does not constitute a limitation on the computer device 500 to which the present application is applied. The specific computer device 500 may include more or fewer components than those shown in the figure, or combine certain components, or have different component arrangements.

[0110] The processor 502 is used to run a computer program 5032 stored in a memory to implement the steps of the above method.

[0111] It should be understood that in the embodiments of this application, the processor 502 may be a central processing unit (CPU), or it may be other general-purpose processors, digital signal processors (DSPs), application-specific integrated circuits (ASICs), field-programmable gate arrays (FPGAs), or other programmable logic devices, discrete gate or transistor logic devices, discrete hardware components, etc. The general-purpose processor may be a microprocessor or any conventional processor.

[0112] It will be understood by those skilled in the art that all or part of the processes in the methods of the above embodiments can be implemented by a computer program instructing related hardware. The computer program includes program instructions and can be stored in a storage medium, which is a computer-readable storage medium. The program instructions are executed by at least one processor in the computer system to implement the process steps of the embodiments of the above methods.

[0113] Therefore, the present invention also provides a storage medium. This storage medium can be a computer-readable storage medium. The storage medium stores a computer program, wherein the computer program includes program instructions. When executed by a processor, the program instructions cause the processor to perform the steps of the above-described method.

[0114] The storage medium can be any computer-readable storage medium capable of storing program code, such as a USB flash drive, portable hard drive, read-only memory (ROM), magnetic disk, or optical disk.

[0115] Those skilled in the art will recognize that the units and algorithm steps of the various examples described in conjunction with the embodiments disclosed herein can be implemented in electronic hardware, computer software, or a combination of both. To clearly illustrate the interchangeability of hardware and software, the components and steps of the various examples have been generally described in terms of functionality in the foregoing description. Whether these functions are implemented in hardware or software depends on the specific application and design constraints of the technical solution. Those skilled in the art can use different methods to implement the described functions for each specific application, but such implementations should not be considered beyond the scope of this invention.

[0116] In the several embodiments provided by this invention, it should be understood that the disclosed apparatus and methods can be implemented in other ways. For example, the apparatus embodiments described above are merely illustrative. For example, the division of each unit is only a logical functional division, and there may be other division methods in actual implementation. For example, multiple units or components may be combined or integrated into another system, or some features may be ignored or not executed.

[0117] The steps in the method of this invention can be adjusted, merged, or reduced in order according to actual needs. The units in the device of this invention can be merged, divided, or reduced according to actual needs. Furthermore, the functional units in the various embodiments of this invention can be integrated into one processing unit, or each unit can exist physically separately, or two or more units can be integrated into one unit.

[0118] If the integrated unit is implemented as a software functional unit and sold or used as an independent product, it can be stored in a storage medium. Based on this understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or all or 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, a terminal, or a network device, etc.) to execute all or part of the steps of the methods described in the various embodiments of the present invention.

[0119] It should be noted that any AI models, software tools, or components not belonging to this company appearing in the embodiments of this application are merely illustrative examples and do not represent actual use. All user personal information involved in the embodiments of this application has been authorized (with the knowledge and consent) by the relevant parties or has been fully authorized by all parties, and the executing entity may obtain it through various legal and compliant means. The collection, storage, use, processing, transmission, provision, and disclosure of the information, data, and signals involved all comply with relevant laws and regulations and do not violate public order and good morals.

[0120] The above description is merely a specific embodiment of the present invention, but the scope of protection of the present invention is not limited thereto. Any person skilled in the art can easily conceive of various equivalent modifications or substitutions within the technical scope disclosed in the present invention, and these modifications or substitutions should all be covered within the scope of protection of the present invention. Therefore, the scope of protection of the present invention should be determined by the scope of the claims.

Claims

1. A trajectory programming method for a spatial tracking robot, characterized in that, The method includes: The spatial tracking device collects the pose data of the operator when demonstrating movement in space and initializes the environment. The pose data includes position data and posture data. The pose data is standardized to obtain standardized trajectory data, and the standardized trajectory data is stored. Based on the standardized trajectory data, a three-dimensional trajectory is generated and visualized for verification, resulting in verified trajectory data; Based on the underlying control protocol type of the target robot, spatial transformation and attitude calculation are performed on the verified trajectory data to generate the control program for the target robot; The control program and the verified trajectory data are sent to the target robot via a preset communication protocol, and the target robot executes them to reproduce the motion trajectory demonstrated by the operator.

2. The spatial tracking robot trajectory programming method according to claim 1, characterized in that, The process of collecting pose data of the operator during a demonstration of movement in space using a spatial tracking device and initializing the environment includes: In response to the origin setting operation, the position coordinates corresponding to the current pose of the spatial tracking device are set as the teaching origin; During the operator's demonstration of movement, the six-degree-of-freedom pose data output by the spatial tracking device is read to obtain the initial pose sequence; The initial pose sequence is filtered to obtain a filtered pose sequence; The pose data is generated based on the filtered pose sequence; Obtain calibration parameters between the spatial tracking coordinate system and the robot base coordinate system of the target robot, the calibration parameters including rotation matrix and translation vector.

3. The spatial tracking robot trajectory programming method according to claim 2, characterized in that, The process of standardizing the pose data to obtain standardized trajectory data and storing the standardized trajectory data includes: The position data in the pose data is converted from the output unit of the spatial tracking device to a general unit for robot control. Based on the axial definition of the robot base coordinate system, coordinate axis mapping is performed on the position data; The pose data in the pose data is standardized by angle. The position data after unit transformation and coordinate axis mapping is combined with the attitude data after angle standardization to form standardized trajectory points, thus obtaining the standardized trajectory data; Write the standardized trajectory points into a memory buffer; When the standardized trajectory points in the memory buffer meet the preset writing conditions, the standardized trajectory points in the memory buffer are written in batches to the persistent storage module.

4. The spatial tracking robot trajectory programming method according to claim 3, characterized in that, The process of generating a three-dimensional trajectory based on the standardized trajectory data and performing visualization verification to obtain verified trajectory data includes: Read the standardized trajectory data from the persistent storage module; Generate a three-dimensional trajectory curve and attitude indication based on the standardized trajectory data; In response to trajectory editing operations, abnormal trajectory segments in the three-dimensional trajectory curve are deleted. After the abnormal trajectory segment is processed, the processed standardized trajectory data is determined as the verified trajectory data.

5. The spatial tracking robot trajectory programming method according to claim 2, characterized in that, The step of performing spatial transformation and attitude calculation on the verified trajectory data according to the underlying control protocol type of the target robot to generate the control program for the target robot includes: Based on the rotation matrix and translation vector in the calibration parameters, the position data in the verified trajectory data is transformed from the spatial tracking coordinate system to the robot base coordinate system to obtain the target position data; The attitude calculation is performed based on the rotation matrix in the calibration parameters and the attitude data in the verified trajectory data to obtain the target attitude data; The target position data and the target pose data are combined into target pose data; The target pose data is converted into instructions based on the underlying control protocol type of the target robot to obtain the motion instructions of the target robot; The control program is generated based on the motion command.

6. The spatial tracking robot trajectory programming method according to claim 5, characterized in that, The attitude calculation based on the rotation matrix in the calibration parameters and the attitude data in the verified trajectory data is performed to obtain the target attitude data, including: The Euler angles contained in the attitude data in the verified trajectory data are converted into a first rotation matrix; Calculate the target rotation matrix based on the rotation matrix in the calibration parameters and the first rotation matrix; Determine the attitude representation format supported by the underlying control protocol type; The target rotation matrix is ​​converted into target attitude data corresponding to the attitude representation format, wherein the attitude representation format includes rotation vector, quaternion, Euler angle or attitude matrix.

7. The spatial tracking robot trajectory programming method according to claim 5, characterized in that, The step of converting the target pose data into commands based on the underlying control protocol type of the target robot to obtain the motion commands for the target robot includes: Determine the instruction template and parameter mapping rules based on the underlying control protocol type; The participation mode of position data and attitude data in the target pose data is determined according to the trajectory reproduction mode. The trajectory reproduction mode includes a full six-degree-of-freedom reproduction mode and a position following and attitude constraint mode. In the full six-degree-of-freedom reproduction mode, both the position data and attitude data in the target pose data are used to generate the motion command; In the position following and attitude constraint mode, the position data in the target pose data is extracted to participate in the generation of the motion command, and the attitude data in the target pose data is constrained by one of fixed attitude, key point attitude or controller interpolation attitude. According to the instruction template and the parameter mapping rules, the target pose data is converted into motion instructions for the target robot.

8. A trajectory programming device for a space tracking robot, characterized in that, It includes a method unit for performing the spatial tracking robot trajectory programming method as described in any one of claims 1 to 7.

9. A computer device, characterized in that, The computer device includes a memory and a processor connected to the memory; the memory is used to store a computer program; the processor is used to run the computer program stored in the memory to perform the steps of the method as described in any one of claims 1 to 7.

10. A computer-readable storage medium, characterized in that, The storage medium stores a computer program, which includes program instructions that, when executed by a processor, can implement the steps of the method as described in any one of claims 1 to 7.