Clothing joint simulation method and equipment based on robot and Mujoo

By defining robot models and flexible fabric objects in the Mujoco simulation environment, using GPU simulation kernels to solve the flexible clothing body in parallel and performing self-intersection and overlap processing, and combining BVH to accelerate collision detection, the problems of clipping and shaking in the clothing simulation system under complex scenes are solved, and high-precision and efficient simulation of interaction between flexible and rigid bodies is achieved.

CN121723734APending Publication Date: 2026-03-24杨睿刚
View PDF 0 Cites 0 Cited by

Patent Information

Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2025-10-29
Publication Date
2026-03-24

AI Technical Summary

Technical Problem

Existing clothing simulation systems are prone to problems such as clipping, jitter, and computational delay when simulating complex topological deformation and high contact density scenarios, making it difficult to accurately model in the simulation environment and resulting in poor performance in the real physical world.

Method used

A co-simulation method for clothing based on robots and Mujoco is adopted. The robot model and flexible fabric object are defined in Mujoco simulation through the FlexComp plugin. The flexible clothing body is solved in parallel using GPU simulation kernel, and self-intersection and overlap processing are performed. Collision detection is accelerated by BVH to realize the coupling interaction and co-simulation closed loop of flexible body and rigid body.

Benefits of technology

It improves the accuracy and robustness of clothing simulation, effectively prevents penetration and collapse under high-complexity contact, greatly improves simulation efficiency, supports real-time interactive simulation of flexible and rigid bodies, and significantly improves the stability and computational efficiency in robot operation scenarios.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN121723734A_ABST
    Figure CN121723734A_ABST
Patent Text Reader

Abstract

The invention provides a clothing joint simulation method and equipment based on a robot and Mujoo. The method comprises the steps that a robot model and a flexible cloth object are defined in Mujoo simulation, cloth grids and physical attributes are registered through a FlexComp plug-in, and a clothes flexible body is constructed based on a continuous medium finite element method; starting a GPU simulation core, and executing the following steps in each simulation period: parallel VBD is carried out on the GPU to carry out clothing flexible body solution; performing selfing and overlapping treatment on the flexible body of the clothes; collision detection based on BVH acceleration is carried out on the clothes flexible body; and outputting the clothes flexible body state and synchronizing the clothes flexible body state to Mujoo simulation to realize coupling interaction and joint simulation closed loop of the flexible body and the rigid body. According to the method, high-precision joint simulation of the flexible body and the rigid body is realized, penetration and collapse under high-complexity contact can be effectively prevented, and the simulation efficiency is remarkably improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] This application belongs to the field of robot simulation technology, and in particular relates to the field of clothing simulator technology. Background Technology

[0002] In the field of robotics, especially for manipulating flexible and deformable objects (such as clothing), simulation technology is a crucial element in algorithm development, testing, and verification. To systematically evaluate and compare the performance of different algorithms, academia and industry have developed various simulation benchmark platforms, such as SoftGym, GarmentLab, and Daxbench, which is based on differentiable simulation. These platforms typically generate diverse and repeatable evaluation scenarios in a simulation environment, greatly facilitating research.

[0003] However, current technologies still face a significant gap between simulation and reality. Unlike rigid bodies, flexible objects such as clothing possess extremely high degrees of freedom and complex deformation characteristics, making them difficult to model accurately in simulation environments. Consequently, strategies trained in simulations often perform poorly when transferred to the real physical world.

[0004] Furthermore, existing clothing simulation systems are mostly based on CPU physics engines (such as Bullet, PhysX, and Mujoco), which are prone to problems such as clipping, jitter, and computational latency in scenarios with complex topological deformations and high contact density. These problems are particularly prominent in robotic clothing manipulation tasks (such as grasping, unfolding, and folding). Traditional fabric simulation struggles to balance physical realism and real-time performance and lacks efficient support for interactions between flexible and rigid bodies. Summary of the Invention

[0005] This application provides a method and device for co-simulating clothing based on robots and Mujoco, which can improve the accuracy, robustness and efficiency of clothing simulation.

[0006] In a first aspect, embodiments of this application provide a method for co-simulating clothing based on a robot and Mujoco, comprising: defining a robot model and a flexible fabric object in the Mujoco simulation, registering the fabric mesh and physical properties through the FlexComp plugin, and constructing a flexible clothing body based on the continuous medium finite element method; starting the GPU simulation kernel, and performing the following in each simulation cycle: solving the flexible clothing body in parallel VBD on the GPU; performing self-intersection and overlap processing on the flexible clothing body; performing collision detection on the flexible clothing body based on BVH acceleration; outputting the state of the flexible clothing body and synchronizing it to the Mujoco simulation, thereby realizing the coupling interaction and co-simulation closed loop between the flexible body and the rigid body.

[0007] In one implementation of the first aspect, the self-intersection and overlap processing of the flexible clothing body includes: detecting overlapping areas of the fabric topology through an adjacency graph; evaluating the penetration depth of each potential conflict pair of the fabric in parallel on the GPU; if a cross facet is detected, inserting a virtual node for geometric separation and gradually converging in the next frame; and processing the fabric surface based on fabric topology consistency constraints.

[0008] In one implementation of the first aspect, the collision detection of the flexible clothing body based on BVH acceleration includes: uniformly constructing the fabric nodes and rigid body surfaces into GPU BVH; generating contact constraint pairs using a parallel reduction algorithm; calling the BVH core to perform node-face collision detection of GPU BVH based on the contact constraint pairs; and sending the collision detection results into a simulation solver for dynamic response.

[0009] In one implementation of the first aspect, the step of calling the BVH core to perform node-face collision detection of GPU BVH includes: performing collision detection based on the bounding box hierarchy of the GPU; wherein each cloth particle or mesh cell is regarded as a query probe.

[0010] In one implementation of the first aspect, the parallel solution of the flexible clothing on the GPU includes: importing clothing simulation data into a clothing simulator; the clothing simulator simulating the dynamic effects of clothing based on a continuous medium finite element model and a simulation solver; wherein: in the continuous medium finite element model, the clothing is modeled in both in-plane and out-of-plane directions, and an anisotropic model is used to distinguish the tensile and bending responses of the clothing in the warp, weft, and diagonal directions; the simulation solver uses an implicit time integration method to solve the clothing dynamic equations.

[0011] In one implementation of the first aspect, in the continuous medium finite element model, the fabric is regarded as a continuous elastic surface and the fabric is divided into triangular meshes; nonlinear modeling is introduced in the out-of-plane direction of the clothing so that the bending stiffness and curvature are related as a quadratic function.

[0012] In one implementation of the first aspect, the simulation solver uses an implicit time integration method to solve the clothing dynamics equation, including: constructing the clothing dynamics equation solution for each time step into an energy minimization objective function; the objective function is:

[0013]

[0014] Where, Δt 2 It is the time step. Let x be the objective function, and x be the vertex position vector of the mesh to be determined. nLet be the position vector at the previous moment, M be the mass matrix, and E(x) be the elastic potential energy of the system.

[0015]

[0016] Where H is the stiffness matrix. Δx is the position increment.

[0017] In one implementation of the first aspect, the simulation solver is further accelerated by graph coloring; the graph coloring approximates the global mesh as being composed of many non-overlapping sub-regions, and during runtime, sub-regions of the same color only need to perform conflict-free sparse matrix-vector multiplication on the GPU.

