A robot structure analysis, kinematic mapping and real-time control method and device

CN122984503APending Publication Date: 2026-10-27SPEEDBOT ROBOTICS CO LTD
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202611139533.7
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2026-07-29
Publication Date
2026-10-27

AI Technical Summary

Technical Problem

现有技术针对URDF的应用仅能单独实现模型可视化渲染、动力学仿真或单一运动学参数转换,无法建立从标准化文件解析、运动学参数统一映射到虚实机器人实时控制的一体化完整数据链路,导致机器人视觉模型、运动学求解模型、实体控制器控制模型三者相互割裂,需要人工分别维护多套独立参数文件,极易出现关节轴向、限位、零位、度量单位不一致,离线仿真轨迹无法直接复用至实体机器人,建模、调试、部署、控制全流程效率低,且存在运动安全隐患

Benefits of technology

本申请提供了一种机器人结构解析、运动学映射及实时控制方法与装置,首先,通过统一解析机器人URDF源文件提取连杆、关节完整拓扑与限位参数并构建连杆-关节拓扑树,依托同一套拓扑数据同步生成三维可视化层级与运动学配置数据,使三维渲染模型、运动学求解数据、机器人控制器数据共用同一URDF原始基准,实现标准化机器人文件一次性生成可视化、运动学、实机控制共用的统一数据,避免多套机器人参数单独维护带来的数据不一致问题,能够保证机器人结构解析建模与实时控制的准确性和可靠性。其次,依托轴向重映射、单位转换、真实与理论关节值双向转换的统一映射关系,打通三维可视化节点、运动学求解器、机器人控制器三者的数据通道,统一适配三维渲染、运动学求解、实体机器人控制的不同坐标系、度量单位与关节数值定义,减少关节轴向错位、单位换算错误、关节零位偏差等异常,从而提升了机器人运动控制的精准性和安全性。再者,依托同一套运动学配置数据初始化运动学求解器,并通过统一控制接口同时驱动虚拟机器人仿真、真实机器人执行运动,实现虚拟仿真与实体机器人控制共用一套底层数据与控制逻辑,无需分别开发两套独立运动下发逻辑,降低机器人仿真与实机调试的开发工作量,从而提升机器人建模分析控制的效率。此外,仅输入机器人URDF源文件即可自动完成拓扑构建、三维模型渲染、运动学配置生成、多端数据映射全流程处理,无需人工手动编写、修改运动学配置文件或关节转换参数,简化机器人建模与控制前置配置操作,进一步提升了机器人建模分析控制的效率。

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN122984503A_ABST
    Figure CN122984503A_ABST
Patent Text Reader

Abstract

The application discloses a robot structure analysis, kinematics mapping and real-time control method and device, relates to the technical field of robot digital twinning, offline simulation and industrial real-time motion control, and the method comprises the following steps: acquiring a robot URDF source file and structurally analyzing the robot URDF source file, and constructing a connecting rod-joint topological tree; a three-dimensional visual hierarchy is constructed, three-dimensional nodes are created, a parent-child connection relationship is established according to joint types and original point poses, and a renderable robot model is formed; kinematics configuration data is generated, a mapping relationship among three-dimensional visual hierarchy joint nodes, a kinematics solver joint array and a robot controller joint array is established; a kinematics solver is initialized, motion instructions are issued to a virtual robot or a real robot, and reuse of virtual simulation and real robot control is realized. The application can realize unified data, which is shared by visualization, kinematics and real robot control, generated from a standardized robot file once, and improves the efficiency and motion safety of robot modeling, analysis and control.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application relates to the fields of robot digital twin, offline simulation and industrial real-time motion control technology, and in particular to a robot structure analysis, kinematic mapping and real-time control method and device. Background Technology

[0002] In the industrial robot development process, URDF (Unified Robot Description Format) is used for 3D modeling, robot operating system simulation, and motion planning verification. Existing technologies for URDF applications can only achieve model visualization rendering, dynamics simulation, or single kinematic parameter conversion. They cannot establish a unified, integrated data link from standardized file parsing and unified kinematic parameter mapping to real-time control of the virtual and physical robots. This results in the robot's visual model, kinematic solution model, and physical controller control model being fragmented, requiring manual maintenance of multiple independent parameter files. Inconsistencies in joint axes, limits, zero points, and measurement units are easily encountered, and offline simulation trajectories cannot be directly reused on the physical robot. The entire process of modeling, debugging, deployment, and control is inefficient and poses motion safety hazards.

[0003] Therefore, there is an urgent need to provide a robot structure analysis, kinematic mapping, and real-time control scheme to achieve the one-time generation of unified data for visualization, kinematics, and real-machine control of standardized robot files, and to connect the entire chain of simulation modeling, motion solving, and virtual-real integrated real-time control, thereby improving the efficiency of robot analysis and control and motion safety, and solving the above-mentioned technical problems existing in the current technology. Summary of the Invention

[0004] The purpose of this application is to provide a method and apparatus for robot structure analysis, kinematic mapping and real-time control, which can realize the one-time generation of unified data for visualization, kinematics and actual machine control of standardized robot files, thereby improving the efficiency of robot modeling, analysis and control and motion safety.

[0005] To achieve the above objectives, this application provides the following solution: In a first aspect, this application provides a method for robot structure analysis, kinematic mapping, and real-time control, comprising the following steps: Obtain the robot's URDF source file.

[0006] The robot's URDF source file is structured and parsed to extract link nodes, joint nodes, and the parent link, child link, origin pose, motion axis, and limit parameters of each joint, thus constructing a link-joint topology tree.

[0007] A three-dimensional visualization hierarchy is constructed based on the link-joint topology tree. A corresponding three-dimensional node is created for each link, and a parent-child connection relationship is established according to the joint type and origin pose to form a renderable robot model.

[0008] Kinematic configuration data is generated based on the link-joint topology tree; the kinematic configuration data includes the number of joints, zero position of each joint, joint direction symbol, joint limit, and kinematic solution parameter array.

[0009] Based on the kinematic configuration data, a mapping relationship is established between the joint nodes of the three-dimensional visualization hierarchy, the joint array of the kinematic solver, and the joint array of the robot controller; the mapping relationship includes axial remapping, unit conversion, and bidirectional conversion between actual joint values ​​and theoretical joint values.

[0010] Based on the kinematic configuration data, the mapping relationship, and the renderable robot model, the kinematic solver is initialized, and motion commands are issued to the virtual robot or the real robot using a unified control interface, thereby realizing the reuse of virtual simulation and real machine control.

[0011] Optionally, after obtaining the robot URDF source file, the robot structure parsing, kinematic mapping, and real-time control method further includes: detecting whether the path where the robot URDF source file is located contains non-ASCII characters or is located in a temporary directory; if so, generating a unique identifier name, and copying the robot URDF source file and its associated resource directory as a whole to a persistent cache directory; after generating the kinematic configuration data, the original text of the robot URDF source file and the kinematic configuration data are jointly embedded into the project data, so that if external files are unavailable when the project is loaded, the robot URDF source file can be recovered from the original text of the embedded robot URDF source file and the kinematic configuration data can be regenerated.

[0012] Optionally, a three-dimensional visualization hierarchy is constructed based on the link-joint topology tree, specifically including the following steps: The root link is determined based on the link-joint topology tree, and the root link is used as the root node of the robot.

[0013] Based on the link-joint topology tree, a wrapper node is added to each link node, and the visual geometry and collision geometry are attached to the wrapper node. At the same time, the motion joint node is retained as an independent control link, so that the orientation correction of the visual geometry is decoupled from the joint control axis.

[0014] A ground compensation node is added outside the robot root node. The bottom offset is calculated based on the model bounding box to automatically place the robot on the ground reference. An ignore mark is added to the ground compensation node to prevent it from entering the kinematics solution link.

