Robot off-line program coordinate conversion method and device, electronic equipment and medium

CN122946004APending Publication Date: 2026-10-20FAW MOLD TECHNOLOGY (CHANGCHUN) CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202610855440.8
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-06-12
Publication Date
2026-10-20

AI Technical Summary

Technical Problem

[0004]本申请提供一种机器人离线程序坐标转换方法、装置、电子设备及介质,以解决相关技术中因机器人离线程序的基坐标系不准确、不规范导致程序不可用,以及现场人工逐点调试,存在的耗时过长、调试成本高等问题

Benefits of technology

本申请实施例通过获取基于第一基坐标系的原始离线程序及第一基坐标系和第二基坐标系对应的标定参数,建立了新旧环境之间的数学关联并基于刚体变换原理构建位姿转换矩阵,量化了第一基坐标系和第二基坐标系之间的空间映射关系,进而利用位姿转换矩阵对原始位姿数据进行坐标转换,得到第二基坐标系下的目标位姿数据,并生成可直接执行的机器人离线程序文件,使得机器人在物理位置变更后,无需技术人员在现场进行繁琐的逐点重新示教,即可直接加载转换后的程序实现高精度作业,从而极大地缩短了产线调试周期,显著降低了人力与时间成本,并有效避免了人工二次标定可能引入的累积误差,保障了自动化生产的连续性与作业精度。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure FT_1
    Figure FT_1
  • Figure FT_2
    Figure FT_2
  • Figure FT_3
    Figure FT_3
Patent Text Reader

Abstract

This application relates to the field of robot application technology, and in particular to a method, apparatus, electronic device, and medium for coordinate transformation of robot offline programs. The method includes: acquiring an offline robot program file to be transformed, the offline program file containing original pose data defined based on a first base coordinate system; acquiring calibration parameters of the first and second base coordinate systems, and constructing a pose transformation matrix from the first to the second base coordinate system based on the calibration parameters; performing coordinate transformation on the original pose data using the pose transformation matrix to obtain target pose data in the second base coordinate system; and generating a transformed robot offline program file based on the target pose data. This solves the problems in related technologies where inaccurate or non-standard base coordinate systems of robot offline programs lead to program unavailability, and where on-site manual point-by-point debugging is time-consuming and costly.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the field of robot application technology, and in particular to a method, device, electronic device and medium for offline program coordinate transformation of a robot. Background Technology

[0002] In the relocation and renovation projects of automotive welding production lines, the original robot programs cannot be directly reused because the old robot base coordinate system is often not defined in a standardized manner or the data is lost.

[0003] The relevant technologies mainly rely on on-site manual teaching and debugging, which takes several days to several weeks. This method is not only inefficient and generates a lot of labor costs, but also causes the production line to be shut down for a long time for debugging, which seriously affects the production schedule. Summary of the Invention

[0004] This application provides a method, device, electronic device, and medium for coordinate transformation of robot offline programs, in order to solve the problems in related technologies, such as the inaccuracy or non-standardization of the base coordinate system of robot offline programs leading to program unavailability, and the excessive time consumption and high debugging costs of manual point-by-point debugging on site.

[0005] The first aspect of this application provides a method for coordinate transformation in an offline robot program, comprising the following steps: obtaining an offline robot program file to be transformed, the offline program file containing original pose data defined based on a first base coordinate system; obtaining calibration parameters of the first base coordinate system and a second base coordinate system, and constructing a pose transformation matrix from the first base coordinate system to the second base coordinate system based on the calibration parameters; performing coordinate transformation on the original pose data using the pose transformation matrix to obtain target pose data in the second base coordinate system; and generating a transformed offline robot program file based on the target pose data.

[0006] Optionally, constructing a pose transformation matrix from the first base coordinate system to the second base coordinate system based on calibration parameters includes: converting the calibration parameters corresponding to the first base coordinate system into a first base coordinate system matrix based on the rigid body transformation kinematics principle; converting the calibration parameters corresponding to the second base coordinate system into a second base coordinate system matrix based on the rigid body transformation kinematics principle; and constructing the pose transformation matrix based on the first base coordinate system matrix and the second base coordinate system matrix.

[0007] Optionally, the original pose data is transformed using a pose transformation matrix to obtain target pose data in a second base coordinate system, including: constructing an original point matrix from the original pose data; calculating the target point matrix in the second base coordinate system based on the original point matrix and the pose transformation matrix; and performing inverse solving on the target point matrix to obtain the target pose data in the second base coordinate system.