[0018] Secondly, embodiments of this application provide a computer-readable storage medium having a computer program stored thereon, which, when executed by a processor, implements the clothing co-simulation method based on robots and Mujoco as described in the first aspect of this application.

[0019] Thirdly, embodiments of this application provide an electronic device, the electronic device including a processor and a memory; the memory stores program instructions; the processor is used to run the program instructions to execute the clothing co-simulation method based on robots and Mujoco as described in any one of the first aspects of this application.

[0020] The clothing co-simulation method based on robots and Mujoco provided in this application has the following beneficial effects:

[0021] This application supports co-simulation of flexible and rigid bodies, and can directly interoperate with the Mujoco environment. Through self-intersection and overlap processing, it effectively prevents penetration and collapse under highly complex contacts. The use of BVH to accelerate collision detection significantly improves simulation efficiency. While maintaining high simulation accuracy, this application effectively enhances the overall performance of the CPU engine. Attached Figure Description

[0022] Figure 1 The diagram shown is an overall flowchart of a clothing co-simulation method based on robots and Mujoco, according to an embodiment of this application.

[0023] Figure 2 The flowchart shown is a process for parallel solving of flexible clothing on a GPU in a clothing co-simulation method based on robots and Mujoco according to an embodiment of this application.

[0024] Figure 3 The diagram shown is a schematic representation of the principle of the continuous medium finite element model in a clothing co-simulation method based on robots and Mujoco, according to an embodiment of this application.

[0025] Figure 4 The diagram shown is a schematic diagram of the preprocessing of clothing fabric using a continuous medium finite element model in a clothing co-simulation method based on robots and Mujoco, according to an embodiment of this application.

[0026] Figure 5 The diagram shown illustrates the collision detection principle in the clothing simulator of a clothing co-simulation method based on robots and Mujoco, according to an embodiment of this application.

[0027] Figure 6 The diagram shown is a structural schematic of an electronic device according to an embodiment of this application.

[0028] Component designation explanation

[0029] 100 Electronic devices

[0030] 101 Memory

[0031] 102 processor

[0032] 103 Monitor

[0033] S100~S200 Steps

[0034] Steps S210~S240

[0035] Steps S211~S212

[0036] Steps S2121~S2122 Detailed Implementation

[0037] The following specific examples illustrate the implementation of this application. Those skilled in the art can easily understand other advantages and effects of this application from the content disclosed in this specification. This application can also be implemented or applied through other different specific embodiments, and various details in this specification can also be modified or changed based on different viewpoints and applications without departing from the spirit of this application. It should be noted that, unless otherwise specified, the following embodiments and features in the embodiments can be combined with each other.

[0038] This application provides a method and device for co-simulating clothing based on robots and Mujoco. The core of the method lies in seamlessly integrating a flexible clothing body constructed using the Continuous Medium Finite Element Method (FEM) into a Mujoco simulation environment that defines rigid bodies such as robots, through an independent GPU simulation core running as a FlexComp plugin. In each simulation cycle, the GPU simulation core independently executes the following steps: solving the dynamic equations of the flexible body in parallel using the Vertex Block Gradient (VBD) method; applying untangling techniques to handle self-intersections and overlaps of the flexible body; and using Hierarchical Bounding Box (BVH) to accelerate collision detection between the flexible and rigid bodies. Finally, the updated state of the flexible body is synchronized to the Mujoco simulation in real time through the plugin interface, achieving coupled interaction between the two. This method effectively solves the penetration and collapse problems under complex contact by supporting high-precision rigid-flexible co-simulation and directly interoperating with the Mujoco environment, significantly improving simulation efficiency.

[0039] The following will refer to the appendices in the embodiments of this application. Figure 1 To be continued Figure 6 This application provides a detailed description of the technical solutions in its embodiments. This allows those skilled in the art to understand and implement the robot- and Mujoco-based clothing co-simulation method of this embodiment without inventive effort.

[0040] Figure 1 The flowchart shown is a presentation of a clothing co-simulation method based on robots and Mujoco, as described in this application embodiment. Figure 1 As shown, the clothing co-simulation method based on robots and Mujoco provided in this application includes the following steps S100 to S200.

[0041] Step S100: Define the robot model and flexible fabric object in Mujoco simulation, and register the fabric mesh and physical properties through the FlexComp plugin to construct the flexible clothing body based on the continuous medium finite element method;

[0042] Step S200: Start the GPU simulation core and execute the following in each simulation cycle:

[0043] Step S210: Solve the flexible clothing body problem in parallel using VBD on the GPU;

[0044] Step S220: Perform self-interlacing and overlapping processing on the flexible clothing body;

[0045] Step S230: Perform collision detection on the flexible clothing body based on BVH acceleration;

[0046] Step S240: Output the state of the flexible clothing body and synchronize it to the Mujoco simulation to realize the coupling interaction and joint simulation closed loop between the flexible body and the rigid body.

[0047] In the robot-Mujoco-based clothing co-simulation method of this application embodiment, a robot model and a flexible fabric object are defined in the Mujoco simulation, and the fabric mesh and physical properties are registered through the FlexComp plugin. The flexible clothing body is constructed based on the continuous medium finite element method, which can directly interoperate with the Mujoco environment to form a robot-Mujoco clothing co-simulation. This enables the simulation to support the co-simulation of flexible and rigid bodies, and can achieve real-time interactive simulation of flexible and rigid bodies while ensuring high physical accuracy, significantly improving the stability and computational efficiency in robot operation scenarios. By performing self-intersection and overlap processing on the flexible clothing body, penetration and collapse under high-complexity contact are effectively prevented. Furthermore, by using BVH to accelerate collision detection, the simulation efficiency is greatly improved.

[0048] The following is in conjunction with the appendix Figure 2 To be continued Figure 5 The steps S100 to S200 of the clothing co-simulation method based on robots and Mujoco in this embodiment will be described in detail.

[0049] Step S100: Define the robot model and flexible fabric object in Mujoco simulation, and register the fabric mesh and physical properties through the FlexComp plugin to construct the flexible clothing body based on the continuous medium finite element method.

[0050] In this embodiment, a flexible clothing body based on the continuous medium finite element method (FEM) is formed, wherein the clothing is modeled in the in-plane and out-of-plane directions respectively, and an anisotropic model is used to distinguish the tensile and bending responses in the warp, weft and diagonal directions.

[0051] The robot model can use the URDF standard format and must clearly define links, joints, collision attributes, and visual attributes. Each link must contain a collision tag; otherwise, the robot cannot physically interact with the cloth. Inertial parameters must be set appropriately to avoid "floating" or "jamming" during robot movement. In the collision tag of the robot's end effector, add `contype` and `conaffinity` to ensure force feedback upon collision with the cloth. Drive the robot joints using control algorithms (such as PID or reinforcement learning) to make the end effector contact the cloth, achieving grasping or pushing actions. MuJoCo's FlexComp plugin uses custom XML tags.<flexcomp>To register a flexible body, one needs to reference the robot URDF in MuJoCo's main XML configuration file and define the mesh, physical properties, and constraints of the cloth.

[0052] The embodiment directly embeds the Mujoco simulation environment through a plug-in (FlexComp module), realizes real-time interaction simulation of flexible bodies and rigid bodies through the FlexComp plug-in, realizes joint simulation of flexible bodies and rigid bodies, and defines flexible body nodes, edges, constraints, and interaction contact with rigid bodies in the Mujoco scene through the plug-in interface. Flexible body calculation is completed independently on a GPU, and simulation results are fed back to the Mujoco in real time to realize closed-loop simulation of rigid-flexible coupling.

