CN-122021015-A - Artificial muscle simulation method and system based on MuJoCo plug-in architecture and robot
Abstract
The invention relates to an artificial muscle simulation method, system and robot based on MuJoCo plug-in architecture, which comprises the steps of defining configurable parameters required by a mechanical model of an artificial muscle, constructing a mapping relation between the configurable parameters and XML attribute names in MuJoCo model description files, reading configuration character strings according to the XML attribute names and the mapping relation used in MuJoCo plug-in configuration, analyzing the configuration character strings into values corresponding to the configurable parameters to obtain initialized model parameters of the mechanical model, instantiating a polynomial constitutive model in the mechanical model based on the initialized model parameters, integrating the artificial muscle model plug-in comprising the polynomial constitutive model into a MuJoCo simulation engine as an executable module by registering a defined callback interface with the MuJoCo plug-in architecture, calling and executing simulation of the artificial muscle model plug-in by utilizing the integrated MuJoCo simulation engine, and calculating output force of the artificial muscle. The invention realizes the artificial muscle dynamics simulation with high precision, high integration and strong usability.
Inventors
- HUANG LI
- Shan Songjunjie
- LIU YAFEI
- ZHANG CAN
- Yin Houfang
Assignees
- 武汉真友科技有限公司
Dates
- Publication Date
- 20260512
- Application Date
- 20260128
Claims (10)
- 1. An artificial muscle simulation method based on MuJoCo plug-in architecture, which is characterized by comprising the following steps: defining configurable parameters required by a mechanical model of the artificial muscle, and constructing a mapping relation between the configurable parameters and XML attribute names in MuJoCo model description files; Reading a configuration character string from the MuJoCo model description file according to XML attribute names and the mapping relation used in MuJoCo plug-in configuration, and analyzing the configuration character string into a numerical value corresponding to the configurable parameter to obtain an initialized model parameter of the mechanical model of the artificial muscle; Instantiating a polynomial constitutive model in the mechanical model based on the initialized model parameters; integrating an artificial muscle model plug-in containing the polynomial constitutive model as an executable module into a MuJoCo simulation engine by registering a defined callback interface with MuJoCo plug-in architecture; and invoking and executing the simulation of the artificial muscle model plug-in by utilizing MuJoCo simulation engines integrated with the artificial muscle model plug-in so as to calculate the output force of the artificial muscle.
- 2. The MuJoCo plug-in architecture based artificial muscle simulation method of claim 1 wherein instantiating a polynomial constitutive model of the mechanical model based on the initialization model parameters comprises: extracting geometric mapping parameters from the initialized model parameters; Calculating bionic length parameters of the artificial muscle according to the length range parameters of the actuator and the geometric mapping parameters defined in the MuJoCo model description file; extracting each term coefficient of the polynomial from the initialized model parameters; and configuring the bionic length parameter and the coefficient, and instantiating a polynomial constitutive model in the mechanical model.
- 3. The artificial muscle simulation method based on MuJoCo plug-in architecture according to claim 2, wherein the bionic length parameters of the artificial muscle include a muscle natural length and a tendon fixed length; the calculating the bionic length parameter of the artificial muscle according to the length range parameter of the actuator and the geometric mapping parameter defined in the MuJoCo model description file comprises the following steps: acquiring the length ranges a0 and a1 of the executors defined in the MuJoCo model description file; obtaining geometric mapping parameters scaled_rang0 and scaled_rang1 extracted from the initialized model parameters, wherein the geometric mapping parameters are dimensionless parameters; Calculating bionic length parameters of the artificial muscle according to the following formula: Muscle natural length l_0= (a 1-a 0)/(scaled_range 1-scaled_range 0); Tendon fixation length l_t=a0-l_0 x scaled_range0; wherein a0 and a1 are respectively a tendon length lower limit and a tendon length upper limit, and scaled_range0 and scaled_range1 respectively represent a muscle scaling length lower limit and a muscle scaling length upper limit.
- 4. The artificial muscle simulation method based on MuJoCo plug-in architecture according to claim 1, wherein the polynomial constitutive model is a polynomial model of degree N representing a function of muscle length L and input pressure P to calculate output force, and includes at least constant terms, each of the first order term, the second order term, the third order term, and the cross term therebetween, where N is a natural number greater than 2.
- 5. The artificial muscle simulation method based on MuJoCo plug-in architecture as defined in claim 1, wherein the invoking and executing the simulation with the MuJoCo simulation engine integrated with the artificial muscle model plug-in includes: in each simulation step, obtaining the current input pressure and the current muscle length of the artificial muscle through a registered callback interface in the MuJoCo simulation engine integrated with the artificial muscle model plug-in; and executing polynomial calculation of the polynomial constitutive model according to the current input pressure and the current muscle length to obtain the output force of the artificial muscle.
- 6. The MuJoCo plugin architecture-based artificial muscle simulation method of claim 5 further comprising, prior to the performing polynomial computation of the polynomial constitutive model based on the current input pressure and the current muscle length: Converting the current muscle length value into a length value under a preset length unit; And converting the current pressure value into a pressure value under a preset pressure unit.
- 7. The method for artificial muscle simulation based on MuJoCo plug-in architecture of claim 5, further comprising: performing upper and lower limit clamping processing on the current pressure value, and/or, Clipping the output force, and/or, And resetting the current activation state of the artificial muscle model plug-in when the current pressure value is detected to be lower than a preset threshold value.
- 8. The method for artificial muscle simulation based on MuJoCo plug-in architecture of claim 1, further comprising: And maintaining at least two double-precision floating point type state variables by using a state array provided by MuJoCo plug-in architecture, wherein the two double-precision floating point type state variables are respectively used for storing the current pressure value of the last simulation step and the current activation state of the artificial muscle model plug-in.
- 9. An artificial muscle simulation system based on MuJoCo plug-in architecture, comprising: the construction unit is used for defining the configurable parameters required by the mechanical model of the artificial muscle and constructing the mapping relation between the configurable parameters and XML attribute names in MuJoCo model description files; The analysis unit is used for reading a configuration character string from the MuJoCo model description file according to XML attribute names and the mapping relation used in MuJoCo plug-in configuration, and analyzing the configuration character string into a numerical value corresponding to the configurable parameter to obtain an initialized model parameter of the mechanical model of the artificial muscle; An instantiation unit, configured to instantiate a polynomial constitutive model in the mechanical model based on the initialization model parameters; An integration unit, configured to integrate an artificial muscle model plug-in including the polynomial constitutive model as an executable module into a MuJoCo simulation engine by registering the defined callback interface with a MuJoCo plug-in architecture; and the simulation unit is used for calling and executing the simulation of the artificial muscle model plug-in by utilizing the MuJoCo simulation engine integrated with the artificial muscle model plug-in so as to calculate the output force of the artificial muscle.
- 10. A robot comprising a memory and a processor, wherein the memory is configured to store a program; the processor, coupled to the memory, is configured to execute the program stored in the memory to implement the steps in the MuJoCo plug-in architecture-based artificial muscle simulation method as set forth in any one of claims 1 to 8.
Description
Artificial muscle simulation method and system based on MuJoCo plug-in architecture and robot Technical Field The invention relates to the technical field of robot control, in particular to an artificial muscle simulation method and system based on MuJoCo plug-in architecture and a robot. Background MuJoCo (Multi-Joint DYNAMICS WITH Contact) is a high-performance physical simulation platform widely applied to the fields of robots, biomechanics and the like. However, the library of MuJoCo native actuator models does not contain dedicated constitutive models for pneumatic (Pneumatic Artificial Muscle, PAM) or hydraulic muscles. In the related art, when a researcher simulates the hydraulic muscle in MuJoCo, two types of alternative schemes are mainly adopted, one type is a simplified force source model, the other type is mainly approximately replaced by a simple model such as an ideal force source or a linear spring, and the like, the simulation mode cannot reflect the non-linear, pressure-length coupling, saturation effect and other mechanical characteristics of the hydraulic muscle, so that a simulation result is seriously deviated from the actual physical behavior, and the confidence is low. Another class is complex joint simulation, which is to write independent muscle dynamics programs outside MuJoCo, exchanging data with MuJoCo through inter-process communication (e.g., TCP/IP). The simulation scheme has poor integration level, complex configuration and difficult debugging, and communication delay can destroy the real-time performance of the simulation. In summary, the prior art cannot realize artificial muscle dynamics simulation with high precision, high integration and strong usability in MuJoCo platforms, which severely restricts the development process of advanced equipment such as bionic robots, flexible exoskeletons and the like based on models. Disclosure of Invention In view of the foregoing, it is necessary to provide an artificial muscle simulation method, system and robot based on MuJoCo plug-in architecture, so as to solve the technical problem that the prior art cannot realize artificial muscle dynamics simulation with high accuracy, high integration and strong usability in the MuJoCo platform. To solve the above problems, in a first aspect, the present invention provides an artificial muscle simulation method based on MuJoCo plug-in architecture, including: defining configurable parameters required by a mechanical model of the artificial muscle, and constructing a mapping relation between the configurable parameters and XML attribute names in MuJoCo model description files; Reading a configuration character string from the MuJoCo model description file according to XML attribute names and the mapping relation used in MuJoCo plug-in configuration, and analyzing the configuration character string into a numerical value corresponding to the configurable parameter to obtain an initialized model parameter of the mechanical model of the artificial muscle; Instantiating a polynomial constitutive model in the mechanical model based on the initialized model parameters; integrating an artificial muscle model plug-in containing the polynomial constitutive model as an executable module into a MuJoCo simulation engine by registering a defined callback interface with MuJoCo plug-in architecture; and invoking and executing the simulation of the artificial muscle model plug-in by utilizing MuJoCo simulation engines integrated with the artificial muscle model plug-in so as to calculate the output force of the artificial muscle. In one possible implementation manner, the instantiating the polynomial constitutive model in the mechanical model based on the initialized model parameters includes: extracting geometric mapping parameters from the initialized model parameters; Calculating bionic length parameters of the artificial muscle according to the length range parameters of the actuator and the geometric mapping parameters defined in the MuJoCo model description file; extracting each term coefficient of the polynomial from the initialized model parameters; and configuring the bionic length parameter and the coefficient, and instantiating a polynomial constitutive model in the mechanical model. In one possible implementation, the bionic length parameters of the artificial muscle include a muscle natural length and a tendon fixation length; the calculating the bionic length parameter of the artificial muscle according to the length range parameter of the actuator and the geometric mapping parameter defined in the MuJoCo model description file comprises the following steps: acquiring the length ranges a0 and a1 of the executors defined in the MuJoCo model description file; obtaining geometric mapping parameters scaled_rang0 and scaled_rang1 extracted from the initialized model parameters, wherein the geometric mapping parameters are dimensionless parameters; Calculating bionic length parameters of the artifici