[0008] Optionally, the target point matrix is ​​subjected to inverse solving to obtain the target pose data in the second base coordinate system, including: performing position calculation on the target point matrix to obtain the position parameters of the original point coordinates in the second base coordinate system; performing attitude calculation on the target point matrix to obtain the attitude parameters of the original point coordinates in the second base coordinate system; and generating target pose data based on the position parameters and attitude parameters.

[0009] Optionally, after calculating the target pose data in the second base coordinate system, the method further includes: detecting whether the cosine value of the target rotation angle in the attitude parameters is within a preset range; if it is within the preset range, locking any rotation angle other than the target rotation angle to a preset fixed value, and using the coupling relationship between other rotation angles besides the target rotation angle to correct the attitude parameters.

[0010] Optionally, the calibration parameters corresponding to the first base coordinate system are the reference parameters currently in use at the original site, and the calibration parameters corresponding to the second base coordinate system are the reference parameters obtained by re-measurement and calibration of the target production line.

[0011] Optionally, the pose transformation matrix represents the translational and rotational deviations between the calibration parameters corresponding to the first base coordinate system and the calibration parameters corresponding to the second base coordinate system.

[0012] A second aspect of this application provides a robot offline program coordinate transformation device, comprising: an acquisition module for acquiring a robot offline program file to be transformed, the offline program file containing original pose data defined based on a first base coordinate system; a construction module for acquiring calibration parameters of the first base coordinate system and a second base coordinate system, and constructing a pose transformation matrix from the first base coordinate system to the second base coordinate system based on the calibration parameters; a transformation module for performing coordinate transformation on the original pose data using the pose transformation matrix to obtain target pose data in the second base coordinate system; and a generation module for generating a transformed robot offline program file based on the target pose data.

[0013] Optionally, the construction module is further used to: convert the calibration parameters corresponding to the first base coordinate system into a first base coordinate system matrix based on the rigid body transformation kinematics principle; convert the calibration parameters corresponding to the second base coordinate system into a second base coordinate system matrix based on the rigid body transformation kinematics principle; and construct a pose transformation matrix based on the first base coordinate system matrix and the second base coordinate system matrix.

[0014] Optionally, the conversion module is further configured to: construct an original point matrix from the original pose data; calculate the target point matrix in the second base coordinate system based on the original point matrix and the pose conversion matrix; and perform inverse solving on the target point matrix to obtain the target pose data in the second base coordinate system.

[0015] Optionally, the conversion module is further configured to: perform position calculation on the target point matrix to obtain the position parameters of the original point coordinates in the second base coordinate system; perform attitude calculation on the target point matrix to obtain the attitude parameters of the original point coordinates in the second base coordinate system; and generate target pose data based on the position parameters and attitude parameters.

[0016] Optionally, the robot offline program coordinate transformation device further includes: a correction module, used to detect whether the cosine value of the target rotation angle in the attitude parameters is within a preset range after the target pose data in the second base coordinate system is calculated; if it is within the preset range, then any rotation angle other than the target rotation angle is locked to a preset fixed value, and the attitude parameters are corrected by using the coupling relationship between other rotation angles besides the target rotation angle.

[0017] Optionally, the calibration parameters corresponding to the first base coordinate system are the reference parameters currently in use at the original site, and the calibration parameters corresponding to the second base coordinate system are the reference parameters obtained by re-measurement and calibration of the target production line.

[0018] Optionally, the pose transformation matrix represents the translational and rotational deviations between the calibration parameters corresponding to the first base coordinate system and the calibration parameters corresponding to the second base coordinate system.

[0019] A third aspect of this application provides an electronic device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor. The processor executes the program to implement the robot offline program coordinate transformation method as described in the above embodiments.

[0020] A fourth aspect of this application provides a computer-readable storage medium having a computer program or instructions stored thereon, which, when executed, are used to implement the robot offline program coordinate transformation method as described in the above embodiments.

[0021] A fifth aspect of this application provides a computer program product, including: a computer program or instructions, which, when executed, implement the robot offline program coordinate transformation method as described in the above embodiments.