[0053] In step S200, a GPU simulation core is started, and steps S210 to S240 are executed in each simulation cycle.

[0054] The GPU simulation core is started in MuJoCo by configuring the gpu_id parameter of mujoco.MjModel to specify a GPU device. Specifically, MuJoCo specifies a GPU device ID through the construction parameter of MjModel or the mj_setParam function to enable the GPU simulation core.

[0055] In step S210, a clothing flexible body is solved in parallel VBD on the GPU.

[0056] Specifically, the clothing flexible body is solved by performing clothing dynamics prediction (Predict Position) on the GPU, and the constraints are iteratively updated by the VBD (Vertex Block Decent) solver.

[0057] In the embodiment, the GPU parallel VBD solver is used in combination with the hierarchical constraint blocking strategy, so that the constraint solving in the rigid-flexible mixed scene can be completed within a single frame, and the sub-domain division and local synchronization mechanism effectively reduce the risk of iteration divergence and improve the convergence efficiency.

[0058] Figure 2 A flowchart of parallel clothing flexible body solving on a GPU in a clothing joint simulation method based on a robot and Mujoco according to an embodiment of the application is shown. As shown in Figure 2 In one implementation manner of the embodiment, the parallel clothing flexible body solving on the GPU includes the following steps S211 to S212.

[0059] In step S211, clothing simulation data is imported to a clothing simulator;

[0060] In step S212, the clothing simulator simulates the dynamic effect of the clothing based on a continuous medium finite element model and a simulation solver.

[0061] wherein: the step S200 can further include:

[0062] The step S2121, in the continuous medium finite element model, the in-plane and out-of-plane directions of the clothes are modeled respectively, and the anisotropic model is used to distinguish the tensile and bending responses of the warp, weft and diagonal directions of the clothes;

[0063] The step S2122, the simulation solver uses an implicit time integration method to solve the clothes dynamics equation.

[0064] The clothes joint simulation method based on robots and Mujoco in the embodiment can distinguish the tensile and bending responses of the warp, weft and diagonal directions of the clothes through the continuous medium finite element model, and can more accurately capture the deformation behaviors such as cloth wrinkling and other bending-dependent characteristics. The simulation solver in the clothes joint simulation method based on robots and Mujoco in the embodiment uses an implicit time integration method to solve the clothes dynamics equation, which has unconditional stability, allows a larger time step to be used under the premise of ensuring accuracy, and is particularly suitable for simulating real fabrics with high stiffness.

[0065] The step S211 imports clothes simulation data to the clothes simulator.

[0066] The realism of simulation not only depends on the physical model, but also depends on the accuracy of the physical parameters and the interactive processing mechanism. The clothes simulator of the embodiment directly uses the measured data of the real fabric sample as, including mass density, thickness, elastic modulus and surface friction coefficient, etc.

[0067] In the embodiment, during the clothes simulation data acquisition process, a digital twin based on physics is created to ensure the dual accuracy of geometric accuracy and physical accuracy. Geometric accuracy is achieved by importing production-level DXF pattern files to build a 1:1 scale model, where the stitching definition completely replicates the physical assembly structure. In terms of physical accuracy, a tensile tester and a bending tester are used to measure the core mechanical properties of each fabric (such as tensile / bending stiffness, thickness, weight). This measurement scheme follows the ASTM international standard. This process can generate clothes simulation data with solid physical foundation.

[0068] The clothes simulator in the embodiment supports direct import of standard model files (including triangular mesh, physical attribute files). After import, the clothes simulator based on the continuous medium finite element model and the GPU-accelerated implicit integration method simulates the complex dynamic effects of the clothes (including stretching, bending, wrinkling and self-collision).

[0069] Step S212, the clothing simulator simulates the dynamic effect of the clothing based on a continuum finite element model and a simulation solver. Wherein: step S212, further can include:

[0070] Step S2121, as Figure 3 shown, in the continuum finite element model, the in-plane and out-of-plane directions of the clothing are modeled respectively, and the tensile and bending responses of the warp, weft and diagonal directions of the clothing are distinguished by using an anisotropic model.

[0071] The in-plane is mainly tensile / shear, and the out-of-plane is mainly bending / arching / draping. Anisotropy means that the material will exhibit different mechanical properties in different directions. For clothing, the fiber arrangement in the warp direction (along the length of the fabric) and the weft direction (along the width of the fabric) is different, which makes the tensile and bending characteristics of the clothing in the warp and weft directions different, and the diagonal direction also has unique mechanical response. Through the anisotropic model, the mechanical behavior of the clothing in different directions can be more accurately captured and simulated, thereby improving the authenticity and accuracy of the clothing dynamics simulation.

[0072] Distinguishing the tensile and bending responses of the warp, weft and diagonal directions of the clothing by using an anisotropic model includes:

[0073] 1) Finite element unit selection: select shell elements or membrane elements suitable for simulating the deformation of the clothing in the anisotropic model. Shell elements can consider both in-plane and out-of-plane mechanical behavior, and are suitable for simulating bending and stretching of clothing; membrane elements are mainly used to simulate in-plane loading conditions. If the in-plane tensile response is the focus, membrane elements are also a choice. When selecting elements, ensure that the elements have sufficient accuracy to describe anisotropic behavior, such as using high-order elements.

[0074] 2) Model establishment and mesh division: according to the actual shape of the clothing, use CAD software to establish a three-dimensional geometric model, such as a shirt, pants, etc. Divide the geometric model into finite element mesh. In key areas such as collar, cuff, trouser leg, etc. where deformation is large, the mesh should be appropriately densified to improve calculation accuracy and avoid the appearance of abnormal elements affecting the calculation results.

[0075] 3) Boundary conditions and load application

[0076] Boundary conditions: apply boundary conditions according to actual conditions, such as simulating clothing hanging, fixing the displacement of the hanging point; simulating the wearing state, constraining the displacement of the part in contact with the human body.

[0077] 4) Load application: Apply tensile or bending loads in different directions. For example, apply tension in the longitudinal direction to simulate the longitudinal tensile response; apply bending moment in the latitudinal direction to simulate the latitudinal bending response; apply tension and bending moment simultaneously in the diagonal direction to simulate the complex mechanical behavior in the diagonal direction.

[0078] 5) Solution and Result Analysis

[0079] Clothing material parameters are obtained from clothing simulation data. These parameters, along with element types, boundary conditions, and loads, are then input into an anisotropic model for solution. Based on the anisotropic model, the stress, strain distribution, and deformation of the clothing in different directions are calculated.

[0080] Simulation software was used to examine the tensile and bending response results in different directions. By comparing stress-strain curves and deformation contour maps in the warp, weft, and diagonal directions, the influence of anisotropy on the mechanical behavior of clothing was analyzed, thereby gaining a deeper understanding of the performance differences of clothing in different directions.

[0081] In one implementation of this embodiment, such as Figure 3 As shown, in the continuous medium finite element model, the fabric is regarded as a continuous elastic surface and the fabric is divided into triangular meshes.

[0082] Triangulation is a point-set-based partitioning algorithm. Its core principle is to maximize the minimum angle, meaning that for a given point set, the minimum interior angle of any triangle in the generated triangular mesh should be as large as possible to avoid elongated triangles. In fabric partitioning, the first step is to determine the sampling points on the fabric. These points can be evenly distributed on the fabric surface based on factors such as the fabric size and the expected mesh density.

[0083] In this embodiment, the step of dividing the fabric into triangular meshes includes:

