Migrate types in mjs structs.

PiperOrigin-RevId: 942546629
Change-Id: I46f2b24b53a43361fdc67dc32f2af1c0ce8b1de8
This commit is contained in:
Yuval Tassa
2026-07-04 11:27:00 -07:00
committed by Copybara-Service
parent 315bcfbf3a
commit 11f1da0c44
15 changed files with 339 additions and 311 deletions
+59 -59
View File
@@ -1476,21 +1476,21 @@ typedef enum mjtGeomInertia { // type of inertia inference
mjINERTIA_VOLUME = 0, // mass distributed in the volume
mjINERTIA_SHELL, // mass distributed on the surface
} mjtGeomInertia;
typedef enum mjtMeshInertia { // type of mesh inertia
mjMESH_INERTIA_CONVEX = 0, // convex mesh inertia
mjMESH_INERTIA_EXACT, // exact mesh inertia
mjMESH_INERTIA_LEGACY, // legacy mesh inertia
mjMESH_INERTIA_SHELL // shell mesh inertia
typedef enum mjtMeshInertia { // type of mesh inertia
mjMESH_INERTIA_CONVEX = 0, // convex mesh inertia
mjMESH_INERTIA_EXACT, // exact mesh inertia
mjMESH_INERTIA_LEGACY, // legacy mesh inertia
mjMESH_INERTIA_SHELL // shell mesh inertia
} mjtMeshInertia;
typedef enum mjtMeshBuiltin { // type of built-in procedural mesh
mjMESH_BUILTIN_NONE = 0, // no built-in mesh
mjMESH_BUILTIN_SPHERE, // sphere
mjMESH_BUILTIN_HEMISPHERE, // hemisphere
mjMESH_BUILTIN_CONE, // cone
mjMESH_BUILTIN_SUPERSPHERE, // supersphere
mjMESH_BUILTIN_SUPERTORUS, // supertorus
mjMESH_BUILTIN_WEDGE, // wedge
mjMESH_BUILTIN_PLATE, // plate
typedef enum mjtMeshBuiltin { // type of built-in procedural mesh
mjMESH_BUILTIN_NONE = 0, // no built-in mesh
mjMESH_BUILTIN_SPHERE, // sphere
mjMESH_BUILTIN_HEMISPHERE, // hemisphere
mjMESH_BUILTIN_CONE, // cone
mjMESH_BUILTIN_SUPERSPHERE, // supersphere
mjMESH_BUILTIN_SUPERTORUS, // supertorus
mjMESH_BUILTIN_WEDGE, // wedge
mjMESH_BUILTIN_PLATE, // plate
} mjtMeshBuiltin;
typedef enum mjtBuiltin { // type of built-in procedural texture
mjBUILTIN_NONE = 0, // no built-in texture
@@ -1526,12 +1526,12 @@ typedef enum mjtOrientation { // type of orientation specifier
mjORIENTATION_ZAXIS, // z axis (minimal rotation)
mjORIENTATION_EULER, // Euler angles
} mjtOrientation;
typedef enum mjtConflict { // conflict resolution for attach
mjCONFLICT_WARNING = 0, // keep parent, warn on conflict
mjCONFLICT_MERGE, // merge: min/max/error per field
mjCONFLICT_ERROR, // error on any conflict
typedef enum mjtConflict { // conflict resolution for attach
mjCONFLICT_WARNING = 0, // keep parent, warn on conflict
mjCONFLICT_MERGE, // merge: min/max/error per field
mjCONFLICT_ERROR, // error on any conflict
} mjtConflict;
typedef enum mjtCTimer { // compiler timing categories
typedef enum mjtCTimer { // compiler timing categories
// top-level timers (wall-clock)
mjCTIMER_TOTAL = 0, // total compile time
mjCTIMER_ASSETS, // asset compilation
@@ -1552,22 +1552,22 @@ typedef struct mjsElement_ { // element type, do not modify
uint64_t signature; // compilation signature
} mjsElement;
typedef struct mjsCompiler_ { // compiler options
mjtByte autolimits; // infer "limited" attribute based on range
mjtBool autolimits; // infer "limited" attribute based on range
double boundmass; // enforce minimum body mass
double boundinertia; // enforce minimum body diagonal inertia
double settotalmass; // rescale masses and inertias; <=0: ignore
mjtByte balanceinertia; // automatically impose A + B >= C rule
mjtByte fitaabb; // meshfit to aabb instead of inertia box
mjtByte degree; // angles in radians or degrees
mjtBool balanceinertia; // automatically impose A + B >= C rule
mjtBool fitaabb; // meshfit to aabb instead of inertia box
mjtBool degree; // angles in radians or degrees
char eulerseq[3]; // sequence for euler rotations
mjtByte discardvisual; // discard visual geoms in parser
mjtByte usethread; // use multiple threads to speed up compiler
mjtByte fusestatic; // fuse static bodies with parent
int inertiafromgeom; // use geom inertias (mjtInertiaFromGeom)
mjtBool discardvisual; // discard visual geoms in parser
mjtBool usethread; // use multiple threads to speed up compiler
mjtBool fusestatic; // fuse static bodies with parent
mjtInertiaFromGeom inertiafromgeom; // use geom inertias
int inertiagrouprange[2]; // range of geom groups used to compute inertia
mjtByte saveinertial; // save explicit inertial clause for all bodies to XML
int alignfree; // align free joints with inertial frame
int conflict; // conflict resolution for attach (mjtConflict)
mjtBool saveinertial; // save explicit inertial clause for all bodies to XML
mjtBool alignfree; // align free joints with inertial frame
mjtConflict conflict; // conflict resolution for attach
mjLROpt LRopt; // options for lengthrange computation
mjString* meshdir; // mesh and hfield directory
mjString* texturedir; // texture directory
@@ -1591,7 +1591,7 @@ typedef struct mjSpec_ { // model specification
// compiler data
mjsCompiler compiler; // compiler options
mjtByte strippath; // automatically strip paths from mesh files
mjtBool strippath; // automatically strip paths from mesh files
// engine data
mjOption option; // physics options
@@ -1620,7 +1620,7 @@ typedef struct mjSpec_ { // model specification
mjString* modelfiledir; // path to model file
// other
mjtByte hasImplicitPluginElem; // already encountered an implicit plugin sensor/actuator
mjtBool hasImplicitPluginElem; // already encountered an implicit plugin sensor/actuator
// authored tracking bitmasks for mjModel structs
mjsAuthored authored;
@@ -1636,7 +1636,7 @@ typedef struct mjsPlugin_ { // plugin specification
mjsElement* element; // element type
mjString* name; // instance name
mjString* plugin_name; // plugin name
mjtByte active; // is the plugin active
mjtBool active; // is the plugin active
mjString* info; // message appended to compiler errors
} mjsPlugin;
typedef struct mjsBody_ { // body specification
@@ -1657,12 +1657,12 @@ typedef struct mjsBody_ { // body specification
double fullinertia[6]; // non-axis-aligned inertia matrix
// other
mjtByte mocap; // is this a mocap body
mjtBool mocap; // is this a mocap body
double gravcomp; // gravity compensation
mjtSleepPolicy sleep; // sleep policy
mjtByte simple; // simple body optimization (0: false, 1: auto)
mjDoubleVec* userdata; // user data
mjtByte explicitinertial; // whether to save the body with explicit inertial clause
mjtBool explicitinertial; // whether to save the body with explicit inertial clause
mjsPlugin plugin; // passive force plugin
mjString* info; // message appended to compiler errors
} mjsBody;
@@ -1682,7 +1682,7 @@ typedef struct mjsJoint_ { // joint specification
double pos[3]; // anchor position
double axis[3]; // joint axis
double ref; // value at reference configuration: qpos0
int align; // align free joint with body com (mjtAlignFree)
mjtAlignFree align; // align free joint with body com
// stiffness
double stiffness[mjNPOLY+1]; // stiffness coefficients
@@ -1690,12 +1690,12 @@ typedef struct mjsJoint_ { // joint specification
double springdamper[2]; // timeconst, dampratio
// limits
int limited; // does joint have limits (mjtLimited)
mjtLimited limited; // does joint have limits
double range[2]; // joint limits
double margin; // margin value for joint limit detection
mjtNum solref_limit[mjNREF]; // solver reference: joint limits
mjtNum solimp_limit[mjNIMP]; // solver impedance: joint limits
int actfrclimited; // are actuator forces on joint limited (mjtLimited)
mjtLimited actfrclimited; // are actuator forces on joint limited
double actfrcrange[2]; // actuator force limits
// dof properties
@@ -1707,7 +1707,7 @@ typedef struct mjsJoint_ { // joint specification
// other
int group; // group
mjtByte actgravcomp; // is gravcomp force applied via actuators
mjtBool actgravcomp; // is gravcomp force applied via actuators
mjDoubleVec* userdata; // user data
mjString* info; // message appended to compiler errors
} mjsJoint;
@@ -1813,10 +1813,10 @@ typedef struct mjsLight_ { // light specification
mjString* targetbody; // target body for targeting
// intrinsics
mjtByte active; // is light active
mjtBool active; // is light active
mjtLightType type; // type of light
mjString* texture; // texture name for image lights
mjtByte castshadow; // does light cast shadows
mjtBool castshadow; // does light cast shadows
float bulbradius; // bulb radius, for soft shadows
float intensity; // intensity, in candelas
float range; // range of effectiveness
@@ -1828,7 +1828,7 @@ typedef struct mjsLight_ { // light specification
float specular[3]; // specular color
// other
mjString* info; // message appended to compiler errorsx
mjString* info; // message appended to compiler errors
} mjsLight;
typedef struct mjsFlex_ { // flex specification
mjsElement* element; // element type
@@ -1849,9 +1849,9 @@ typedef struct mjsFlex_ { // flex specification
int dim; // element dimensionality
double radius; // radius around primitive element
double size[3]; // vertex bounding box half sizes in qpos0
mjtByte internal; // enable internal collisions
mjtByte flatskin; // render flex skin with flat shading
int selfcollide; // mode for flex self collision
mjtBool internal; // enable internal collisions
mjtBool flatskin; // render flex skin with flat shading
mjtFlexSelf selfcollide; // mode for flex self collision
int passive; // mode for passive collisions
int activelayers; // number of active element layers in 3D
int group; // group for visualization
@@ -1887,8 +1887,8 @@ typedef struct mjsMesh_ { // mesh specification
double refquat[4]; // reference orientation
double scale[3]; // rescale mesh
mjtMeshInertia inertia; // inertia type (convex, legacy, exact, shell)
mjtByte smoothnormal; // do not exclude large-angle faces from normals
mjtByte needsdf; // compute sdf from mesh
mjtBool smoothnormal; // do not exclude large-angle faces from normals
mjtBool needsdf; // compute sdf from mesh
int maxhullvert; // maximum vertex count for the convex hull
mjFloatVec* uservert; // user vertex data
mjFloatVec* usernormal; // user normal data
@@ -1940,8 +1940,8 @@ typedef struct mjsTexture_ { // texture specification
mjtColorSpace colorspace; // colorspace
// method 1: builtin
int builtin; // builtin type (mjtBuiltin)
int mark; // mark type (mjtMark)
mjtBuiltin builtin; // builtin type
mjtMark mark; // mark type
double rgb1[3]; // first color for builtin
double rgb2[3]; // second color for builtin
double markrgb[3]; // mark color
@@ -1963,8 +1963,8 @@ typedef struct mjsTexture_ { // texture specification
mjByteVec* data; // texture data
// flip options
mjtByte hflip; // horizontal flip
mjtByte vflip; // vertical flip
mjtBool hflip; // horizontal flip
mjtBool vflip; // vertical flip
// other
mjString* info; // message appended to compiler errors
@@ -1972,7 +1972,7 @@ typedef struct mjsTexture_ { // texture specification
typedef struct mjsMaterial_ { // material specification
mjsElement* element; // element type
mjStringVec* textures; // names of textures (empty: none)
mjtByte texuniform; // make texture cube uniform
mjtBool texuniform; // make texture cube uniform
float texrepeat[2]; // texture repetition for 2D mapping
float emission; // emission
float specular; // specular
@@ -2008,7 +2008,7 @@ typedef struct mjsEquality_ { // equality specification
mjsElement* element; // element type
mjtEq type; // constraint type
double data[mjNEQDATA]; // type-dependent data
mjtByte active; // is equality initially active
mjtBool active; // is equality initially active
mjString* name1; // name of object 1
mjString* name2; // name of object 2
mjtObj objtype; // type of both objects
@@ -2029,8 +2029,8 @@ typedef struct mjsTendon_ { // tendon specification
double armature; // inertia associated with tendon velocity
// length range
int limited; // does tendon have limits (mjtLimited)
int actfrclimited; // does tendon have actuator force limits
mjtLimited limited; // does tendon have limits
mjtLimited actfrclimited; // does tendon have actuator force limits
double range[2]; // length limits
double actfrcrange[2]; // actuator force limits
double margin; // margin value for tendon limit detection
@@ -2065,7 +2065,7 @@ typedef struct mjsActuator_ { // actuator specification
mjtDyn dyntype; // dynamics type
double dynprm[mjNDYN]; // dynamics parameters
int actdim; // number of activation variables
mjtByte actearly; // apply next activations to qfrc
mjtBool actearly; // apply next activations to qfrc
// transmission
mjtTrn trntype; // transmission type
@@ -2080,11 +2080,11 @@ typedef struct mjsActuator_ { // actuator specification
double armature; // armature inertia
// input/output clamping
int ctrllimited; // are control limits defined (mjtLimited)
mjtLimited ctrllimited; // are control limits defined
double ctrlrange[2]; // control range
int forcelimited; // are force limits defined (mjtLimited)
mjtLimited forcelimited; // are force limits defined
double forcerange[2]; // force range
int actlimited; // are activation limits defined (mjtLimited)
mjtLimited actlimited; // are activation limits defined
double actrange[2]; // activation range
// other