[0015] Optionally, based on the kinematic configuration data, a mapping relationship is established between the joint nodes of the 3D visualization hierarchy, the joint array of the kinematic solver, and the joint array of the robot controller, specifically including the following steps: The rotation or translation axes of each joint are read from the kinematic configuration data, and the axes are rearranged and the direction signs are corrected in combination with the platform coordinate system to obtain a list of control axes corresponding to the local coordinate system of the 3D engine.

[0016] Based on the control axis list, a unit conversion rule is established; the unit conversion rule is used to perform bidirectional conversion between radians and meters in the robot URDF source file, degrees and millimeters in the user interface, and the internal units of the kinematics solver.

[0017] Based on the control axis list, a bidirectional mapping function between actual joint values ​​and theoretical joint values ​​is established. The bidirectional mapping function includes the Real2Theoretical function and the Theoretical2Real function. The Real2Theoretical function is used to convert the joint values ​​input by the user or returned by the actual controller into the theoretical joint values ​​required by the solver. The Theoretical2Real function is used to convert the solution results back into actual joint values.

[0018] Optionally, after establishing a bidirectional mapping function between actual joint values ​​and theoretical joint values ​​based on the control axis list, the robot structure analysis, kinematic mapping, and real-time control method further includes: a joint limit verification and synchronization step, specifically including the following steps: When the joint limit parameters change, the joint limit parameters are verified to determine whether the lower limit of the joint stroke corresponding to the joint limit parameters is less than the upper limit of the joint stroke and whether the joint running speed is greater than or equal to zero.

[0019] If the verification fails, the joint limit parameter will be rolled back to the previous valid cache value.

[0020] If the verification passes, the verified joint limit parameters are synchronously updated in real time to the kinematics solver, the robot controller, and the embedded and saved robot URDF source file.

[0021] Optionally, after the step of initializing the kinematics solver, the robot structure analysis, kinematic mapping, and real-time control method further includes: an additional axis processing step, specifically including the following steps: When the robot includes a ground rail, a positioner, a cantilever, or an external additional axis, the additional axis information is calculated; the additional axis information includes the origin position, axis, axis type, and upper and lower limits of each additional axis.

[0022] The additional axis information is registered to the kinematics solver so that when the analytical inverse kinematics solution fails, the numerical inverse kinematics solver can be invoked to jointly solve all joints containing the additional axis.

[0023] Optionally, motion commands can be issued to the virtual or real robot using a unified control interface, specifically including the following steps: For the virtual robot, after setting the initial values ​​of the current joints, trajectory data including joint sequence, tool center point frame, velocity, acceleration, smoothness and motion type is sent out.

[0024] For the real robot, a connection is established through a configurable communication protocol, including at least one of the Industrial Ethernet protocol, Modbus protocol, S7 protocol, or custom Socket protocol; during the execution of the real robot, the current joint coordinates, motion state, and input / output state are obtained through state callback or polling, and the robot model posture in the three-dimensional visualization layer is updated synchronously to form a digital twin closed loop.

[0025] In a second aspect, this application provides a computer device, including: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein the processor executes the computer program to implement the steps of the robot structure analysis, kinematic mapping, and real-time control method described in any one of the above descriptions.

[0026] Thirdly, this application provides a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the steps of the robot structure analysis, kinematic mapping, and real-time control method described above.

[0027] Fourthly, this application provides a computer program product, including a computer program that, when executed by a processor, implements the steps of the robot structure analysis, kinematic mapping, and real-time control method described above.

[0028] According to the specific embodiments provided in this application, this application has the following technical effects: This application provides a method and apparatus for robot structure analysis, kinematic mapping, and real-time control. First, by uniformly analyzing the robot's URDF source file, the complete topology and limit parameters of links and joints are extracted, and a link-joint topology tree is constructed. Based on the same set of topology data, 3D visualization hierarchy and kinematic configuration data are generated synchronously. This allows the 3D rendering model, kinematic solution data, and robot controller data to share the same URDF original reference, achieving standardized robot file generation of unified data for visualization, kinematics, and actual machine control. This avoids data inconsistencies caused by maintaining multiple sets of robot parameters separately, ensuring the accuracy and reliability of robot structure analysis, modeling, and real-time control. Second, relying on a unified mapping relationship for axial remapping, unit conversion, and bidirectional conversion between real and theoretical joint values, the data channels of the 3D visualization nodes, kinematic solver, and robot controller are opened up. This uniformly adapts to different coordinate systems, measurement units, and joint numerical definitions in 3D rendering, kinematic solving, and physical robot control, reducing anomalies such as joint axial misalignment, unit conversion errors, and joint zero-position deviation, thereby improving the accuracy and safety of robot motion control. Furthermore, by initializing the kinematic solver using the same set of kinematic configuration data and simultaneously driving virtual robot simulation and real robot motion execution through a unified control interface, the virtual simulation and physical robot control share a single underlying data and control logic. This eliminates the need to develop two separate sets of motion delivery logic, reducing the development workload for robot simulation and real-machine debugging, thereby improving the efficiency of robot modeling, analysis, and control. In addition, the entire process of topology construction, 3D model rendering, kinematic configuration generation, and multi-terminal data mapping can be automatically completed by simply inputting the robot's URDF source file. This eliminates the need for manual writing and modification of kinematic configuration files or joint transition parameters, simplifying the pre-configuration operations for robot modeling and control, further enhancing the efficiency of robot modeling, analysis, and control. Attached Figure Description

[0029] To more clearly illustrate the technical solutions in the embodiments of this application or the prior art, the drawings used in the embodiments will be briefly introduced below. Obviously, the drawings described below are only some embodiments of this application. For those skilled in the art, other drawings can be obtained based on these drawings without creative effort.

[0030] Figure 1 An application environment diagram of a robot structure analysis, kinematic mapping and real-time control method provided in an embodiment of this application; Figure 2 A flowchart illustrating a robot structure analysis, kinematic mapping, and real-time control method according to an embodiment of this application; Figure 3 This is a schematic diagram of the import progress UI provided in one embodiment of this application; Figure 4 This is a schematic diagram of a robot URDF joint parameter setting interface provided in an embodiment of this application; Figure 5 This is a schematic diagram of the interactive UI interface for the collision body generation result provided in an embodiment of this application; Figure 6 This is a schematic diagram of the structure of a computer device provided in an embodiment of this application. Detailed Implementation

[0031] The technical solutions of the embodiments of this application will be clearly and completely described below with reference to the accompanying drawings. Obviously, the described embodiments are only some embodiments of this application, and not all embodiments. Based on the embodiments of this application, all other embodiments obtained by those skilled in the art without creative effort are within the scope of protection of this application.

[0032] URDF typically describes a robot as an XML file. In current robot development, URDF is widely used in simulation or motion planning environments such as ROS (Robot Operating System), Gazebo (physical dynamics simulation environment), RViz (robot visualization tool), and MoveIt (robot motion planning core framework), and is also often exported from 3D modeling software or the SW2URDF plugin.

[0033] One existing approach involves modeling the robotic arm components, writing or exporting a URDF (Ultra-Ultra-Derivative Flowchart), then performing motion planning in the ROS environment using MoveIt, and sending the planning results to the robotic arm control module. Another approach involves importing the URDF into dynamics simulation software, applying driving forces, velocities, or position inputs to the model to complete the simulation. A third approach converts the URDF parameters into Denavit-Hartenberg (DH) parameters or other kinematic parameters for traditional forward and inverse kinematics calculations. While these approaches can establish a basic model using URDF, they typically focus on display, dynamics simulation, or planning verification within a single environment, and suffer from the following problems: (1) The model structure and control structure are disconnected. After URDF is imported, it often only forms a visual or physical simulation level, and cannot generate joint configurations suitable for the forward and inverse kinematics, trajectory planning and control SDK (Software Development Kit) calls of industrial robots at the same time; engineers still need to manually maintain a robot configuration JSON, DH (Denavit-Hartenberg) parameter table or SDK-specific model file, which can easily cause inconsistencies in model, limit, axis and control parameters.