[0084] 1) Selecting an initial point set: Select a series of discrete points on the fabric surface according to certain rules, such as selecting points at equal intervals on the boundary of the fabric, and then distributing points at certain intervals inside the fabric.

[0085] 2) Constructing the initial triangular mesh: Using algorithms (such as point-by-point insertion), these points are gradually connected to form a mesh that satisfies...

[0086] The Delaunay condition triangle is obtained by point-by-point insertion. The point-by-point insertion method first constructs a super triangle that contains all points, and then inserts each point into the existing triangular mesh in turn. By continuously adjusting the edges and vertices of the triangle, the Delaunay condition is satisfied again.

[0087] 3) Optimization and adjustment: Check the generated triangular mesh and optimize and adjust the parts that do not meet the requirements (such as low triangle quality, large difference in side length, etc.). For example, improve the shape of the triangle by operations such as edge flipping.

[0088] Alternatively, the leading edge method can be used to divide the fabric into triangular meshes, specifically including:

[0089] Starting from the edge of the fabric, it gradually advances inward to generate triangular meshes. It treats the boundaries of the already generated triangular meshes as the "front edge," and each time it selects a suitable edge on the front edge, it generates a new triangle inside the front edge according to certain rules (such as angle, edge length restrictions, etc.), continuously expanding the front edge until the entire fabric area is completely divided.

[0090] If a two-dimensional image of the fabric is available (such as a scanned image of the fabric), the image can be processed first to extract the fabric's outline and some feature information. Then, using image processing and computer vision techniques, triangulation can be performed in the image space, and the triangular mesh in the image space can be mapped onto the three-dimensional space of the fabric.

[0091] In one implementation of this embodiment, nonlinear modeling is introduced in the out-of-plane direction of the clothing to make the bending stiffness and curvature a quadratic function relationship, thereby more accurately capturing deformation behaviors that depend on bending characteristics, such as fabric wrinkling.

[0092] In this embodiment, the mathematical expression of nonlinear bending stiffness in nonlinear modeling is as follows:

[0093] The bending stiffness B is defined as a quadratic function of curvature k: B(k) = B0 + B1k + B2k 2

[0094] Where: B0 is the initial bending stiffness (basic stiffness, corresponding to the small curvature state); B1 and B2 are nonlinear coefficients that control the trend of stiffness change with curvature; curvature k represents the severity of out-of-plane bending, such as large curvature at folds and small curvature at flat areas. B0, B1, and B2 need to be measured experimentally, such as by conducting bending tests on real fabrics at different curvatures, or by taking values ​​empirically based on fabric type (cotton, silk, denim, etc.). For example:

[0095] Soft fabrics (silk): B0 is low, B2 is moderate (wrinkles easily and wrinkle stiffness increases gradually).

[0096] Stiff fabrics (canvas): B0 is higher, B2 is higher (not easy to wrinkle, and once wrinkled, the stiffness increases rapidly).

[0097] Quadratic term B2k 2 The introduction of this factor causes the model to exhibit nonlinear characteristics:

[0098] When the fabric is slightly bent (small k), the stiffness is mainly dominated by B0, which is close to a linear response; when the fabric is severely wrinkled (large k), the quadratic term is significantly enhanced, and the stiffness changes rapidly with the curvature. For example, the denser the fabric wrinkles, the greater the stiffness against further bending.

[0099] When solving the finite element model of the continuous medium, the nonlinear bending model causes the governing equations to become a nonlinear system of equations, which is solved using an iterative method:

[0100] 1) Initialize the mesh deformation state and calculate the initial curvature.

[0101] 2) Calculate nonlinear stiffness based on the current curvature

[0102] 3) Solve the deformation equilibrium equations and update the mesh position.

[0103] 4) Recalculate the curvature and stiffness, iterating until convergence.

[0104] This calculation method can accurately capture the entire process of fabric from "smooth bending" to "severe wrinkling," avoiding the problems of excessive wrinkle diffusion or stiffness distortion in linear models. Through the above method, the nonlinear bending model can accurately simulate the complex deformation of fabric in the out-of-plane direction: such as the natural curvature of sleeves when they droop, the generation and disappearance of wrinkles when skirts swing, and the stacked wrinkles at joints of tight-fitting clothing, significantly improving the realism of clothing dynamics simulation.

[0105] Step S2122: The simulation solver uses an implicit time integration method to solve the clothing dynamics equation.

[0106] The dynamic equations of fabrics are typically rigid ordinary differential equations. Traditional explicit integration methods require extremely small time steps to ensure numerical stability, resulting in high computational costs. This embodiment employs an implicit time integration algorithm (such as the implicit Euler method) to solve the dynamic equations of clothing. This algorithm has unconditional stability and allows for larger time steps while maintaining accuracy, making it particularly suitable for simulating real fabrics with high stiffness.

[0107] In one implementation of this embodiment, the simulation solver uses an implicit time integration method to solve the clothing dynamics equation, which includes: constructing the clothing dynamics equation for each time step as an energy minimization objective function. For efficient solving, in this embodiment, all computational stages are executed on the GPU. The dynamics solution for each time step is constructed as an energy minimization problem.

[0108] Specifically, in one implementation of this embodiment, the objective function is:

[0109]

[0110] Where, Δt 2 It is the time step. Let x be the objective function, and x be the vertex position vector of the mesh to be determined. n Let be the position vector at the previous moment, M be the mass matrix, and E(x) be the elastic potential energy of the system.

[0111] Calculate the relationship between elastic potential energy and position using Newton's method:

[0112] Where H is the stiffness matrix. E(x t ) represents the elastic potential energy corresponding to the time step t; Δx represents the position increment.

[0113] Newton's method has a quadratic convergence speed, which, compared to the linear convergence speed of methods such as PBD, can achieve a high-precision solution with fewer iterations.

[0114] To achieve real-time simulation of large-scale, high-resolution meshes, one implementation of this embodiment further includes accelerating the simulation solver using graph coloring. Graph coloring approximates the global mesh as consisting of many non-overlapping sub-regions. During runtime, sub-regions of the same color only require conflict-free sparse matrix-vector multiplication on the GPU. In this embodiment, the simulation solver employs an implicit time integration method combined with GPU acceleration technology: multi-resolution preconditioners and potential energy-based contact solving, enabling efficient simulation of cloth dynamics in large-scale degree-of-freedom meshes. Compared to position-dynamic or explicit integration methods, this scheme maintains higher physical accuracy and numerical stability even under larger time steps and significant deformation conditions.

[0115] To accelerate the solution of the simulation solver, the vertex block gradient (VBD) method is typically used. This embodiment introduces a graph coloring method. The graph coloring method approximates the global mesh as consisting of many non-overlapping sub-regions. During runtime, sub-regions of the same color only need to undergo conflict-free sparse matrix-vector multiplication on the GPU, enabling the VBD algorithm to converge quickly in a very small number of iterations.

[0116] In this embodiment, all computational steps are performed on the GPU. Cloth dynamics are solved using implicit Euler integrals on the GPU, with each time step expressed as an energy minimization problem, iteratively completed using vertex block gradient (VBD). Leveraging the parallel computing capabilities of the GPU, the simulation solver achieves efficient operation while ensuring fast convergence.

[0117] Step S220: Perform self-interlacing and overlapping processing on the flexible clothing body.