[0022] Therefore, this application has at least the following beneficial effects: This application embodiment obtains the original offline program based on the first base coordinate system and the corresponding calibration parameters of the first and second base coordinate systems, establishes a mathematical relationship between the old and new environments, and constructs a pose transformation matrix based on the rigid body transformation principle. This quantifies the spatial mapping relationship between the first and second base coordinate systems. Then, the pose transformation matrix is ​​used to transform the original pose data to obtain the target pose data in the second base coordinate system, and generates a robot offline program file that can be directly executed. This allows the robot to directly load the transformed program to achieve high-precision operation after the physical position changes, without the need for technicians to perform tedious point-by-point re-teaching on-site. This greatly shortens the production line debugging cycle, significantly reduces manpower and time costs, and effectively avoids the cumulative errors that may be introduced by manual secondary calibration, ensuring the continuity and accuracy of automated production.

[0023] Additional aspects and advantages of this application will be set forth in part in the description which follows, and in part will be obvious from the description, or may be learned by practice of this application. Attached Figure Description

[0024] The above and / or additional aspects and advantages of this application will become apparent and readily understood from the following description of the embodiments taken in conjunction with the accompanying drawings, wherein: Figure 1 This is a flowchart of a robot offline program coordinate transformation method according to an embodiment of this application; Figure 2 This is a schematic diagram of an offline program input interface for a robot according to an embodiment of this application; Figure 3 This is a block diagram of a robot offline program coordinate transformation device provided according to an embodiment of this application; Figure 4 This is a schematic diagram of the structure of an electronic device according to an embodiment of this application. Detailed Implementation

[0025] The embodiments of this application are described in detail below. Examples of these embodiments are shown in the accompanying drawings, wherein the same or similar reference numerals denote the same or similar elements or elements having the same or similar functions throughout. The embodiments described below with reference to the accompanying drawings are exemplary and intended to explain this application, and should not be construed as limiting this application.

[0026] The following description, with reference to the accompanying drawings, outlines a robot offline program coordinate transformation method, apparatus, electronic device, and storage medium according to embodiments of this application. Addressing the problems mentioned in the background section, this application provides a robot offline program coordinate transformation method. This method obtains the original offline program based on a first base coordinate system and the corresponding calibration parameters of the first and second base coordinate systems. A mathematical correlation between the old and new environments is established, and a pose transformation matrix is ​​constructed based on the rigid body transformation principle. This quantifies the spatial mapping relationship between the first and second base coordinate systems. The pose transformation matrix is ​​then used to transform the original pose data to obtain the target pose data in the second base coordinate system, generating a directly executable robot offline program file. This allows the robot to directly load the transformed program and achieve high-precision operation without the need for tedious point-by-point re-teaching by technicians after a change in physical position. This significantly shortens the production line debugging cycle, reduces labor and time costs, and effectively avoids the cumulative errors that may be introduced by manual secondary calibration, ensuring the continuity and accuracy of automated production.

[0027] Specifically, Figure 1 This is a flowchart illustrating a robot offline program coordinate transformation method provided in an embodiment of this application.

[0028] like Figure 1 As shown, the robot's offline program coordinate transformation method includes the following steps: In step S101, the robot offline program file to be converted is obtained. The offline program file contains the original pose data defined based on the first base coordinate system.

[0029] Among them, the calibration parameters corresponding to the first base coordinate system are the reference parameters currently used in the original production line.

[0030] It is understood that, in this embodiment of the application, the source code portion and data definition portion of the offline program file can be identified and loaded after program initialization. The source code portion contains the robot's motion instructions and logic control instructions; the data definition portion contains the coordinate variable declarations and initial values ​​for each target point.

[0031] In actual execution, embodiments of this application can extract the original pose data associated with the motion command from the data definition section. The original pose data typically exists in the form of a six-dimensional array, including three position vectors (X, Y, Z) and three attitude vectors (A, B, C).

[0032] In step S102, the calibration parameters of the first base coordinate system and the second base coordinate system are obtained, and a pose transformation matrix from the first base coordinate system to the second base coordinate system is constructed based on the calibration parameters.

[0033] The calibration parameters corresponding to the second base coordinate system are the reference parameters obtained by recalibrating the target production line. The pose transformation matrix represents the translational and rotational deviations between the calibration parameters corresponding to the first and second base coordinate systems.