[0034] (2) There is a lack of a unified mechanism for coordinate system, unit and joint symbol conversion. URDF usually uses a right-handed coordinate system and radian units, while 3D engines, industrial robot controllers and user teaching interfaces may use different axis, angle units, millimeter / meter units and joint positive and negative directions. If only the URDF geometry is imported into the display platform, axis flipping, joint angle offset, TCP (Tool Center Point) pose inconsistency or abnormal linear / joint motion are likely to occur when the inverse kinematics, forward kinematics and real robot are deployed.

[0035] (3) Insufficient runtime import and project saving and recovery capabilities. In practical applications, robot URDF source files may be located in Chinese paths, temporary directories, or external devices, and URDFs usually depend on resources such as meshes (network model files) folders and STL / DAE models. With traditional import methods, the correspondence between kinematic configurations and source URDFs is easily lost once the original files are moved, the project is exported, or the runtime environment changes.

[0036] (4) There is a lack of closed-loop verification between joint editing, kinematics solving and real-time control. Existing tools can modify URDF limits or execute motion commands, but they usually do not map limit changes to the IK (Inverse Kinematics) solver and control SDK in real time, nor do they perform unified verification and rollback for abnormal limits, speeds, additional axes, ground rails or external axes.

[0037] (5) The control interfaces of virtual robots and real robots are not consistent. Offline simulation usually uses a set of playback logic, while real robots are controlled through EIP (EtherNet / IP, Industrial Ethernet Protocol), Modbus, S7 or Socket interfaces. The two are difficult to be consistent in terms of current position, joint sequence, motion completion judgment, speed ratio and status feedback, which reduces the reliability of simulation to actual deployment.

[0038] This application proposes a method and apparatus for robot structure analysis, kinematic mapping, and real-time control. The 3D platform side includes software modules for URDF runtime import, robot model packaging, joint data editing, inverse kinematics control, trajectory planning, and program execution. The control side includes RobotController, RobotManager, and various communication protocol interfaces. Specifically, the URDF import process can read the URDF file package at runtime, create a robot hierarchy, and generate a configuration file for kinematic solving. The IKController (Inverse Kinematics Controller) can initialize the kinematic solver according to the configuration file and read joint symbols, limits, joint types, and PoE (Product of Exponentials) joint data. The RobotProgramRunService, ModeRobotTrackState, and the underlying locoengine (motion trajectory calculation core engine) can execute simulated or real robot motion based on joint sequences, velocities, accelerations, smoothness, motion types, and TCP pose information. The above-mentioned engineering foundation reflects that the technical problem of the embodiments of this application is not simply to display the URDF model, but to establish a unified link from URDF structure analysis to kinematic mapping and then to real-time control execution.

[0039] To make the above-mentioned objectives, features and advantages of this application more apparent and understandable, the application will be further described in detail below with reference to the accompanying drawings and specific embodiments.

[0040] The robot structure analysis, kinematic mapping, and real-time control methods provided in this application can be applied to, for example... Figure 1In the application environment shown, terminal 102 communicates with server 104 via a network. A data storage system can store the data that server 104 needs to process. The data storage system can be set up independently, integrated into server 104, or placed in the cloud or on other servers. Terminal 102 can send the robot URDF source file to server 104. After receiving the robot URDF source file, server 104 performs structured parsing on the source file, extracting link nodes, joint nodes, and the parent links, child links, origin pose, motion axes, and limit parameters of each joint, constructing a link-joint topology tree; based on the link-joint topology tree, it constructs a three-dimensional visualization hierarchy, creates corresponding three-dimensional nodes for each link, and establishes parent-child connection relationships based on joint type and origin pose, forming a renderable robot model; and generates kinematic configuration data based on the link-joint topology tree. The kinematic configuration data includes the number of joints, the zero positions of each joint, the joint direction symbols, the joint limits, and an array of kinematic solution parameters. Based on the kinematic configuration data, a mapping relationship is established between the joint nodes of the 3D visualization hierarchy, the joint array of the kinematic solver, and the joint array of the robot controller. The mapping relationship includes axial remapping, unit conversion, and bidirectional conversion between actual joint values ​​and theoretical joint values. Based on the kinematic configuration data, the mapping relationship, and the renderable robot model, the kinematic solver is initialized, and motion commands are issued to the virtual robot or the real robot using a unified control interface, realizing the reuse of virtual simulation and real machine control. The server 104 can feed back the obtained motion command issuance and execution results to the terminal 102. In addition, in some embodiments, the robot structure analysis, kinematic mapping and real-time control methods can also be implemented separately by the server 104 or the terminal 102. For example, the terminal 102 can directly perform robot structure analysis, kinematic mapping and real-time control processing on the robot URDF source file, or the server 104 can obtain the robot URDF source file from the data storage system and perform robot structure analysis, kinematic mapping and real-time control processing on the robot URDF source file.

[0041] The terminal 102 can be, but is not limited to, various desktop computers, laptops, smartphones, tablets, and IoT devices. The server 104 can be implemented using a standalone server or a server cluster consisting of multiple servers, or it can be a cloud server.

[0042] In one exemplary embodiment, such as Figure 2As shown, a method for robot structure analysis, kinematic mapping, and real-time control is provided. This method is executed by a computer device, specifically a terminal or server, or both. In this embodiment, the method is applied to... Figure 1 Taking server 104 as an example, the following steps are included: S1: Obtain the robot's URDF source file.

[0043] S2: Perform structured parsing on the robot's URDF source file, extract link nodes, joint nodes, and the parent link, child link, origin pose, motion axis, and limit parameters of each joint, and construct a link-joint topology tree.

[0044] S3: Construct a three-dimensional visualization hierarchy based on the link-joint topology tree, create a corresponding three-dimensional node for each link, and establish parent-child connection relationships based on joint type and origin pose to form a renderable robot model.

[0045] S4: Generate kinematic configuration data based on the link-joint topology tree. The kinematic configuration data includes the number of joints, the zero position of each joint, the joint direction symbol, the joint limits, and an array of kinematic solution parameters.

[0046] S5: Based on the kinematic configuration data, establish a mapping relationship between the joint nodes of the 3D visualization hierarchy, the joint array of the kinematic solver, and the joint array of the robot controller. This mapping relationship includes axial remapping, unit conversion, and bidirectional conversion between actual and theoretical joint values.

[0047] S6: Based on the kinematic configuration data, the mapping relationship, and the renderable robot model, initialize the kinematic solver and use a unified control interface to issue motion commands to the virtual robot or the real robot, thereby realizing the reuse of virtual simulation and real machine control.

[0048] By implementing steps S1 to S6 above, a 3D visualization model and kinematic configuration are synchronously generated based on the same robot URDF source file. This unifies the data benchmark, avoids inconsistencies in parameter maintenance across multiple sets, and achieves standardized robot file generation, providing unified data for visualization, kinematics, and real-world control. By establishing mapping relationships between joint nodes at the 3D visualization level, joint arrays in the kinematics solver, and joint arrays in the robot controller—including axial remapping, unit conversion, and bidirectional conversion between actual and theoretical joint values—data adaptation channels are opened up for 3D visualization, motion solving, and the physical controller. This eliminates coordinate and numerical compatibility errors, improving the accuracy of robot modeling and analysis, as well as the stability and safety of real-time control. By reusing the same kinematic configuration and unified control interface, both virtual simulation and real-world control are accommodated, sharing a single underlying logic, simplifying the robot debugging and development process, and improving the efficiency of robot modeling, analysis, and debugging.

[0049] As an optional implementation, after obtaining the robot URDF source file in step S1, the robot structure analysis, kinematic mapping and real-time control method further includes: preprocessing the robot URDF source file, the preprocessing including cleaning file path characters to generate ASCII safe unique key names, creating an import progress state machine and locking the editor interaction in stages.