[0118] During simulation, clothing exhibits self-interlacing (mesh surfaces penetrating each other) and overlapping (multi-layer fabric stacking disorder) due to high contact and folding. This embodiment introduces untangling technology from the field of robot simulation to address the self-interlacing and overlapping problems of clothing under high contact and entanglement conditions. Through topological consistency constraints and virtual node separation strategies, this embodiment automatically untangles potential penetrating structures while maintaining geometric continuity, effectively avoiding simulation collapse caused by fabric self-entanglement.

[0119] Specifically, in one implementation of this embodiment, the self-interlacing and overlapping processing of the flexible clothing body includes:

[0120] Overlapping areas in the cloth topology are detected using an adjacency graph; the penetration depth of each potential conflict pair of cloth is evaluated in parallel on the GPU; if intersecting patches are detected, virtual nodes are inserted for geometric separation, and convergence is achieved progressively in the next frame; the cloth surface is processed based on cloth topology consistency constraints. The self-intersection problem of flexible bodies is solved by inserting virtual nodes and maintaining topology constraints.

[0121] In this embodiment, an adjacency graph of the cloth mesh is constructed to clarify the connection relationship between the face and the vertex, and then the overlapping area is located by geometric judgment, which is the basis of self-intersection detection.

[0122] 1) Construct an adjacency graph:

[0123] Retrieve cloth mesh data from the FlexComp plugin (vertex coordinates V, face index F, in the following format:)

[0124] F = [[v0, v1, v2], [v3, v4, v5], ...], where each face contains 3 vertex IDs.

[0125] Traverse all faces and establish a "vertex-adjacent face" mapping table (e.g., adj_face[v0] = [f0, f1, f2], indicating that vertex v0 belongs to faces f0, f1, f2) and a "face-adjacent face" mapping table (e.g., adj_face_pair[f0] = [f1, f3], indicating that faces f0 share edges with f1 and f3). Store the adjacency graph as a GPU-accessible array (e.g., PyTorch's cuda.Tensor or CuPy array) for subsequent parallel computation.

[0126] 2) Detect overlapping regions

[0127] Exclude "adjacent patches" (filter through the adjacency list to avoid misjudging normal adjacency of shared edges), and select all "non - adjacent patch pairs" ((f_i, f_j), where i < j and f_j is not in adj_face_pair[f_i]). For each non - adjacent patch pair, calculate the distance between the patch centers and the angle between the normal vectors: If the center distance < 2 times the fabric thickness and the normal vector angle < 90°, mark it as a "potentially overlapping patch pair".

[0128] In this embodiment, utilize the parallel computing ability of the GPU to batch - calculate the penetration depth (PD, Penetration Depth) of all potentially overlapping patch pairs to accurately determine whether there is true self - intersection.

[0129] Specifically, allocate a thread for each potentially conflicting pair on the GPU and execute the SAT algorithm in parallel:

[0130] Extract the 6 vertex coordinates of two triangular patches (P1 - P3 belong to f_i, Q1 - Q3 belong to f_j).

[0131] Generate 11 potential separating axes (the normal vector of patch f_i, the normal vector of patch f_j, and the cross - product directions of 6 edges).

[0132] Calculate the projection intervals of the two patches on each axis. If there is no overlap in all axis intervals, there is no penetration; if there is an overlapping axis, take the axis with the minimum overlapping length as the "penetration axis", and the absolute value of the overlapping length is the penetration depth.

[0133] Set a penetration depth threshold (e.g., PD > 0.001m, adjusted according to the fabric thickness) to select "truly self - intersecting patch pairs".

[0134] In this embodiment, for truly self - intersecting patch pairs, split the intersecting patches by inserting virtual nodes and gradually converge to a non - penetrating state in the next frame to avoid simulation jitter caused by violent separation.

[0135] Specifically, for truly self - intersecting patch pairs, splitting the intersecting patches by inserting virtual nodes and gradually converging to a non - penetrating state in the next frame includes the following processes:

[0136] 1) Locate the intersection line and virtual nodes

[0137] For the self - intersecting patch pair (f_i, f_j), calculate the intersection line of the two triangular patches (if it exists) to obtain two intersection points A and B on the intersection line. Insert virtual nodes on the intersecting edges of patches f_i and f_j: If the edge P1P2 of f_i intersects the edge Q2Q3 of f_j at A, insert a virtual node V1 (coordinate = A) on P1P2 and a virtual node V2 (coordinate = A) on Q2Q3.

[0138] 2) Splitting patches and updating topology

[0139] The original face is split into multiple sub-faces: for example, after f_i(P1P2P3) is inserted into V1, it is split into two new faces, P1V1P3 and V1P2P3. The adjacency graph is updated: the adjacency records of the original face are deleted, and the connection relationships between the new face and its surrounding vertices and faces are added to ensure topological consistency.

[0140] 3) Gradual convergence position

[0141] First frame: Set the initial position of the virtual node to the intersection point to avoid excessive instantaneous displacement.

[0142] Subsequent frames: Calculate the target displacement of the virtual node based on the penetration depth (e.g., move PD / 2 along the penetration axis), and gradually adjust the position using a spring-damped model (Hooke's Law) until the penetration depth is less than the threshold.

[0143] This embodiment ensures the continuity of the fabric surface after splitting by constraining the connection relationship between virtual nodes and original vertices, thus avoiding "breaks" or "twisting".

[0144] In this embodiment, the constraint types include:

[0145] 1) Distance constraint: The distance between the virtual node and the two endpoints of the original edge (such as V1 and P1, P2) must maintain the ratio of the length of the original edge (such as P1V1 / P1P2=0.3, the ratio remains unchanged after splitting) to avoid excessive stretching.

[0146] 2) Angle constraint: The angle between the normal vector of the new facet and the normal vector of the original facet must be <30° to ensure the continuity of the fabric surface normal and avoid abnormal lighting rendering.

[0147] 3) Adjacency constraint: The new face where the virtual node is located must be connected to the adjacent face of the original face (e.g., P1V1P3 must establish an adjacency relationship with the original adjacent face f3 of f_i) to maintain topological integrity.

[0148] In this embodiment, the constraint solution includes: in the parallel optimization step of the GPU, the above constraints are transformed into energy functions (such as the energy of distance constraints E = k*(d-d0)^2, where k is the stiffness coefficient), and the total energy is minimized by the gradient descent method to ensure that the constraints are satisfied.

[0149] Step S230: Perform collision detection on the flexible clothing body based on BVH acceleration.

[0150] In one implementation of this embodiment, the collision detection of the flexible clothing body based on BVH acceleration includes: uniformly constructing the fabric nodes and rigid body surfaces into GPU BVH; generating contact constraint pairs using a parallel reduction algorithm; based on the contact constraint pairs, calling the BVH core to perform node-face collision detection of GPU BVH; and sending the collision detection results into the simulation solver for dynamic response.

[0151] By integrating the geometric information of the flexible cloth nodes with the rigid body surface of the robot, a BVH (Bounding Volume Hierarchy) is constructed on the GPU, laying the foundation for subsequent rapid collision detection.

[0152] Integrate the geometric objects of the robot (rigid body) and cloth (flexible body) and build the same BVH tree on the GPU (avoiding the redundancy of building them separately):

[0153] Robot side: Extract all collision patches, and enclose each patch in AABB as a BVH leaf node.

[0154] Cloth side: Extract all vertices (or facets), each surrounded by an AABB / bounding sphere, as another type of leaf node.

[0155] GPU parallel build: Use CUDA tools to quickly generate BVH trees on the GPU (graphics cards have hardware acceleration modules, and the build speed is 10 to 100 times faster than CPU).