[0034] Understandably, this application still obtains the calibration parameters of the first base coordinate system in the old production line relative to a common physical reference (such as the center point of the robot's end tool) and the calibration parameters of the second base coordinate system in the new production line relative to the same common physical reference through on-site measurement or historical data backtracking. Subsequently, the embodiments of this application utilize the kinematics principle of rigid body transformation to calculate the spatial relative pose relationship between the two based on the calibration parameters, thereby constructing a pose transformation matrix (which can also be expressed as a homogeneous transformation matrix) containing rotational and translational components. This pose transformation matrix, as the core mapping operator, can describe the linear mapping relationship from the first base coordinate system to the second base coordinate system, providing a mathematical basis for the subsequent batch projection of the original pose data in the offline program to the new coordinate system.

[0035] In one embodiment of this application, constructing a pose transformation matrix from a first base coordinate system to a second base coordinate system based on calibration parameters includes: converting the calibration parameters corresponding to the first base coordinate system into a first base coordinate system matrix based on the rigid body transformation kinematics principle; converting the calibration parameters corresponding to the second base coordinate system into a second base coordinate system matrix based on the rigid body transformation kinematics principle; and constructing a pose transformation matrix based on the first base coordinate system matrix and the second base coordinate system matrix.

[0036] It is understood that, in this embodiment of the application, the calibration parameters (i.e., six-dimensional data including three translation vectors and three rotation vectors) corresponding to a certain absolute physical reference for the first base coordinate system are obtained. Based on the rigid body transformation kinematics principle, these six-dimensional data are converted into a 4×4 homogeneous transformation matrix (i.e., the first base coordinate system matrix), thereby accurately describing the actual pose state of the old base coordinate system in absolute physical space. Similarly, during the installation and commissioning phase of the new factory, this embodiment of the application remeasures and establishes the second base coordinate system. Its calibration parameters relative to the same absolute physical reference are obtained, and the same rigid body transformation principle is used to convert them into the second base coordinate system matrix to characterize the standard pose state of the new base coordinate system in absolute physical space.

[0037] Furthermore, after obtaining the two homogeneous transformation matrices mentioned above, the embodiments of this application can obtain the pose transformation matrix by multiplying the inverse matrix of the second base coordinate system matrix by the first base coordinate system matrix according to the matrix multiplication and inverse operation rules. This fundamentally eliminates the direct dependence on the absolute physical reference and directly solves the relative spatial mapping relationship from the first base coordinate system to the second base coordinate system. The final generated pose transformation matrix contains the precise rotation and translation compensation between the old and new coordinate systems.

[0038] For ease of understanding, this application can be briefly described with specific examples, such as the first base coordinate system being the old base coordinate system and the second base coordinate system being the new base coordinate system.

[0039] Specifically, the "KukaCoordinateConverter" class is instantiated when the program starts. It is responsible for building the graphical user interface (GUI), initializing input boxes, buttons, and binding the core business logic for coordinate transformation. The UI includes an import program area, an input parameter area, an execution button, and a result display area. The imported KUKA robot program (.dat) is read line by line in text mode (UTF-8 encoding), ignoring encoding errors. The new and old Base coordinates are manually entered by the user in the KUKA robot-specific coordinate system representation (X, Y, Z, A, B, C). The input interface in this embodiment is as follows: Figure 2 As shown.

[0040] In this embodiment, nonlinear Euler angle data obtained from the old program and the new site are mapped to a linear Euler space matrix. Let the input KUKA offline program data be vector P.

[0041] P=[X,Y,Z,A,B,C] T .

[0042] Where X, Y, Z represent Cartesian spatial positions, and A, B, C correspond to rotation angles about the Z-axis, Y-axis, and X-axis, respectively (following the ZYX dynamic Euler angle rule). The total rotation matrix is... R = R z (A) × R y (B) × R x (C) , ( R z (A) , R y (B) , R x (C) (These are rotation matrices around Z, Y, and X, respectively), ultimately constructing a homogeneous transformation matrix T. r 11 - r 33 (This describes the orientation, that is, where the axes of the new base coordinate system point in the old base coordinate system.) T=

[0043] From this, the matrix of the old base coordinate system can be obtained. T Base_Old New base coordinate system matrix T Base_New and the original point matrix for each point T Point_Old .

[0044] In step S103, the original pose data is transformed using a pose transformation matrix to obtain the target pose data in the second base coordinate system.

[0045] In one embodiment of this application, the original pose data is transformed using a pose transformation matrix to obtain target pose data in a second base coordinate system. This includes: constructing an original point matrix from the original pose data; calculating a target point matrix in the second base coordinate system based on the original point matrix and the pose transformation matrix; and performing an inverse operation on the target point matrix to solve for the target pose data in the second base coordinate system.

[0046] It is understandable that after obtaining the original point matrix... T Point_Old Subsequently, in this embodiment of the application, the pose transformation matrix from the first base coordinate system to the second base coordinate system, calculated previously, can be used to perform matrix multiplication on the original point matrix to obtain a new target point matrix, which fully contains the absolute position and attitude information in the new environment.

[0047] Furthermore, the inverse solution operation is performed on the target point matrix to calculate the target pose data in the second base coordinate system, including: calculating the position of the target point matrix to obtain the position parameters of the original point coordinates in the second base coordinate system; calculating the attitude of the target point matrix to obtain the attitude parameters of the original point coordinates in the second base coordinate system; and generating the target pose data based on the position parameters and attitude parameters.

[0048] In this embodiment, the target point matrix obtained through matrix multiplication is a homogeneous transformation matrix, which the robot controller cannot directly execute as a motion command. Therefore, this embodiment needs to decompose the target point matrix and restore it to robot-readable position vectors (x', y', z') and posture vectors (A', B', C'). The final output target pose data not only achieves seamless switching of spatial reference but also fully conforms to the underlying control logic of the new production line robot, realizing direct program reuse.

[0049] Based on the above example, in order to obtain the target pose data in the new base coordinate system T Point_New This application embodiment requires the construction of from Base Old arrive Base New The inverse mapping relationship is used to perform a left multiplication transformation on the formula: T Point_New =( T Base_New ) 1 × T Base_Old × T Point_Old It is the inverse matrix of the new base matrix, and its physical meaning is to project points in the world coordinate system back to the local coordinate system of the new base. This application embodiment, through... T Trans =( T Base_New ) 1 × T Base_Old The pose transformation matrix contains all translation and rotation deviations between the two coordinate systems, ensuring the mathematical uniqueness and geometric accuracy of all point transformation results.

[0050] In the homogeneous matrix of the new points T Point_New Subsequently, this embodiment of the application also needs to restore it to the {X,Y,Z,A,B,C} format recognizable by the KUKA robot controller. Assume the obtained... T Point_New for: T Point_New =

[0051] Furthermore, embodiments of this application can perform position calculations and directly extract the displacement component X′= p x ,Y′= p y Z′= p z Then, attitude calculation (inverse Euler angles) is performed, and the rotation angle is solved using the atan2 function to ensure numerical stability across all quadrants.

[0052] In one embodiment of this application, after calculating the target pose data in the second base coordinate system, the method further includes: detecting whether the cosine value of the target rotation angle in the attitude parameters is within a preset range; if it is within the preset range, locking any rotation angle other than the target rotation angle to a preset fixed value, and using the coupling relationship between other rotation angles besides the target rotation angle to correct the attitude parameters.

[0053] The preset range can be set by those skilled in the art according to the actual situation, without any specific restrictions.

[0054] In this embodiment, when the robot's posture is in the gimbal lock region (e.g., the angle is close to ±90°), the embodiment can automatically switch the calculation strategy, avoiding numerical jumps and ensuring the smooth and continuous motion trajectory of the robot. Specifically, the target rotation angle can be... When the robot's posture is At the special position where cosB ≈ 0, within the preset range, the above solution may result in multiple solutions or numerical instability. This application's embodiment incorporates singularity detection logic: if... < ( For a minimum threshold, such as 10 6 If the target rotation angle is 0, it is determined to be a singular state. In this case, the embodiment of this application can lock C′=0 (a preset fixed value) other than the target rotation angle, and solve A′ using the coupling relationship between A′ and C′. Alternatively, it can lock A′=0 and solve C′ using the coupling relationship between A′ and C′ to redistribute and correct the attitude parameters, thereby ensuring that the generated program data is continuous and without abrupt changes.

[0055] Furthermore, while the file I / O stream is closed, this embodiment of the application can force the value of the progress bar control to the maximum value and refresh the display buffer through the update_idletasks method, which marks the complete end of the background computing task.

[0056] In step S104, the converted robot offline program file is generated based on the target pose data.

[0057] Understandably, after the conversion calculation is complete, a converted file will be generated. Except for the updated point coordinates, the other data in the converted file remains completely unchanged to protect the original program logic. It not only contains complete motion trajectory information but also fully adapts to the reference definition of the second base coordinate system in the new factory. Engineers can directly download this converted program file to the robot controller on the new production line via USB flash drive or industrial Ethernet. Since coordinate system deviations have been completely eliminated by the mathematical matrix and singular points have been smoothed, there is no need for tedious manual point-by-point teaching or on-site alignment; the program can be directly loaded and run, thus achieving rapid resumption of production in the relocation project. For example, for the KUKA robot, this embodiment can accurately replace the corresponding variable declarations in the .dat data list file with the updated six-dimensional pose data, while keeping the motion instructions and logic control code in the .src source program file unchanged, thereby achieving seamless splicing of the old and new data.

[0058] In summary, for intensive production lines such as automotive welding, the core logic of this application follows the principle of "absolute spatial position invariance", that is, the physical position and orientation of the robot end-effector center point (TCP) in the world coordinate system do not change with the change of the reference coordinate system (Base). Through optimized memory matrix operations, the coordinate reconstruction of thousands of process points can be completed in a very short time, reducing the downtime debugging time of several weeks to hours, and supporting millisecond-level conversion of massive point data.

[0059] According to the robot offline program coordinate transformation method proposed in the embodiments of this application, by obtaining the original offline program based on the first base coordinate system and the calibration parameters corresponding to the first and second base coordinate systems, a mathematical relationship between the old and new environments is established, and a pose transformation matrix is ​​constructed based on the rigid body transformation principle. The spatial mapping relationship between the first and second base coordinate systems is quantified. Then, the pose transformation matrix is ​​used to transform the original pose data to obtain the target pose data in the second base coordinate system, and a robot offline program file that can be directly executed is generated. This allows the robot to directly load the transformed program to achieve high-precision operation without the need for technicians to perform tedious point-by-point re-teaching on-site after the physical position changes. This greatly shortens the production line debugging cycle, significantly reduces manpower and time costs, and effectively avoids the cumulative errors that may be introduced by manual secondary calibration, ensuring the continuity and accuracy of automated production.

[0060] Next, the robot offline program coordinate transformation device according to the embodiments of this application is described with reference to the accompanying drawings.

[0061] Figure 3 This is a block diagram of a robot offline program coordinate transformation device according to an embodiment of this application.

[0062] like Figure 3 As shown, the robot offline program coordinate transformation device 10 includes: an acquisition module 100, a construction module 200, a transformation module 300, and a generation module 400.

[0063] The acquisition module 100 is used to acquire the robot offline program file to be converted, which contains the original pose data defined based on the first base coordinate system; the construction module 200 is used to acquire the calibration parameters of the first base coordinate system and the second base coordinate system, and construct the pose transformation matrix from the first base coordinate system to the second base coordinate system based on the calibration parameters; the conversion module 300 is used to perform coordinate transformation on the original pose data using the pose transformation matrix to obtain the target pose data in the second base coordinate system; and the generation module 400 is used to generate the converted robot offline program file based on the target pose data.

[0064] In one embodiment of this application, the construction module 200 is further configured to: convert the calibration parameters corresponding to the first base coordinate system into a first base coordinate system matrix based on the rigid body transformation kinematics principle; convert the calibration parameters corresponding to the second base coordinate system into a second base coordinate system matrix based on the rigid body transformation kinematics principle; and construct a pose transformation matrix based on the first base coordinate system matrix and the second base coordinate system matrix.

[0065] In one embodiment of this application, the conversion module 300 is further configured to: construct an original point matrix from the original pose data; calculate a target point matrix in the second base coordinate system based on the original point matrix and the pose conversion matrix; and perform inverse solving on the target point matrix to obtain the target pose data in the second base coordinate system.

[0066] In one embodiment of this application, the conversion module 300 is further configured to: perform position calculation on the target point matrix to obtain position parameters of the original point coordinates in the second base coordinate system; perform attitude calculation on the target point matrix to obtain attitude parameters of the original point coordinates in the second base coordinate system; and generate target pose data based on the position parameters and attitude parameters.

[0067] In one embodiment of this application, the robot offline program coordinate transformation device 10 further includes: a correction module, used to detect whether the cosine value of the target rotation angle in the attitude parameters is within a preset range after the target pose data in the second base coordinate system is calculated; if it is within the preset range, then any rotation angle other than the target rotation angle is locked to a preset fixed value, and the attitude parameters are corrected by using the coupling relationship between other rotation angles other than the target rotation angle.

[0068] In one embodiment of this application, the calibration parameters corresponding to the first base coordinate system are the reference parameters currently in use at the original site, and the calibration parameters corresponding to the second base coordinate system are the reference parameters obtained by re-measurement and calibration of the target production line.

[0069] In one embodiment of this application, the pose transformation matrix represents the translational and rotational deviations between the calibration parameters corresponding to the first base coordinate system and the calibration parameters corresponding to the second base coordinate system.

[0070] It should be noted that the foregoing explanation of the robot offline program coordinate transformation method embodiment also applies to the robot offline program coordinate transformation device of this embodiment, and will not be repeated here.

[0071] According to the robot offline program coordinate transformation device proposed in the embodiments of this application, by acquiring the original offline program based on the first base coordinate system and the calibration parameters corresponding to the first and second base coordinate systems, a mathematical relationship between the old and new environments is established, and a pose transformation matrix is ​​constructed based on the rigid body transformation principle. The spatial mapping relationship between the first and second base coordinate systems is quantified. Then, the pose transformation matrix is ​​used to transform the original pose data to obtain the target pose data in the second base coordinate system, and a robot offline program file that can be directly executed is generated. This allows the robot to directly load the transformed program to achieve high-precision operation without the need for technicians to perform tedious point-by-point re-teaching on-site after the physical position changes. This greatly shortens the production line debugging cycle, significantly reduces manpower and time costs, and effectively avoids the cumulative errors that may be introduced by manual secondary calibration, ensuring the continuity and accuracy of automated production.

[0072] Figure 4 A schematic diagram of the structure of an electronic device provided in an embodiment of this application. The electronic device may include: The memory 401, the processor 402, and the computer program stored on the memory 401 and capable of running on the processor 402.

[0073] When the processor 402 executes the program, it implements the robot offline program coordinate transformation method provided in the above embodiments.

[0074] Furthermore, electronic devices also include: Communication interface 403 is used for communication between memory 401 and processor 402.

[0075] The memory 401 is used to store computer programs that can run on the processor 402.

[0076] The memory 401 may include high-speed RAM (Random Access Memory) memory, and may also include non-volatile memory, such as at least one disk storage.

[0077] If the memory 401, processor 402, and communication interface 403 are implemented independently, then the communication interface 403, memory 401, and processor 402 can be interconnected via a bus to complete communication between them. The bus can be an ISA (Industry Standard Architecture) bus, a PCI (Peripheral Component Interconnect) bus, or an EISA (Extended Industry Standard Architecture) bus, etc. Buses can be divided into address buses, data buses, control buses, etc. For ease of representation, Figure 4 The bus is represented by a single thick line, but this does not mean that there is only one bus or one type of bus.

[0078] Optionally, in a specific implementation, if the memory 401, processor 402, and communication interface 403 are integrated on a single chip, then the memory 401, processor 402, and communication interface 403 can communicate with each other through an internal interface.

[0079] Processor 402 may be a CPU (Central Processing Unit), an ASIC (Application Specific Integrated Circuit), or one or more integrated circuits configured to implement the embodiments of this application.

[0080] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the above-described robot offline program coordinate transformation method.

[0081] This application also provides a computer program product, including: a computer program or instructions, which, when executed, implement the robot offline program coordinate transformation method as described in the above embodiments.

[0082] In the description of this specification, the references to terms such as "one embodiment," "some embodiments," "example," "specific example," or "some examples," etc., refer to specific features, structures, materials, or characteristics described in connection with that embodiment or example, which are included in at least one embodiment or example of this application. In this specification, the illustrative expressions of the above terms do not necessarily refer to the same embodiment or example. Furthermore, the specific features, structures, materials, or characteristics described may be combined in any suitable manner in one or more embodiments or examples. Moreover, without contradiction, those skilled in the art can combine and integrate the different embodiments or examples described in this specification, as well as the features of different embodiments or examples.

[0083] Furthermore, the terms "first" and "second" are used for descriptive purposes only and should not be construed as indicating or implying relative importance or implicitly specifying the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include at least one of that feature. In the description of this application, "N" means at least two, such as two, three, etc., unless otherwise explicitly specified.

[0084] Any process or method described in the flowchart or otherwise herein can be understood as representing a module, segment, or portion of code comprising one or more N executable instructions for implementing custom logic functions or processes, and the scope of the preferred embodiments of this application includes additional implementations in which functions may be performed not in the order shown or discussed, including substantially simultaneously or in reverse order depending on the functions involved, as should be understood by those skilled in the art to which embodiments of this application pertain.

[0085] It should be understood that the various parts of this application can be implemented using hardware, software, firmware, or a combination thereof. In the above embodiments, the N steps or methods can be implemented using software or firmware stored in memory and executed by a suitable instruction execution system. For example, if implemented in hardware, as in another embodiment, it can be implemented using any one or a combination of the following techniques known in the art: discrete logic circuits having logic gates for implementing logical functions on data signals, application-specific integrated circuits (ASICs) having suitable combinational logic gates, programmable gate arrays (FPGAs), field-programmable gate arrays (FPGAs), etc.

[0086] Those skilled in the art will understand that all or part of the steps of the methods in the above embodiments can be implemented by a program instructing related hardware. The program can be stored in a computer-readable storage medium, and when executed, the program includes one or a combination of the steps of the method embodiments.

[0087] Although embodiments of this application have been shown and described above, it is understood that the above embodiments are exemplary and should not be construed as limiting this application. Those skilled in the art can make changes, modifications, substitutions and variations to the above embodiments within the scope of this application.

Claims

1. A method for coordinate transformation in an offline robot program, characterized in that, Includes the following steps: Obtain the robot offline program file to be converted, wherein the offline program file contains the original pose data defined based on the first base coordinate system; Obtain the calibration parameters of the first base coordinate system and the second base coordinate system, and construct the pose transformation matrix from the first base coordinate system to the second base coordinate system based on the calibration parameters; The original pose data is transformed using the pose transformation matrix to obtain the target pose data in the second base coordinate system. The converted robot offline program file is generated based on the target pose data.

2. The robot offline program coordinate transformation method according to claim 1, characterized in that, Constructing a pose transformation matrix from the first base coordinate system to the second base coordinate system based on the calibration parameters includes: Based on the kinematics principle of rigid body transformation, the calibration parameters corresponding to the first base coordinate system are converted into the matrix of the first base coordinate system. Based on the kinematics principle of rigid body transformation, the calibration parameters corresponding to the second base coordinate system are converted into the matrix of the second base coordinate system. The pose transformation matrix is ​​constructed based on the first base coordinate system matrix and the second base coordinate system matrix.

3. The robot offline program coordinate transformation method according to claim 1 or 2, characterized in that, The original pose data is transformed using the pose transformation matrix to obtain the target pose data in the second base coordinate system, including: The original pose data is used to construct an original point matrix; Calculate the target point matrix in the second base coordinate system based on the original point matrix and the pose transformation matrix; The target point matrix is ​​inversely solved to obtain the target pose data in the second base coordinate system.

4. The robot offline program coordinate transformation method according to claim 3, characterized in that, The step of performing inverse solving of the target point matrix to calculate the target pose data in the second base coordinate system includes: The position parameters of the original pose data in the second base coordinate system are obtained by solving the position matrix of the target point; The attitude parameters of the original pose data in the second base coordinate system are obtained by performing attitude calculation on the target point matrix; The target pose data is generated based on the position parameters and the attitude parameters.

5. The robot offline program coordinate transformation method according to claim 4, characterized in that, After calculating the target pose data corresponding to the second base coordinate system, the process also includes: Detect whether the cosine value of the target rotation angle in the attitude parameters is within a preset range; If the target rotation angle is within the preset range, any rotation angle other than the target rotation angle is locked to a preset fixed value, and the attitude parameters are corrected by utilizing the coupling relationship between other rotation angles besides the target rotation angle.

6. The robot offline program coordinate transformation method according to any one of claims 1-5, characterized in that, The calibration parameters corresponding to the first base coordinate system are the reference parameters currently in use at the original site, and the calibration parameters corresponding to the second base coordinate system are the reference parameters obtained by re-measurement and calibration of the target production line; the pose transformation matrix represents the translational and rotational deviations between the calibration parameters corresponding to the first base coordinate system and the calibration parameters corresponding to the second base coordinate system.

7. A robot offline program coordinate transformation device, characterized in that, include: The acquisition module is used to acquire the robot offline program file to be converted, wherein the offline program file contains the original pose data defined based on the first base coordinate system; A construction module is used to obtain the calibration parameters of the first base coordinate system and the second base coordinate system, and construct a pose transformation matrix from the first base coordinate system to the second base coordinate system based on the calibration parameters; The conversion module is used to perform coordinate transformation on the original pose data using the pose transformation matrix to obtain the target pose data in the second base coordinate system; The generation module is used to generate the converted robot offline program file based on the target pose data.

8. An electronic device, characterized in that, include: A memory, a processor, and a computer program stored in the memory and executable on the processor, the processor executing the program to implement the robot offline program coordinate transformation method as described in any one of claims 1-6.

9. A computer-readable storage medium having a computer program or instructions stored thereon, characterized in that, When the computer program or instructions are executed, they implement the robot offline program coordinate transformation method according to any one of claims 1-6.

10. A computer program product comprising: A computer program or instruction, characterized in that, when executed, the computer program or instruction implements the robot offline program coordinate transformation method according to any one of claims 1-6.