[0050] As an optional implementation, after obtaining the robot URDF source file in step S1, the robot structure parsing, kinematic mapping, and real-time control method further includes: detecting whether the path where the robot URDF source file is located contains non-ASCII characters or is located in a temporary directory; if so, generating a unique identifier name and copying the robot URDF source file and its associated resource directory as a whole to a persistent cache directory. The original text of the robot URDF source file and the kinematic configuration data are embedded together in the project data, so that if external files are unavailable when the project is loaded, the robot URDF source file can be recovered from the original text of the embedded robot URDF source file and the kinematic configuration data can be regenerated.

[0051] As an optional implementation, step S3, which involves constructing a three-dimensional visualization hierarchy based on the link-joint topology tree, specifically includes the following steps: S31: Determine the root link based on the link-joint topology tree, and use the root link as the robot root node.

[0052] S32: Based on the link-joint topology tree, add a wrapping node to each link node and attach the visual geometry and collision geometry to the wrapping node, while retaining the motion joint node as an independent control link, so that the orientation correction of the visual geometry is decoupled from the joint control axis.

[0053] S33: Add a ground compensation node outside the robot root node, calculate the bottom offset based on the model bounding box, automatically place the robot on the ground reference, and add an ignore mark to the ground compensation node to prevent it from entering the kinematics solution link.

[0054] As an optional implementation, step S5 involves establishing a mapping relationship between the joint nodes of the 3D visualization level, the joint array of the kinematic solver, and the joint array of the robot controller based on the kinematic configuration data. This specifically includes the following steps: S51: Read the rotation axis or translation axis of each joint from the kinematic configuration data, and perform axial rearrangement and direction sign correction in combination with the platform coordinate system to obtain a list of control axes corresponding to the local coordinate system of the 3D engine.

[0055] S52: Based on the control axis list, establish unit conversion rules; the unit conversion rules are used to perform bidirectional conversion between radians and metric units in the robot URDF source file, degrees and millimeters in the user interface, and the internal units of the kinematics solver.

[0056] S53: Based on the control axis list, establish a bidirectional mapping function between actual joint values ​​and theoretical joint values; the bidirectional mapping function includes the Real2Theoretical(actual joint value to theoretical joint value) function and the Theoretical2Real(theoretical joint value to actual joint value) function. The Real2Theoretical function is used to convert the joint values ​​input by the user or returned by the actual controller into the theoretical joint values ​​required by the solver, and the Theoretical2Real function is used to convert the solution results back to actual joint values.

[0057] As an optional implementation, after step S53, which establishes a bidirectional mapping function between actual joint values ​​and theoretical joint values ​​based on the control axis list, the robot structure analysis, kinematic mapping, and real-time control method further includes the following steps: S54: Joint limit verification and synchronization steps, specifically including: when the joint limit parameters change, verifying the joint limit parameters to determine whether the lower limit of the joint travel corresponding to the joint limit parameter is less than the upper limit of the joint travel and whether the joint running speed is greater than or equal to zero. If the verification fails, the joint limit parameters are rolled back to the previous valid cached value. If the verification passes, the verified joint limit parameters are synchronized and updated in real time to the kinematics solver, the robot controller, and the embedded and saved robot URDF source file, maintaining consistency among the three.

[0058] As an optional implementation, after initializing the kinematics solver in step S6, the robot structure analysis, kinematic mapping, and real-time control method further includes: an additional axis processing step, specifically including the following steps: When the robot includes a ground rail, a positioner, a cantilever, or an external additional axis, the additional axis information is calculated; the additional axis information includes the origin position, axis, axis type, and upper and lower limits of each additional axis.

[0059] The additional axis information is registered to the kinematics solver so that when the analytical inverse kinematics solution fails, the numerical inverse kinematics solver can be invoked to jointly solve all joints containing the additional axis.

[0060] As an optional implementation, step S6 involves issuing motion commands to the virtual robot or the real robot using a unified control interface, specifically including the following steps: For the virtual robot, after setting the initial values ​​of the current joints, trajectory data including joint sequence, tool center point frame, velocity, acceleration, smoothness and motion type is sent out.

[0061] For the real robot, a connection is established through a configurable communication protocol, including at least one of the Industrial Ethernet protocol, Modbus protocol, S7 protocol, or custom Socket protocol; during the execution of the real robot, the current joint coordinates, motion state, and input / output state are obtained through state callback or polling, and the robot model posture in the three-dimensional visualization layer is updated synchronously to form a digital twin closed loop.

[0062] In this embodiment, a virtual robot refers to a robot object whose forward and inverse kinematics solutions and trajectory interpolation are completed by a software kinematics engine, without establishing industrial communication with a physical controller, and which relies on the URDF motion model to achieve offline trajectory preview and program debugging in 3D environments such as Unity and Unreal. A real robot, on the other hand, refers to a robot object that interacts with a physical controller via industrial buses such as EtherCAT, S7, and EIP (connect_protocol), where a host computer issues motion commands to drive the physical mechanical structure, and the actual joint states are periodically read from the hardware feedback. Virtual and real robots share the same RobotInfo (top-level robot information carrier), link topology, limit parameters, and upper-level motion API. The simulation field distinguishes between modes, allowing for easy switching between virtual and real modes without significant modifications to the upper-level business code.

[0063] As an optional implementation, the robot structure analysis, kinematic mapping, and real-time control method further includes an automatic collision body generation step, specifically including: automatically generating simplified collision bodies based on a visual mesh, wherein the collision body type includes at least one of box, cylinder, sphere, capsule, convex hull, or triangular mesh; the generated collision body is used for offline motion planning, reachability checking, and safety boundary prompting, wherein the offline motion planning relies on the robot topology, joint constraints, and automatically generated collision geometry obtained from URDF analysis to complete target point teaching, trajectory interpolation optimization, and collision pre-detection in a virtual environment, generating a complete motion trajectory that can be directly reused in a physical robot; The performance check is based on the forward and inverse kinematics capabilities of a unified kinematic configuration. It verifies the inverse kinematics results and the travel constraints of each joint for a single target or the entire trajectory, and is synchronously compatible with additional axes such as ground rails and positioners. It also filters out invalid points and paths that exceed the robot's range of motion in advance. The safety boundary warning uses real-time distance detection between the robot and environmental collision objects to distinguish between three types of safety zones: joint critical limit, robot self-collision, and external environment collision. When approaching the danger threshold, it provides visual highlighting and pop-up warnings. In severe cases, it can pause motion transmission. All three share the same set of underlying motion and collision data generated by URDF parsing, and can be linked for verification in the entire offline planning process to avoid operational risks such as exceeding limits and collisions in advance.

[0064] As an optional implementation, the robot structure analysis, kinematic mapping, and real-time control method further includes persistent recovery verification and motion anomaly blocking steps, specifically including: restoring URDF and kinematic configuration data from persistent fields when the project is loaded; automatically re-running the parsing and generation process when the configuration is missing; detecting anomalies such as file corruption, inverse kinematics without effective joint sequences, and joint over-limits and blocking motion transmission; and outputting a fully restored robot control configuration, fault log, and motion transmission allow or block flags.