[0156] BVH can be used to accelerate collision detection. Taking "whether the cloth node collides with the robot" as an example, the process is as follows:

[0157] 1) Starting from the root node of BVH, determine whether the bounding body of the cloth node intersects with the bounding body of the root node → if they intersect, continue; if they do not intersect, exclude.

[0158] 2) Traverse downwards through the intermediate nodes, repeating the intersection check of the enclosing body → if a non-intersecting intermediate node is encountered, prune the branch directly.

[0159] 3) When traversing to the leaf node (robot face), the precise geometric intersection calculation of "cloth node" and "robot face" is then performed (such as BVH you mentioned earlier).

[0160] 4) Finally, only the "node-face" pairs that actually collide are output and passed to the solver for dynamic response.

[0161] By using GPU parallel reduction, candidate pairs (constraint pairs) of "cloth nodes-rigid body patches" that may have collisions are quickly screened, eliminating a large number of invalid combinations without collisions. Parallel reduction employs a "divide and conquer + global aggregation" approach, grouping and calculating data within GPU thread blocks, and finally merging the results to avoid the overhead of serial traversal on the CPU. The steps include:

[0162] 1) BVH level screening of candidate pairs

[0163] Allocate a thread on the GPU for each cloth node to traverse the BVH tree:

[0164] Starting from the root node, determine whether the AABB of the cloth node overlaps with the AABB of the current BVH node. If they overlap, continue traversing the left and right child nodes of the node; if they do not overlap, prune the branch; if a leaf node is reached and it is a rigid body face, mark the "node-face" as a candidate pair and store it in the candidate pair list on the GPU.

[0165] 2) Parallel reduction, deduplication, and filtering

[0166] Intra-thread reduction: Sort candidate pairs by "node ID + face ID" and delete duplicate candidate pairs (to avoid the same pair being marked repeatedly by multiple threads).

[0167] Global reduction: The deduplication results of each thread block are summarized, the total number of global candidate pairs is counted by the cudaReduce function, and then compressed into the final number of candidate pairs.

[0168] In this embodiment, precise "cloth node-rigid body surface" collision detection is performed on candidate pairs to output real collision information.

[0169] First, construct a BVH collision detection scenario: using the triangular geometry of rigid body patches as "intersecting geometry", create BVH nodes for each patch. Use the bounding sphere of the cloth node as a "ray emission source", and generate a "detection ray" for each candidate pair of cloth nodes (the direction can be set as a vector from the node to the patch, or along the direction of gravity, adjusted according to the simulation scenario).

[0170] Then, parallel geometric cross-detection is performed: a ray is assigned to each candidate pair, and the BVH core performs parallel calculations of the intersection between the ray and the rigid body surface, outputting four types of information: "collision status", "collision point coordinates", "collision normal vector", and "penetration depth". Real collisions are filtered: if the intersection of the ray and the surface is inside the surface, it is marked as a real collision pair and stored.

[0171] In this embodiment, the collision results are passed to MuJoCo's physics solver, and the dynamic interactive response between the robot and the cloth is achieved through constraint application.

[0172] In one implementation of this embodiment, the node-face collision detection in GPU BVH, performed by calling the BVH core, includes: collision detection based on the GPU's bounding box hierarchy; wherein each cloth particle or mesh cell is treated as a query probe, and through hardware-accelerated BVH traversal and intersection testing, millions of collision detections can be processed per second, greatly reducing the overhead of collision processing. Compared with general implementations, this method can complete millions of wide-stage collision detections per second, and by combining an optimized sparse matrix structure with CUDA kernel functions, it further improves memory access efficiency and throughput.

[0173] In this embodiment, the GPU-based bounding box hierarchy includes: constructing hierarchical bounding boxes for the clothing mesh (or particle set) according to spatial distribution: the top layer is the root bounding box containing the entire clothing, and the lower layers are subdivided level by level until the leaf nodes correspond to individual triangles or particles. Axially aligned bounding boxes (AABB) or oriented bounding boxes (OBB) are used to balance construction efficiency and query accuracy (AABB is more suitable for hardware acceleration).

[0174] By leveraging the CUDA core to process mesh cells in parallel, the bounding box hierarchy is optimized using a spatial partitioning algorithm (such as the SAH cost function) to reduce traversal overhead. When cloth movement causes mesh deformation, the GPU locally updates the BVH in real time (rather than reconstructing the entire tree), maintaining efficient query performance.

[0175] In this embodiment, using BVH to implement wide-area collision lookup includes:

[0176] Each cloth particle / mesh cell is treated as a "query probe," emitting virtual rays (or beams) into the surrounding space to calculate intersections with the bounding boxes (BVHs) of other objects. The intersection test between the ray and the BVH is equivalent to the collision probability determination: if the ray intersects with a bounding box, the area is marked as a collision candidate.

[0177] GPUs can process millions of ray queries in parallel, achieving a throughput of millions of collision detections per second. Combined with the GPU's SIMT (Single Instruction, Multithreaded) architecture, the query tasks of a large number of probes are distributed across multiple thread bundles, fully utilizing hardware parallelism.

[0178] In this embodiment, a two-level collision detection architecture is constructed using triangular mesh units or particles of the fabric as the basic detection units:

[0179] 1) Broad-Phase: Utilizes GPU-accelerated BVH traversal to quickly filter out candidate object pairs that may collide (such as cloth-cloth, cloth-human, cloth-environment), eliminating the vast majority of objects that may not collide.

[0180] 2) Narrow-Phase: For candidate pairs selected in the wide phase, perform precise geometric intersection tests (such as triangle-triangle, particle-triangle intersection calculations) to determine the actual collision location and collision force.

[0181] Collision detection for clothing involves a process from candidate selection to precise collision detection:

[0182] 1) Probe initialization: Generate a query probe for each cloth particle or mesh cell and define its detection range (estimate the possible collision distance based on the cloth's movement speed).

[0183] 2) Wide-stage screening:

[0184] The probe emits rays that traverse the bounding box heights (BVH) of other objects in the scene via the GPU, returning the bounding box nodes of all potential collisions. GPU parallel computation is used to eliminate duplicate or excessively distant candidate pairs, outputting a streamlined candidate list.

[0185] 3) Precise detection in narrow segments:

[0186] Perform geometrical intersection tests on candidate pairs (e.g.) The triangle intersection algorithm calculates the precise collision point, normal vector, and penetration depth.

[0187] To take advantage of the flexible properties of the fabric, continuous collision detection (CCD) is introduced to avoid missed detections due to rapid movement.

[0188] 4) Collision response calculation: Based on the detection results, the position and velocity of the cloth mesh are updated through a constraint solver (such as position basis dynamics PBD) to simulate the deformation after the collision (such as wrinkling and stacking, springback).

[0189] This embodiment employs GPU-accelerated collision detection in clothing simulation. Through ray volume hierarchical decomposition and GPU BVH structure updates, it achieves efficient parallel computation for large-scale node-face and face-face detection. Compared to traditional CPU collision detection, the detection speed can be improved by 30 to 80 times. This embodiment fully leverages the parallel computing capabilities of the GPU, overcoming the bottlenecks of slow speed and low accuracy in traditional collision detection in large-scale cloth simulation.

[0190] Furthermore, in this embodiment, the system matrix in the clothing simulator is stored in a sparse format optimized for GPU memory merge access. Simultaneously, techniques such as CUDA Kernel Fusion can reduce memory read / write operations and thread synchronization overhead, further improving computational throughput.

