CN-122008194-A - Interactive simulation platform and method based on physical engine
Abstract
The invention discloses an interactive simulation platform and method based on a physical engine, in particular relates to the technical field of virtual assembly simulation of industrial robots, and aims to solve the problems that in the traditional mechanical arm assembly training simulation, parameter modeling is inconsistent with field equipment, a terminal operation time axis is not uniform, a training process is difficult to reproduce and quantitative evaluation basis is lacking. The method comprises the steps of uniformly modeling the mass, inertia, limit, friction and control periods of a mechanical arm and an assembly object on a simulation server side, generating parameter vectors with parameter fingerprints and version numbers, and carrying out complete trace remaining on the dynamic configuration and interaction process of each training session by combining a uniform time service clock, a time base mapping table, an interaction event sequence and an evidence chain organized according to time windows, so that the effects of one-to-one correspondence of a simulation model and field equipment, precise alignment of terminal control input and simulation steps, stable reproduction of a history session and quantitative comparison of simulation behavior differences are achieved.
Inventors
- SHEN JIE
- LI LIN
- WANG ZI
Assignees
- 上海摩泛科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260122
Claims (9)
- 1. An interactive simulation method based on a physical engine, comprising: S1, reading the mass, the moment of inertia, the joint limit parameters, the friction parameters and the control period of a mechanical arm and an assembly object in a simulation server, generating a parameter vector and a corresponding parameter fingerprint, and configuring a rigid body and a constraint in a physical engine according to the parameter vector and the corresponding parameter fingerprint; s2, setting unified time service clock synchronization terminal time in a simulation server, pushing simulation time in a physical engine according to a fixed step length, and recording the corresponding relation between time service time and simulation step time to form a time base mapping table; S3, the terminal marks and controls input according to the unified time service time and uploads the input, the simulation server classifies the input into corresponding simulation steps according to the time base mapping table, and the input is arranged according to time sequences to generate an interactive event sequence; S4, dividing an operation slice on a time base mapping table according to a time window, extracting a simulation state when the operation slice is finished, combining the simulation state, the parameter fingerprint and the interaction event sequence in the window into evidence nodes, and recording node fingerprints; S5, recovering a parameter version according to the parameter fingerprint during reproduction training, driving a physical engine to operate according to time base information and an interaction event sequence in the evidence node, extracting a simulation state at an operation slice boundary, and comparing the simulation state with the state in the evidence node to obtain a deviation index; S6, inputting the deviation index into a simulation configuration adjustment module, and adjusting friction, contact stiffness and simulation step length to obtain new parameter vectors and parameter fingerprints.
- 2. The interactive simulation method based on a physical engine according to claim 1, wherein S1 comprises: Arranging a simulation server on a mechanical arm assembly training production line; The simulation server reads the mass, the moment of inertia, the joint limiting parameters, the friction parameters and the control period of the mechanical arm and the assembly object, and constructs a parameter vector according to the joint number and the fixed field sequence after unit unification and consistency verification are completed; Converting the parameter vector into text and executing one-way mapping operation to generate parameter fingerprints; and allocating parameter version numbers to the parameter vectors, storing the parameter version numbers, the parameter vectors and the parameter fingerprints into a device parameter library, and configuring rigid bodies and constraints for the mechanical arm and the assembly object in a physical engine according to the parameter vectors.
- 3. The interactive simulation method based on a physical engine according to claim 1, wherein S2 comprises: the simulation server sets a unified time service clock, and broadcasts a time service message to the terminal by taking the local clock of the simulation server as a time reference, wherein the time service message carries a unified time service time and a time base configuration number; The terminal calculates time deviation according to the unified time service time and the local time, stores the time deviation into a time base alignment module, and obtains a time mark aligned with the unified time service time based on the time deviation when generating a control input message; the simulation server presets a simulation step length in the physical engine, reads unified time service time at the beginning of each simulation step, forms a time base record with the simulation step number and the simulation time, and constructs a time base mapping table according to the sequence of the simulation step numbers.
- 4. The interactive simulation method based on a physical engine according to claim 1, wherein S3 comprises: When a control input is generated, the terminal converts local time into unified time service time according to the time base alignment module, and writes the unified time service time, the terminal identification, the session identification and the local sequence number into a control input message; When receiving a control input message, the simulation server constructs an idempotent key according to the terminal identification, the session identification and the local sequence number, and is used for de-duplicating the control input; The simulation server classifies the control input into corresponding simulation steps according to the time base mapping table, and generates an interactive event sequence according to the unified time service time and the terminal identification sequence in the simulation steps.
- 5. The interactive simulation method based on a physical engine according to claim 1, wherein S4 comprises: the simulation server divides the operation slices according to the unified time service time based on the time base mapping table, and allocates a starting unified time service time, an ending unified time service time and a window sequence number for each operation slice; And when the running slice is finished, reading the joint angles of the mechanical arm, the joint angular speeds of the mechanical arm, the pose of the assembly object, the contact occurrence times, the assembly success state and the constraint solution convergence mark from the physical engine, and generating evidence nodes by combining the parameter fingerprint and the interactive event sequence abstract in the window.
- 6. The interactive simulation method based on the physical engine of claim 5, wherein the simulation server selects a window sequence number, a window start unified time service time, a window end unified time service time, a parameter fingerprint value, an assembly success state, a contact occurrence number, a constraint solution convergence mark and an interactive event sequence abstract value from the evidence nodes, constructs a text according to a fixed sequence and a unified format, and executes one-way abstract operation to obtain a node fingerprint; And the simulation server stores the evidence nodes and the node fingerprints into a session storage area according to the sequence of the window sequence numbers to form an evidence chain carrying session identifications, parameter version numbers, time base configuration numbers and the number of the nodes.
- 7. The interactive simulation method based on a physical engine according to claim 1, wherein S5 comprises: the simulation server retrieves the evidence chain and the associated parameter fingerprint, parameter version number and time base mapping table according to the session identifier; Recovering parameter vectors from the equipment parameter library according to the parameter fingerprints and the parameter version numbers, and reconstructing corresponding relations of the mechanical arm rigid body, the constraint and the simulation steps and the unified time service moment in the physical engine; according to the sequence of the running slices of the evidence chain, the interactive event sequence of each running slice is acted on a physical engine, the simulation state is extracted at the boundary of the running slice and is compared with the simulation state recorded in the evidence node to generate a deviation index which is used for representing the consistency of the reproduction process and the original session.
- 8. The interactive simulation method based on a physical engine according to claim 1, wherein S6 comprises: Setting a simulation configuration adjustment module in a simulation server; after the simulation server completes the reproduction of the training session, the comprehensive deviation statistical result, the session identifier and the parameter version number of the training session are sent to a simulation configuration adjustment module; And when the deviation index exceeds a preset threshold and the number of training sessions completed since the last parameter adjustment reaches a preset minimum interval session number, the simulation configuration adjustment module executes amplitude limiting adjustment on friction parameters, contact stiffness parameters and simulation step sizes in the simulation parameter vectors to generate new parameter vectors and parameter fingerprints, and writes the new and old parameter vectors, the new and old parameter fingerprints and the deviation index triggering adjustment into a configuration change log.
- 9. A physics engine based interactive simulation platform for implementing the physics engine based interactive simulation method of any one of claims 1-8, comprising: the parameter modeling module is used for reading the mass, the moment of inertia, the joint limiting parameter, the friction parameter and the control period of the mechanical arm and the assembly object in the simulation server, generating a parameter vector and a corresponding parameter fingerprint, and configuring a mechanical arm rigid body and constraint in the physical engine based on the parameter vector; the time base configuration module is used for setting a unified time service clock in the simulation server to synchronize the terminal time, advancing the simulation time in the physical engine according to a fixed step length, and recording the corresponding relation between the unified time service time and the simulation step time to form a time base mapping table; The control input processing module is used for enabling the terminal to mark control input according to the unified time service time and upload the control input, enabling the simulation server to classify the control input into corresponding simulation steps according to the time base mapping table and generating an interactive event sequence according to time sequence arrangement; The evidence node construction module is used for dividing an operation slice on the time base mapping table according to the time window, extracting a simulation state when the operation slice is finished, combining the simulation state, the parameter fingerprint and the interaction event sequence in the window into evidence nodes and recording node fingerprints; The session reproduction module is used for recovering parameter versions according to the parameter fingerprints during reproduction training, driving a physical engine to operate according to time base information and interaction event sequences in the evidence nodes, extracting simulation states at the boundary of the operation slice, and comparing the simulation states with the states in the evidence nodes to obtain deviation indexes; The simulation configuration adjustment module is used for receiving the deviation index and carrying out amplitude limiting adjustment on the friction parameter, the contact stiffness parameter and the simulation step length in the parameter vector to generate a new parameter vector and a corresponding parameter fingerprint.
Description
Interactive simulation platform and method based on physical engine Technical Field The invention relates to the technical field of virtual assembly simulation of industrial robots, in particular to an interactive simulation platform and method based on a physical engine. Background The field commonly adopts a mechanical arm assembly training system based on simulation software or a physical engine, and replaces partial field actual operation by a virtual scene so as to reduce trial-and-error cost and improve training efficiency. The existing system generally establishes a mechanical arm and an assembly object model on a simulation server or a single workstation, a learner issues action instructions to the virtual mechanical arm through equipment such as a display terminal, an operation handle and the like, the system records part of control tracks and assessment results and is used for evaluating the operation level of the learner, and part of the system also supports adjustment of simulation parameters so as to be close to on-site working conditions. However, the conventional mechanical arm assembly simulation still has obvious defects in the aspects of management and model consistency of the training process, namely, on one hand, the mechanical arm and the assembled object have scattered parameter sources such as mass, inertia, joint limit, friction, control period and the like, not only have factory documents, but also have field calibration and maintenance adjustment records, and lack a unified modeling and versioning management mechanism, the specific parameter combination adopted during training is difficult to trace back after the fact accurately, and on the other hand, the simulation server, the student terminal and the teacher terminal usually only depend on respective local clocks or simple time stamps, lack time base mapping of unified time service and simulation steps, have unclear corresponding relations between terminal control input and simulation steps, and have difficult strict alignment of recorded operation time axes and simulation internal time axes. Meanwhile, the existing system stays on log files, final scores or a small number of key events for the trace of the training process, and the lack of structural records which are organized according to time windows and can correlate the dynamic state and the interactive behavior leads to difficulty in accurately replaying and quantitatively analyzing differences of training sessions in different periods after parameter configuration is replaced, simulation software is upgraded or real mechanical arm data is introduced. Therefore, the prior art has difficulty in meeting the following concentrated technical requirements, namely, in the mechanical arm assembly training simulation, how to carry out structuring and version recording on the dynamic parameter configuration and the learner interaction process of the mechanical arm and an assembly object under a unified time base, so that the model configuration, the time axis and the interaction behavior of each training session can be accurately traced back and stably reproduced, and the simulation behavior difference between different sessions can be quantitatively evaluated after the parameters or the working conditions are changed, thereby providing reliable basis for training quality control and simulation model calibration. Disclosure of Invention Aiming at the defects of the prior art, the invention provides an interactive simulation platform and method based on a physical engine, which are used for solving the problems in the background art. In order to achieve the above purpose, the invention provides a physical engine-based interactive simulation method, which comprises the following steps: S1, reading the mass, the moment of inertia, the joint limit parameters, the friction parameters and the control period of a mechanical arm and an assembly object in a simulation server, generating a parameter vector and a corresponding parameter fingerprint, and configuring a rigid body and a constraint in a physical engine according to the parameter vector and the corresponding parameter fingerprint; s2, setting unified time service clock synchronization terminal time in a simulation server, pushing simulation time in a physical engine according to a fixed step length, and recording the corresponding relation between time service time and simulation step time to form a time base mapping table; S3, the terminal marks and controls input according to the unified time service time and uploads the input, the simulation server classifies the input into corresponding simulation steps according to the time base mapping table, and the input is arranged according to time sequences to generate an interactive event sequence; S4, dividing an operation slice on a time base mapping table according to a time window, extracting a simulation state when the operation slice is finished, combining the simulation state,