[0065] In an exemplary embodiment, to illustrate the technical solution provided by the embodiments of this application, a method for robot structure analysis, kinematic mapping, and real-time control is provided. This method can be executed by a software system running in a 3D simulation and digital twin platform, or by a computer device including a processor and memory. For ease of explanation, the software system in the 3D simulation and digital twin platform can be divided into a URDF source file acquisition module, a URDF structure analysis module, a visualization hierarchy construction module, a kinematic configuration generation module, a joint mapping module, a kinematic solution module, a real-time control module, a persistent recovery module, and a collision-additional axis extension module. Each module can be an independent software module or different functional units within the same program. The system comprises several modules: URDF source file acquisition module for acquiring the robot's URDF source file; URDF structure parsing module for structural parsing of the URDF source file, extracting links, joints, corresponding parent-child links, origin pose, motion axes, and limit parameters, and constructing a link-joint topology tree; visualization hierarchy construction module for building a 3D visualization hierarchy based on the link-joint topology tree, creating 3D nodes for each link, and establishing parent-child connections based on joint type and origin pose to generate a renderable robot model; kinematic configuration generation module for generating kinematic configuration data based on the link-joint topology tree, including the number of joints, joint zero points, joint direction symbols, joint limits, and kinematic solution parameter arrays; and joint mapping module for establishing a 3D visualization hierarchy based on the kinematic configuration data. The mapping relationship between joint nodes, kinematic solver joint arrays, and robot controller joint arrays enables axial remapping, unit conversion, and bidirectional conversion between actual and theoretical joint values. The kinematic solver module completes the initialization solution based on kinematic configuration data and a renderable robot model. The real-time control module issues motion commands through a unified control interface, enabling reuse of virtual robot simulation and real robot control. The persistent recovery module embeds the original URDF text and kinematic configuration data into the project data; if external files fail, the source files can be recovered and the configuration regenerated. The collision-additional axis extension module can process additional axis information such as ground rails and positioners and register it to the kinematic solver, while generating collision geometry for offline motion planning, reachability checks, and safety boundary hints. The corresponding method specifically includes the following implementation steps: Step 1: Obtaining and preprocessing the robot's URDF source file, specifically including the following steps: S1. Receive the user-selected robot URDF source file path and parse the resource directory where the robot URDF source file is located. If the robot URDF source file path contains Chinese characters, spaces, special symbols, or external temporary directories, generate a unique key name (keyName) and copy the entire URDF directory to the ASCII security cache path in the application's persistent directory, for example, "UrdfImportCache / keyName / source / package". This ensures that relative resources such as mesh and material referenced within the robot URDF source file remain accessible during runtime import.

[0066] S2. Clean the unique key name keyName: keep letters and numbers, and replace the rest with underscores; if the original file name is empty, use the default name urdf_robot; then append a unique identifier to avoid the robot configuration files generated when importing the same robot URDF source file with the same name repeatedly.

[0067] S3. Create import progress states, such as preparation, robot creation, configuration generation, initialization, and completion stages, to lock the editor state and prompt the user when importing complex robots at runtime. Figure 3 The import progress UI is shown.

[0068] Step 2: Structured parsing of the robot's URDF source file, specifically including the following steps: S4. The robot URDF source file is read using XML structured parsing, without extracting parameters by string truncation. First, the robot root node is read to obtain the robot name; then all link nodes, joint nodes, material nodes, and the optional disable_collision node are read.

[0069] S5. Construct a link-joint topology tree based on the parent link and child link in the joint. The joint fields resolved for each joint node include: name, type, parent link, child link, xyz and rpy (roll-pitch-yaw) of origin, xyz of axis, lower (lower limit of joint travel), upper (upper limit of joint travel), effort (maximum joint load), velocity (maximum joint velocity), and damping and friction parameters of dynamics. Each link resolves at least the visual model, collision model, inertial model, and mesh resource path.

[0070] S6. Determine the root link from the link-joint topology tree. If multiple link nodes and joint nodes exist, backtrack upwards along the child links of the joint node until a link node without a parent link is identified as the robot's root node; if no joint node exists, the first link node is identified as the robot's root node. This yields a recursively traversable robot topology, avoiding discrepancies in import results due to different node orders in the robot's URDF source file.

[0071] As an optional implementation, the structured parsing of the robot URDF source file is performed by a URDF parser. This URDF parser can be replaced by any XML parsing library, or the XACRO macro file can be preprocessed into a robot URDF source file before implementing the method of this application. The parsing result can be stored as JSON, YAML, binary cache, or database record.

[0072] Step 3: Runtime visualization of the hierarchy, which includes the following steps: S7. Recursively create a 3D object hierarchy according to the link-joint topology tree: create a link node for each link, import the origin pose relative to the parent node for each joint, and create joint descriptions such as fixed, rotational, continuous rotational, and translational joints according to the joint type. Create visual child nodes and collision child nodes for the Visual model and Collision model respectively, and load box (cuboid), cylinder (cylinder), sphere (sphere), or mesh geometry.