[0191] In one implementation of this embodiment, the clothing simulator uses a contact force model based on a potential function and the aforementioned collision untangling method to perform self-collision and environmental collision on the clothing.

[0192] In this embodiment, a contact force model based on a potential function is used as the primary approach to efficiently respond to collisions, supplemented by a collision untangling mechanism. This mechanism, as a fault protection measure, is triggered in the event of extreme penetration, ensuring that the simulation system can recover to a stable state without penetration.

[0193] Define the potential function: For each particle (or grid vertex) of the cloth, define its "potential energy field" with the surrounding particles / environment objects. When the distance between the two is less than a preset threshold (safe distance), the potential function value increases rapidly as the distance decreases, forming a repulsive force.

[0194] Self-collision potential function (between cloth particles):

[0195]

[0196] Where, r ij Let d be the position vector of particle i and particle j. ij Let d0 be the distance between the two, and k be the self-collision safety distance, such as 1.5 times the fabric thickness. self This is the self-collision stiffness coefficient.

[0197] Environmental collision potential function (cloth and external objects):

[0198] U env (r i ,s)=k env ·max(0,d min -d i ) 2

[0199] Where, d i d represents the shortest distance from fabric particle i to the environmental surface s. min For environmental collision safety distance, k env This is the environmental collision stiffness coefficient, which is usually greater than that of self-collision to avoid penetration.

[0200] The contact force is solved using the negative gradient of the potential function (the force is in the direction of decreasing potential energy):

[0201]

[0202] Self-collision: The repulsive force exerted on particle i by particle j is inversely proportional to the square of the distance. The closer the distance, the greater the repulsive force, preventing the fabric from penetrating itself, such as separation at the overlapping part of a sleeve.

[0203] Environmental collision: When fabric particles approach a human body or object, they will be subjected to a repulsive force proportional to the distance, simulating the effect of clothing adhering to the surface of an object, such as a shirt adhering to the torso.

[0204] The potential function is a smooth function, and the contact force changes continuously with distance, avoiding the "abrupt force" in traditional discrete collision constraints, making the simulation more stable (e.g., more natural wrinkling and sliding). The potential function of each particle is calculated independently and can be processed in parallel on the GPU, making it suitable for large-scale cloth simulations.

[0205] When fabric becomes severely entangled (such as knots caused by self-collision or clothing getting caught on the environment), the repulsive force of the potential function alone is insufficient to untangle it; active untangling is required. In this embodiment, the collision-based untangling method includes:

[0206] 1) Twisting detection

[0207] By combining GPU-accelerated BVH structures, particle pairs or regions that may collide can be quickly located. In this embodiment, the entanglement state is identified through the following features:

[0208] Distance anomaly: For multiple consecutive frames, the distance between a group of particles is consistently less than 50% of the safe distance (indicating deep entanglement).

[0209] Topological distortion: The direction of the normal vector of a triangular mesh is suddenly reversed (like cloth being "flipped" and wrapped).

[0210] Energy accumulation: The potential function energy in the local area continues to rise (indicating that the repulsive force cannot balance the entanglement trend).

[0211] 2) Energy-driven untangling: For particles in the tangled region, the stiffness coefficient k of their potential function is temporarily reduced, and untangling potential energy is introduced to guide the particles to move to a lower energy non-tangled state (such as separating tangled particles along the shortest path).

[0212] In this embodiment, for severely distorted meshes, the local topology is adjusted by "edge flipping" or "vertex repositioning":

[0213] Edge flip: Swap the common edges of the wrapped triangle to eliminate intersections.

[0214] Vertex relocation: Move the entangled vertex a short distance in the opposite direction along its trajectory to break free from the entanglement area.

[0215] In this embodiment, for areas that are continuously entangled, the collision constraints are temporarily relaxed (e.g., the safety distance d0 is increased) to allow particles to briefly "penetrate" before separating, thus avoiding simulation stuttering caused by excessive constraints.

[0216] In this embodiment, the overall process of performing self-collision and environmental collision on clothing based on the contact force model of the potential function and the collision untangling method includes:

[0217] 1) Collision detection: Combined with GPU-accelerated BVH structure, it can quickly locate particle pairs or regions that may collide.

[0218] 2) Contact force calculation: For detected nearby particles, the contact force is solved by the potential function gradient and applied to the cloth dynamics model.

[0219] 3) Entanglement judgment: Real-time monitoring of particle distance and energy changes to identify entanglement status.

[0220] 4) Unwinding execution: Initiate the unwinding strategy for the entangled area, adjust the particle position or topology until it is freed from entanglement.

[0221] Based on the contact force model and collision untangling method using potential functions, this method can efficiently handle self-collisions of clothing, such as mutual folding and entanglement between fabrics, and collisions with the environment, such as contact between clothing and external objects like people and furniture. By defining a "potential function" to describe the spatial interaction between fabrics or between fabric and the environment, the contact force is transformed into the gradient calculation of the potential function, avoiding the complex constraint solving in traditional collision detection.

[0222] This embodiment balances the efficiency of collision detection, the realism of contact forces, and the robustness of untangling. It can effectively simulate the self-collision of clothing in complex movements (such as the folding of a skirt when it flutters) and environmental collisions (such as the interaction between clothing and a chair when sitting), significantly improving the credibility of clothing dynamics simulation.

[0223] Therefore, in terms of collision handling, the clothing co-simulation method based on robots and Mujoco in this embodiment adopts a hybrid strategy that combines contact force based on potential energy with a resolution mechanism to avoid penetration under high-frequency and complex contact conditions, thus balancing high performance and robustness.

[0224] Step S240: Output the state of the flexible clothing body and synchronize it to the Mujoco simulation to realize the coupling interaction and joint simulation closed loop between the flexible body and the rigid body.

[0225] This embodiment supports real-time simulation of various types of flexible materials such as fabrics, ropes, and films, achieving millisecond-level updates on the graphics card. Through the above design, the clothing simulator in this embodiment achieves higher physical accuracy, numerical stability, and computational efficiency in fabric simulation, providing powerful support for complex clothing handling tasks.

[0226] To ensure the realism of the simulated behavior, this embodiment does not use manually adjusted parameters, but directly adopts the physical properties of real fabrics measured by professional equipment, including areal density, thickness, tensile and flexural stiffness modulus, etc. This enables the simulator to distinguish and accurately simulate the unique dynamic behavior of different materials such as silk and cotton.

[0227] Furthermore, the simulation results output by the clothing simulator can be compared with real experimental data to evaluate and optimize the performance of robot clothing handling. In the aforementioned simulation environment, the clothing simulator can also conduct comparative experiments on clothing simulation data obtained from different robot operation strategies and output standardized error indicators, including deformation error, action completion rate, and time efficiency.

[0228] Experimental results show that the clothing-based simulator described in the embodiments reduces the gap between simulation and reality by more than 20% on average, and up to 77% on clothing with complex topological structures. In terms of running speed, it is 3.0 times faster than the Isaac Sim simulator, which is currently the closest in performance, and can robustly handle highly complex scenarios that other systems cannot handle, while reducing scene initialization time by more than 90%.

[0229] As can be seen from the above, the clothing co-simulation method based on robots and Mujoco described in this application embodiment supports the simulation of both rigid and deformable bodies, has a robust collision handling mechanism, supports variable time step integration, and can query the state of clothing mesh vertices.