[0073] S8. Perform coordinate system correction. Since the default top axis and left / right hand system of URDF, ROS and 3D engine may be different, this embodiment sets the import axis to zAxis (z coordinate axis, joint motion reference coordinate axis) and applies a predetermined axis transformation to the vision and collision mesh; at the same time, the base_link (robot's whole body base link) is promoted to the robot's root node at runtime, so that the subsequent inverse kinematics controller can sequentially search for each joint link from the robot's root node downwards.

[0074] S9. Construct a hierarchical wrapper suitable for IK control. Add a wrapper node to each link node, and apply a preset yaw angle, such as 90 degrees, around the local Y-axis to the wrapper node; attach the Visual model and Collision model to the wrapper node, while keeping the motion joint nodes as link nodes that can be directly controlled by IK. This step decouples the orientation correction of URDF visual geometry from the joint control axis, avoiding mutual contamination between kinematic calculations and display pose caused by directly rotating the link node.

[0075] S10. Add a ground compensation node outside the robot root node, count the bounding boxes of all renderers or colliders, calculate the offset between the lowest point of the model and the robot root node, and automatically place the model on the ground reference. By adding an ignore flag to the ground compensation node, this auxiliary level is skipped during IK link lookup.

[0076] S11. Add project save markers, runtime editing exposed components, RobotModel component, IKController component, and URDFJointEditor component to the imported robot. After importing, the temporary URDF import components and physical joint components can be removed, retaining only the unified robot model, kinematics, and control components of this 3D simulation and digital twin platform.

[0077] Step 4: Generate kinematic configuration data, which includes the following steps: S12. Call the robot URDF source file to the robot control configuration generation interface, convert the robot URDF source file into JSON format kinematic configuration data, and write it to the UrdfRobotConfig (URDF robot configuration) directory. Figure 4The robot's URDF joint parameter setting interface is shown. This kinematic configuration data includes the robot brand / model identifier, number of joints, `joint_zeroes` (joint zero-position array), `joint_signs` (joint direction signs), `joint_limits` (joint constraint set), robot base coordinate transformation, `PoE_joint` (exponential product joint parameter array), and end effector pose. `PoE_joint` records the position vector, rotation axis or translation axis, joint type, and optional ignore flags for each joint relative to the robot's base coordinate system (Base Frame). The robot base coordinate system is the global root reference coordinate system for all kinematic calculations of the entire robot.

[0078] As an alternative implementation, the kinematic model of the robot object is not limited to the PoE form. It can also be converted into DH parameters, improved DH parameters, helical theory model, Jacobian numerical model or manufacturer controller model, as long as a data structure that can be used for forward and inverse kinematics is generated from the URDF topology, origin, axis and limit.

[0079] S13. Write the generated configuration file name, configuration file content, source URDF file name, and source URDF text into the serialization field of the robot object. This allows the project to be recovered from the project data even if the original URDF file or the generated configuration file is not in the original path after the project is saved.

[0080] S14. When the robot starts, IKController first checks whether URDF configuration was imported. If embedded configuration JSON exists, it is restored to the persistent directory "UrdfImportedRecovery / robot_name / generated"; if embedded URDF text exists, it is restored to "UrdfImportedRecovery / robot_name / source". If the configuration file is missing but the robot's URDF source file can be recovered, the URDF parsing and generation interface is called again to regenerate the configuration.

[0081] Step 5, Joint Data Mapping, specifically includes the following steps: S15. Read the kinematics configuration JSON and initialize SBTMpc (model prediction control unit) or equivalent kinematics solver; obtain JointSigns (array of joint direction signs), LowerLimit (lower limit of joint travel), UpperLimit (upper limit of joint travel), and JointType (joint type). Among the joint types, translational joints are treated as linear displacements, and rotational joints are treated as angles.

[0082] S16. Read the rotation_axis (ROS standard motion axis) or kunwu_axis (internal unified motion axis after direction correction by the joint mapping module and JointSigns) from PoE_joint as the joint control axis. Perform axial rearrangement and absolute axis extraction according to the platform coordinate system. For example, map the URDF axis to the x, y, z control components local to the 3D engine, and restore the positive and negative directions by combining joint_signs. This yields the robotRotateAxis list (an array list storing the motion axes of all robot rotation joints), which serves as the basis for subsequent SetLink (the underlying interface for updating the link coordinate system) control of each joint node.

[0083] S17. Establish unit conversion. When URDF limits and speeds are expressed in radians, URDFJointEditor can convert them to degrees for user interface display during reading; when the user selects radian display, it retains the radians. When saving back to URDF, it is uniformly converted back to radians and written to the limit node. When the internal movement of the joint is displayed and controlled in millimeters, it is calculated by dividing by 1000 in meters when mapping to 3D position.

[0084] The joint units can be uniformly set to any of the following: radians, degrees, meters, or millimeters, as long as a consistent mapping is maintained between URDF read / write, user display, solver input, and controller output. Joint limits, zero points, and symbols can be derived from URDF, robot configuration files, manufacturer controller read values, manual calibration results, or project templates; priority and difference prompts can be set when multiple sources conflict.

[0085] S18. Establish a bidirectional mapping function between actual joint values ​​and theoretical solution values. This bidirectional mapping function includes the Real2Theoretical function and the Theoretical2Real function. For joint angles input by the user or returned by the actual controller, the Real2Theoretical function first converts them into the theoretical joint values ​​required by the solver; when displayed or output to the user, the Theoretical2Real function converts them back to actual joint values. This mapping absorbs differences in robot zero points, orientations, couplings, or manufacturer joint definitions.

[0086] S19. When changing joint limits, perform validation: lower must be less than upper, and velocity must be greater than or equal to 0. If the validation fails, it indicates that the input is invalid, and the system will roll back to the previous valid cached value. If the validation passes, the valid limit will be written to the IKController's LowerLimit and UpperLimit in real time, and simultaneously saved to the robot's URDF source file and the embedded backup.

[0087] Step Six: Forward and Inverse Kinematic Mapping, specifically including the following steps: S20. Create the tool center point TCP, the user coordinate system USER, and the target point target. The target must contain at least three drag-and-drop teaching modes: TCP coordinates, robot coordinates, and world coordinates. A default target point is established based on the EE_Frame (end effector coordinate system) during robot initialization.

[0088] S21. During inverse kinematics solving, the target pose is converted into solver input: target position xyz, target quaternion qxyz, robot base position bxyz, robot base quaternion bqxyz, current joint initial value jc, TCP offset, USER offset, and solver priority. For example, position priority over attitude is represented as P>O, where P refers to the position component in the target pose, i.e., the target position xyz; O refers to the attitude component in the target pose, i.e., the target quaternion qxyz. After the solver returns the single (low-level motion control mode identifier, used for independent movement of a single joint) joint array, SetLink is called joint by joint.

[0089] As an alternative implementation, inverse kinematics can be solved by an inverse kinematics solver, which can be replaced by analytical solutions, numerical solutions, damped least squares, optimization solutions, sampling search, or machine learning solvers. For robots with ground rails and external axes, constraint optimization or hierarchical solving can also replace the NumSolve (numerical inverse kinematics unit) inside the IKController.

[0090] S22. SetLink is handled differently depending on the joint type: If it is a prismatic joint, the local position of the corresponding link node is changed according to the mapped prismaticAxis (translation axis of the prismatic joint); if it is a rotary joint, the local Euler rotation is set according to robotRotateAxis (robot rotary joint motion axis), joint angle and JointSigns; if there is a synchronous rotation component, synchronization is triggered; if there is a special quasi-serial mechanism, the child node posture is corrected according to its structural relationship.

[0091] S23. When displaying forward kinematics, input the current theoretical joint array into SolveFKUnity (forward kinematics solution) or the equivalent FK (Forward Kinematics) interface to obtain the actual position and orientation of the end effector; at the same time, convert the theoretical joint values ​​into actual joint values ​​and update the display fields of link1~link6 of the six-axis serial robotic arm.

[0092] S24. When the robot includes ground rails, internal auxiliary axes, or external axes, the numerical inverse kinematics (NumSolve) function is invoked after the normal analytical inverse kinematics solution fails. The numerical inverse kinematics function takes as input all current joints, end-effector target position, end-effector pose, auxiliary axis lock list, and TCP / flange conversion information, and outputs joint results including the six-axis body and auxiliary axes.

[0093] Step 7: Real-time control execution, specifically including the following steps: S25. When entering trajectory planning or program running state, initialize the robot control SDK, register the robot ID and kinematic configuration content generated by URDF with the SDK. If the robot includes a ground rail, cantilever, positioner, or external axis, calculate joint_r (additional axis origin), joint_w (additional axis motion axis), joint_type (additional axis type), joint_high (additional axis upper limit), and joint_low (additional axis lower limit) according to the Transform (system underlying coordinate transformation calculation unit) of the corresponding device in the platform, and call add_axis_info (body joint write interface) or add_outaxis_info (external additional axis write interface) to write to the SDK.

[0094] S26. For the virtual robot, before execution, set the current joint using `setCurrentJoint` (update current joint state interface), then call `motion_array` (motion task distribution array) to distribute the joint sequence `jts`, TCP frame `tcpframe`, velocity `vel`, acceleration `acc`, smoothness `smooth`, motion type `moveType`, segment flag `flag`, and coordination flag `synergy`. The program execution service saves the final target joint, enters the debug motion state, and polls in each frame `Tick` whether the robot has completed its motion, whether the waiting input is satisfied, and whether the delay has ended.

[0095] S27. For real robots, create a RobotInfo file using RobotManager and add the robot. RobotInfo can include fields such as simulation, brand (device brand), model (device model), IP (IP address), robotId (robot ID), modelFilePath (original path to the model file), connect_protocol, EIP packet size, EIP path, Modbus read / write registers, S7 DB block, port, number of retries, and timeout. connect_protocol can be selected from protocols such as EIP, Modbus, S7, or Socket.

[0096] S28. During actual robot control, joint coordinates or Cartesian coordinates can be obtained through `robot_get_cur_pos` (robot current pose acquisition command), joint movements can be executed through `robot_move_j` (joint movement command), linear movements through `robot_move_l` (linear movement command), circular movements through `robot_move_arc` (circular movement command), relative offset movements to the base or tool coordinates through `robot_move_lr` (relative offset linear movement command), and linked digital outputs during movement through `robot_move_ldo` (external axis coordinated linear movement command). The motion interface returns an indication of whether the command was successfully issued; whether the target point has been reached is confirmed through `robot_is_arrived` (robot positioning detection interface) or a status callback.

[0097] S29. Establish connection status, real-time coordinates, Socket general data, and motion status callbacks. The system updates the virtual model based on the callback or polling results to synchronize the real robot position with the digital twin model; at the same time, it calls motionPause (motion pause), motionStart (motion start), motionEnd (motion end), or reset_robot (robot reset) in case of exception, pause, resume, or end.

[0098] As an optional implementation, real-time communication can be replaced with EtherCAT, OPC UA, Profinet, ROS2Control, CANopen, vendor SDK, or custom TCP / UDP protocols; the motion interface can adopt joint point positioning, Cartesian point positioning, speed servo, trajectory streaming, or controller program calls.

[0099] Step 8, Persistence and Exception Handling, specifically includes the following steps: S30. After each URDF joint parameter is saved, the embedded URDF text and configuration JSON are updated synchronously. Each time the project loads, if external files are unavailable, they are restored from the embedded fields. The restored directory name is obtained by cleaning the filenames, replacing illegal characters with underscores to avoid cross-platform file system errors.

[0100] S31. If the configuration file fails to read, the URDF is missing the robot root node, the joint has no name or limit node, the kinematics creation fails, the solver returns an empty array, or the number of joint types does not match the number of links, then the error is recorded and motion commands are prevented from being issued to prevent the faulty model from driving the real robot.

[0101] S32. The system can also automatically generate or simplify Collision colliders based on the Visual model mesh, supporting collisions of boxes, cylinders, spheres, capsules, convex hulls, or triangular meshes; the generated collision collider results can be used for offline planning, reachability checks, and safety boundary hints. Figure 5 The interactive UI interface for the collider generation results is shown. The persistence mechanism can employ file recovery, project database, resource packages, cloud model libraries, or versioned asset systems; the key is to simultaneously save the source URDF and the generated configuration, and to automatically recover or regenerate it if missing.

[0102] The robot structure analysis, kinematic mapping, and real-time control method proposed in this application has the following technical advantages: (1) The visualization hierarchy, kinematic configuration and control configuration are generated at once from the robot URDF source file. Since steps S4 to S14 not only parse the link and joint, but also generate the control data such as PoE_joint, joint_limits, joint_signs, and joint_zeroes, the inconsistency caused by maintaining the visual model, kinematic model and control model separately is avoided.

[0103] (2) Improve the reliability of URDF model migration to industrial robot control scenarios. Through the coordinate system, axis, symbol and unit mapping in steps S8, S9 and S16 to S18, the same robot URDF source file can be used for 3D display, IK solution, FK display and real controller distribution at the same time, reducing problems such as axis flipping, angle unit error and zero position inconsistency.

[0104] (3) Lowering the threshold for robot modeling. Users only need to provide the robot URDF source file and its resource directory, and the system can automatically determine the root link, topological relationship, joint type, limit and control axis, and generate an SDK-readable configuration file; compared with manually writing DH tables or manufacturer-specific model files, the modeling efficiency is higher.

[0105] (4) Improve project portability and recoverability. Through steps S1, S13, S14 and S30, the robot URDF source file and the generated JSON can be embedded with project data and restored in the persistent directory. Even if the original file is moved, the path contains Chinese characters or the import cache is cleared, the kinematic configuration can be regenerated.

[0106] (5) Enhance motion safety. Steps S19 and S31 verify the limit, speed, configuration file, number of joints and solution results. If there is an abnormality, roll back or prevent the command from being issued. Steps S25 to S29 use status feedback to determine whether the motion is completed, so as to avoid mistakenly believing that the robot has arrived at the correct position based solely on the successful issuance of the command.

[0107] (6) Supports consistent debugging links between virtual and real robots. The virtual robot uses setCurrentJoint and motion_array for execution, while the real robot uses RobotManager and multi-protocol communication for execution. However, both share the kinematic configuration, joint sequence, TCP frames and velocity / acceleration / smoothness parameters generated from the same robot URDF source file. Therefore, offline trajectories are easier to transfer to the real robot.

[0108] (7) High scalability. The method proposed in this application is not only applicable to six-axis industrial robots, but can also be extended to composite robot systems containing mobile joints, ground rails, positioners, cantilever arms, external axes, tool coordinates, and user coordinates. Additional axis information is written to the solver through add_axis_info and add_outaxis_info, avoiding treating external axes as ordinary static environments.

[0109] (8) Facilitates the formation of a closed-loop digital twin. Since the current joints, current Cartesian pose, motion state, and I / O state of the real robot can be fed back to the 3D platform, the 3D model can reflect the robot's execution state in real time, providing a unified foundation for teaching, planning, simulation verification, production monitoring, and anomaly diagnosis. The 3D platform is not limited to Unity; it can also be implemented in Unreal, WebGL, Three.js, OpenSceneGraph, or a self-developed 3D engine. The runtime hierarchical wrapping, coordinate axis correction, and vision / collision separation operations remain consistent.

[0110] This application proposes a method for robot structure analysis, kinematic mapping, and real-time control. This method forms a unified link from the robot's URDF source file to the robot visualization hierarchy, kinematic solution configuration, and real-time control execution. It does not simply import the URDF model for display, nor does it perform motion planning separately. Instead, it takes information such as link and joint topology, origin, axis, limit, visual, and collision in the URDF, and performs coordinate system correction, IK-friendly hierarchical packaging, PoE / joint limit / joint symbol configuration generation, bidirectional mapping between real and theoretical values, joint unit conversion, and SDK registration to form a unified data foundation that can be directly used for the control of virtual and real robots. After importing the URDF at runtime, a robot control configuration JSON is automatically generated, and this configuration, along with the source URDF, is bound to a persistent field of the robot object. Based on the URDF joint axes, joint types, joint limits, and `joint_signs` in the generated configuration, a one-to-one mapping is established between the 3D model joint nodes, the kinematics solver joint array, and the controller joint array. Through bidirectional conversion between real and theoretical joint values, consistency is maintained between user display, 3D pose, kinematics solving, and real robot control. The same kinematic configuration simultaneously supports virtual motion playback and real-time multi-protocol control of the robot. To address path compatibility issues, this embodiment copies the resource directory containing the robot URDF source file to an ASCII secure cache directory and generates a unique keyName to ensure that relative resources such as mesh can be parsed. The `base_link` is promoted to the robot root node, and an IK-friendly wrapper node is created for each link to prevent visual / collision orientation correction from affecting joint control axes. The imported model is automatically placed on the ground using ground compensation root nodes and bounding box detection, while auxiliary nodes are prevented from entering the IK link by ignoring markers. The URDFJointEditor performs radian to degree conversion, validity checks, cache rollback, and automatic saving on the lower, upper, and velocity parameters in the limit. When a configuration file is missing, the source file can be recovered from the embedded URDF text and the control configuration regenerated, enhancing the reliability of project migration and offline deployment. The origin, axis, type, and limits are calculated for the ground track, internal auxiliary axes, and external axes respectively, and registered to the solver, enabling composite robots to use the same control flow. Motion execution uses a unified trajectory data structure composed of a target joint list, current joint, TCP frame, velocity, acceleration, smoothness, motion type, segment flag, and cooperation flag, facilitating sharing between virtual debugging and real-world deployment. The real robot interface supports current position acquisition, joint motion, linear motion, circular motion, relative motion, I / O linkage, connection status callback, and position determination, forming a closed-loop motion control.

[0111] In one exemplary embodiment, a computer device is provided, which may be a server or a terminal, and its internal structure diagram may be as follows. Figure 6 As shown, this computer device includes a processor, memory, input / output (I / O) interfaces, and a communication interface. The processor, memory, and I / O interfaces are connected via a system bus, and the communication interface is also connected to the system bus via the I / O interfaces. The processor provides computational and control capabilities. The memory includes non-volatile storage media and internal memory. The non-volatile storage media stores the operating system, computer programs, and a database. The internal memory provides the environment for the operating system and computer programs stored in the non-volatile storage media. The database stores the robot's URDF source files. The I / O interfaces are used for exchanging information between the processor and external devices. The communication interface is used for communication with external terminals via a network connection. When executed by the processor, the computer program implements a method for robot structure analysis, kinematic mapping, and real-time control.

[0112] Figure 6 The structures shown are merely block diagrams of some structures related to the present application and do not constitute a limitation on the computer device to which the present application is applied. Specific computer devices may include more or fewer components than shown in the figures, or combine certain components, or have different component arrangements. In an exemplary embodiment, a computer device is provided, including a memory and a processor. The memory stores a computer program, and the processor executes the computer program to implement the steps in the above-described method embodiments.

[0113] In one exemplary embodiment, a computer-readable storage medium is provided storing a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0114] In one exemplary embodiment, a computer program product is provided, including a computer program that, when executed by a processor, implements the steps in the above-described method embodiments.

[0115] It should be noted that the user information (including but not limited to user device information, user personal information, etc.) and data (including but not limited to data used for analysis, data stored, data displayed, etc.) involved in this application are all information and data authorized by the user or fully authorized by all parties, and the collection, use and processing of related data must comply with relevant regulations and be authorized by the owner of the corresponding device.

[0116] Those skilled in the art will understand that all or part of the processes in the above embodiments can be implemented by a computer program instructing related hardware. The computer program can be stored in a non-volatile computer-readable storage medium. When executed, the computer program can include the processes of the embodiments described above. Any references to memory, databases, or other media used in the embodiments provided in this application can include at least one of non-volatile and volatile memory. Non-volatile memory can include read-only memory (ROM), magnetic tape, floppy disk, flash memory, optical memory, high-density embedded non-volatile memory, resistive random access memory (ReRAM), magnetic random access memory (MRAM), ferroelectric random access memory (FRAM), phase change memory (PCM), graphene memory, etc. Volatile memory can include random access memory (RAM) or external cache memory, etc. By way of illustration and not limitation, RAM can take many forms, such as Static Random Access Memory (SRAM) or Dynamic Random Access Memory (DRAM).

[0117] The databases involved in the embodiments provided in this application may include at least one type of relational database and non-relational database. Non-relational databases may include, but are not limited to, distributed databases based on blockchain. The processors involved in the embodiments provided in this application may be, but are not limited to, general-purpose processors, central processing units, graphics processing units, digital signal processors, programmable logic devices, quantum computing-based data processing logic devices, etc.