[0230] The scope of protection of the clothing co-simulation method based on robots and Mujoco described in this application is not limited to the execution order of the steps listed in this embodiment. Any solution implemented by adding, subtracting, or replacing steps in the prior art based on the principles of this application is included within the scope of protection of this application.

[0231] This application also provides a computer-readable storage medium storing a computer program thereon, which, when executed by a processor, implements the clothing co-simulation method based on robots and Mujoco provided in any embodiment of this application.

[0232] In the embodiments of this application, any combination of one or more storage media can be used. The storage medium can be a computer-readable signal medium or a computer-readable storage medium. A computer-readable storage medium can be, for example—but not limited to—an electrical, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination thereof. More specific examples of computer-readable storage media (a non-exhaustive list) include: an electrical connection having one or more wires, a portable computer disk, a hard disk, RAM, ROM, erasable programmable read-only memory (EPROM or flash memory), optical fiber, portable compact disk read-only memory (CD-ROM), optical storage device, magnetic storage device, or any suitable combination thereof. In this document, a computer-readable storage medium can be any tangible medium that contains or stores a program that can be used by or in conjunction with an instruction execution system, apparatus, or device.

[0233] This application also provides an electronic device. Figure 6 The diagram shown is a structural schematic of the electronic device 100 provided in an embodiment of this application. In some embodiments, the electronic device may be a mobile phone, tablet computer, wearable device, in-vehicle device, augmented reality (AR) / virtual reality (VR) device, laptop computer, ultra-mobile personal computer (UMPC), netbook, personal digital assistant (PDA), or other terminal device. Furthermore, the clothing co-simulation method based on robots and Mujoco provided in this application can also be applied to databases, servers, and service response systems based on terminal artificial intelligence. This application does not limit the specific application scenarios of the clothing co-simulation method based on robots and Mujoco.

[0234] like Figure 6 As shown, the electronic device 100 provided in this application embodiment includes a memory 101 and a processor 102.

[0235] The memory 101 is used to store computer programs; preferably, the memory 101 includes various media that can store program code, such as ROM, RAM, magnetic disk, USB flash drive, memory card or optical disk.

[0236] Specifically, memory 101 may include computer system readable media in the form of volatile memory, such as random access memory (RAM) and / or cache memory. Electronic device 100 may further include other removable / non-removable, volatile / non-volatile computer system storage media. Memory 101 may include at least one program product having a set (e.g., at least one) of program modules configured to perform the functions of the embodiments of this application.

[0237] The processor 102 is connected to the memory 101 and is used to execute the computer program stored in the memory 101 so that the electronic device 100 executes the clothing co-simulation method based on robots and Mujoco provided in any embodiment of this application.

[0238] Optionally, the processor 102 may be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it may also be a digital signal processor (DSP), an application-specific integrated circuit (ASIC), a field-programmable gate array (FPGA), or other programmable logic devices, evaluation index gate or transistor logic devices, or evaluation index hardware components.

[0239] Optionally, in this embodiment, the electronic device 100 may further include a display 103. The display 103 is communicatively connected to the memory 101 and the processor 102, and is used to display the relevant GUI interactive interface of the clothing co-simulation method based on robots and Mujoco.

[0240] The above embodiments are merely illustrative of the principles and effects of this application and are not intended to limit this application. Any person skilled in the art can modify or alter the above embodiments without departing from the spirit and scope of this application. Therefore, all equivalent modifications or alterations made by those skilled in the art without departing from the spirit and technical concept disclosed in this application should still be covered by the claims of this application.< / flexcomp>

Claims

1. A method for co-simulating clothing based on robots and Mujoco, characterized in that, include: In Mujoco simulation, a robot model and a flexible fabric object are defined, and the fabric mesh and physical properties are registered through the FlexComp plugin. The flexible clothing body is constructed based on the continuous medium finite element method. The GPU simulation core is launched and executed in each simulation cycle: Solving for flexible clothing bodies in parallel using VBD on a GPU; The flexible clothing body is subjected to self-interlacing and overlapping processing; Collision detection based on BVH acceleration is performed on the flexible clothing body; The state of the flexible clothing is output and synchronized to the Mujoco simulation, realizing the coupling interaction and joint simulation closed loop between the flexible body and the rigid body.

2. The clothing co-simulation method based on robots and Mujoco according to claim 1, characterized in that, The self-interlacing and overlapping process of the flexible clothing includes: Detect overlapping areas in the fabric topology using an adjacency graph; The penetration depth of each potential collision pair of the cloth is evaluated in parallel on the GPU; If intersecting facets are detected, virtual nodes are inserted for geometric separation, and convergence is gradually achieved in the next frame. The fabric surface is processed based on fabric topological consistency constraints.

3. The clothing co-simulation method based on robots and Mujoco according to claim 1, characterized in that, The collision detection of the flexible clothing body based on BVH acceleration includes: The cloth nodes and rigid body patches are uniformly constructed as GPU BVH; Contact constraint pairs are generated using a parallel reduction algorithm; Based on the contact constraint pair, the BVH core is invoked to perform node-face collision detection in GPU BVH; The collision detection results are fed into the simulation solver for dynamic response.

4. The clothing co-simulation method based on robots and Mujoco according to claim 3, characterized in that, The process of calling the BVH core to perform node-face collision detection in GPU BVH includes: collision detection based on the bounding box hierarchy of the GPU; wherein each cloth particle or mesh cell is regarded as a query probe.

5. The clothing co-simulation method based on robots and Mujoco according to claim 1, characterized in that, The parallel solution of the flexible clothing on the GPU includes: Import clothing simulation data into the clothing simulator; The clothing simulator simulates the dynamic effects of clothing based on a continuous medium finite element model and a simulation solver; wherein: In the continuous medium finite element model, the clothing is modeled in both the in-plane and out-of-plane directions, and an anisotropic model is used to distinguish the tensile and bending responses of the clothing in the warp, weft, and diagonal directions. The simulation solver uses an implicit time integration method to solve the clothing dynamics equation.

6. The clothing co-simulation method based on robots and Mujoco according to claim 5, characterized in that, In the continuous medium finite element model: The fabric is treated as a continuous elastic surface and is divided into triangular grids; Nonlinear modeling is introduced in the out-of-plane direction of the clothing to make the bending stiffness a quadratic function of the curvature.

7. The clothing co-simulation method based on robots and Mujoco according to claim 5, characterized in that, The simulation solver uses an implicit time integration method to solve the clothing dynamics equation, including: The clothing dynamics equations at each time step are solved to construct an objective function that minimizes energy; the objective function is: Where, Δt 2 It is the time step. Let x be the objective function, and x be the vertex position vector of the mesh to be determined. n Let be the position vector at the previous moment, M be the mass matrix, and E(x) be the elastic potential energy of the system. Where H is the stiffness matrix. Δx is the position increment.

8. The clothing co-simulation method based on robots and Mujoco according to claim 5, characterized in that, It also includes accelerating the simulation solver through graph coloring; the graph coloring approximates the global mesh as consisting of many non-overlapping sub-regions; at runtime, sub-regions of the same color only need to perform conflict-free sparse matrix-vector multiplication on the GPU.

9. A computer-readable storage medium having a computer program stored thereon, characterized in that, When the computer program is executed by the processor, it implements the clothing co-simulation method based on robots and Mujoco as described in any one of claims 1 to 8.

10. An electronic device, characterized in that, The electronic device includes: Processor and memory; The memory stores program instructions; The processor is configured to run the program instructions to execute the clothing co-simulation method based on robots and Mujoco as described in any one of claims 1 to 8.