[0118] The technical features of the above embodiments can be combined in any way. For the sake of brevity, not all possible combinations of the technical features in the above embodiments are described. However, as long as there is no contradiction in the combination of these technical features, they should be considered to be within the scope of this specification.

[0119] This document uses specific examples to illustrate the principles and implementation methods of this application. The descriptions of the above embodiments are only for the purpose of helping to understand the methods and core ideas of this application. Furthermore, those skilled in the art will recognize that, based on the ideas of this application, there will be changes in the specific implementation methods and application scope. Therefore, the content of this specification should not be construed as a limitation of this application.

Claims

1. A method for robot structure analysis, kinematic mapping, and real-time control, characterized in that, include: Obtain the robot's URDF source file; The robot's URDF source file is structured and parsed to extract link nodes, joint nodes, and the parent link, child link, origin pose, motion axis, and limit parameters of each joint, and a link-joint topology tree is constructed. A three-dimensional visualization hierarchy is constructed based on the link-joint topology tree. A corresponding three-dimensional node is created for each link, and a parent-child connection relationship is established according to the joint type and origin pose to form a renderable robot model. Kinematic configuration data is generated based on the link-joint topology tree; the kinematic configuration data includes the number of joints, zero position of each joint, joint direction symbol, joint limit, and kinematic solution parameter array; Based on the kinematic configuration data, a mapping relationship is established between the joint nodes of the three-dimensional visualization level, the joint array of the kinematic solver, and the joint array of the robot controller; The mapping relationship includes axial remapping, unit conversion, and bidirectional conversion between actual joint values ​​and theoretical joint values; Based on the kinematic configuration data, the mapping relationship, and the renderable robot model, the kinematic solver is initialized, and motion commands are issued to the virtual robot or the real robot using a unified control interface, thereby realizing the reuse of virtual simulation and real machine control.

2. The robot structure analysis, kinematic mapping, and real-time control method according to claim 1, characterized in that, After obtaining the robot URDF source file, the robot structure parsing, kinematic mapping, and real-time control method further includes: detecting whether the path where the robot URDF source file is located contains non-ASCII characters or is located in a temporary directory; if so, generating a unique identifier name and copying the robot URDF source file and its associated resource directory as a whole to a persistent cache directory; after generating the kinematic configuration data, the original text of the robot URDF source file and the kinematic configuration data are jointly embedded into the project data, so that if external files are unavailable when the project is loaded, the robot URDF source file can be recovered from the original text of the embedded robot URDF source file and the kinematic configuration data can be regenerated.

3. The robot structure analysis, kinematic mapping, and real-time control method according to claim 1, characterized in that, A three-dimensional visualization hierarchy is constructed based on the aforementioned link-joint topology tree, specifically including: The root link is determined based on the link-joint topology tree, and the root link is used as the root node of the robot. Based on the link-joint topology tree, a wrapping node is added to each link node, and the visual geometry and collision geometry are attached to the wrapping node. At the same time, the motion joint node is retained as an independent control link, so that the orientation correction of the visual geometry is decoupled from the joint control axis. A ground compensation node is added outside the robot root node. The bottom offset is calculated based on the model bounding box to automatically place the robot on the ground reference. An ignore mark is added to the ground compensation node to prevent it from entering the kinematics solution link.

4. The robot structure analysis, kinematic mapping, and real-time control method according to claim 1, characterized in that, Based on the kinematic configuration data, a mapping relationship is established between the joint nodes of the 3D visualization hierarchy, the joint array of the kinematic solver, and the joint array of the robot controller, specifically including: The rotation or translation axes of each joint are read from the kinematic configuration data, and the axes are rearranged and the direction signs are corrected in combination with the platform coordinate system to obtain a list of control axes corresponding to the local coordinate system of the 3D engine. Based on the control axis list, a unit conversion rule is established; the unit conversion rule is used to perform bidirectional conversion between radians and meters in the robot URDF source file, degrees and millimeters in the user interface, and the internal units of the kinematics solver; Based on the control axis list, a bidirectional mapping function between actual joint values ​​and theoretical joint values ​​is established. The bidirectional mapping function includes the Real2Theoretical function and the Theoretical2Real function. The Real2Theoretical function is used to convert the joint values ​​input by the user or returned by the actual controller into the theoretical joint values ​​required by the solver. The Theoretical2Real function is used to convert the solution results back into actual joint values.

5. The robot structure analysis, kinematic mapping, and real-time control method according to claim 4, characterized in that, After establishing a bidirectional mapping function between actual joint values ​​and theoretical joint values ​​based on the control axis list, the robot structure analysis, kinematic mapping, and real-time control method further includes: joint limit verification and synchronization steps, specifically including: When the joint limit parameters change, the joint limit parameters are verified to determine whether the lower limit of the joint stroke corresponding to the joint limit parameters is less than the upper limit of the joint stroke and whether the joint running speed is greater than or equal to zero. If the verification fails, the joint limit parameter will be rolled back to the previous valid cache value; If the verification passes, the verified joint limit parameters are synchronously updated in real time to the kinematics solver, the robot controller, and the embedded and saved robot URDF source file.

6. The robot structure analysis, kinematic mapping, and real-time control method according to claim 1, characterized in that, Following the initialization of the kinematics solver, the robot structure analysis, kinematic mapping, and real-time control method further includes: an additional axis processing step, specifically including: When the robot includes a ground rail, a positioner, a cantilever, or an external additional axis, the additional axis information is calculated; the additional axis information includes the origin position, axis, axis type, and upper and lower limits of each additional axis; The additional axis information is registered to the kinematics solver so that when the analytical inverse kinematics solution fails, the numerical inverse kinematics solver can be invoked to jointly solve all joints containing the additional axis.

7. The robot structure analysis, kinematic mapping, and real-time control method according to claim 1, characterized in that, Using a unified control interface to issue motion commands to virtual or real robots, specifically including: For the virtual robot, after setting the initial values ​​of the current joints, trajectory data including joint sequence, tool center point frame, velocity, acceleration, smoothness and motion type is sent out; For the real robot, a connection is established through a configurable communication protocol, including at least one of the Industrial Ethernet protocol, Modbus protocol, S7 protocol, or custom Socket protocol; during the execution of the real robot, the current joint coordinates, motion state, and input / output state are obtained through state callback or polling, and the robot model posture in the three-dimensional visualization layer is updated synchronously to form a digital twin closed loop.

8. A computer device, comprising: A memory, a processor, and a computer program stored in the memory and capable of running on the processor, characterized in that the processor executes the computer program to implement the robot structure analysis, kinematic mapping, and real-time control method according to any one of claims 1-7.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When executed by a processor, the computer program implements the robot structure analysis, kinematic mapping, and real-time control method as described in any one of claims 1-7.

10. A computer program product, comprising a computer program, characterized in that, When executed by a processor, the computer program implements the robot structure analysis, kinematic mapping, and real-time control method as described in any one of claims 1-7.