Modernize struct and enum style in MuJoCo headers.

PiperOrigin-RevId: 936485706
Change-Id: I31864acc4bd44573127d3d04c6b1a23f9d9c4cbc
This commit is contained in:
Kyle Bayes
2026-06-23 00:47:13 -07:00
committed by Copybara-Service
parent afccd36dd4
commit 0fd7bea973
12 changed files with 463 additions and 548 deletions
+157 -194
View File
@@ -16,14 +16,13 @@
// Error: C reference not found // Error: C reference not found
// NOLINTBEGIN // NOLINTBEGIN
struct mjPreContact_ { // contact parameters set by narrowphase collision functions typedef struct mjPreContact_ { // contact parameters set by narrowphase collision functions
mjtNum dist; mjtNum dist;
mjtNum pos[3]; mjtNum pos[3];
mjtNum normal[3]; // contact normal of the collision mjtNum normal[3]; // contact normal of the collision
mjtNum tangent[3]; // first tangent direction mjtNum tangent[3]; // first tangent direction
}; } mjPreContact;
typedef struct mjPreContact_ mjPreContact; typedef struct mjContact_ { // result of collision detection functions
struct mjContact_ { // result of collision detection functions
// contact parameters set by narrowphase collision function // contact parameters set by narrowphase collision function
mjtNum dist; // distance between nearest points; neg: penetration mjtNum dist; // distance between nearest points; neg: penetration
mjtNum pos[3]; // position of contact point: midpoint between geoms mjtNum pos[3]; // position of contact point: midpoint between geoms
@@ -54,29 +53,25 @@ struct mjContact_ { // result of collision detection functions
// address computed by mj_instantiateContact // address computed by mj_instantiateContact
int efc_address; // address in efc; -1: not included int efc_address; // address in efc; -1: not included
}; } mjContact;
typedef struct mjContact_ mjContact; typedef struct mjWarningStat_ { // warning statistics
struct mjWarningStat_ { // warning statistics int lastinfo; // info from last warning
int lastinfo; // info from last warning int number; // how many times was warning raised
int number; // how many times was warning raised } mjWarningStat;
}; typedef struct mjTimerStat_ { // timer statistics
typedef struct mjWarningStat_ mjWarningStat; mjtNum duration; // cumulative duration
struct mjTimerStat_ { // timer statistics int number; // how many times was timer called
mjtNum duration; // cumulative duration } mjTimerStat;
int number; // how many times was timer called typedef struct mjSolverStat_ { // per-iteration solver statistics
}; mjtNum improvement; // cost reduction, scaled by 1/trace(M(qpos0))
typedef struct mjTimerStat_ mjTimerStat; mjtNum gradient; // gradient norm (primal only, scaled)
struct mjSolverStat_ { // per-iteration solver statistics mjtNum lineslope; // slope in linesearch
mjtNum improvement; // cost reduction, scaled by 1/trace(M(qpos0)) int nactive; // number of active constraints
mjtNum gradient; // gradient norm (primal only, scaled) int nchange; // number of constraint state changes
mjtNum lineslope; // slope in linesearch int neval; // number of cost evaluations in line search
int nactive; // number of active constraints int nupdate; // number of Cholesky updates in line search
int nchange; // number of constraint state changes } mjSolverStat;
int neval; // number of cost evaluations in line search typedef struct mjData_ {
int nupdate; // number of Cholesky updates in line search
};
typedef struct mjSolverStat_ mjSolverStat;
struct mjData_ {
// constant sizes // constant sizes
mjtSize narena; // size of the arena in bytes (inclusive of the stack) mjtSize narena; // size of the arena in bytes (inclusive of the stack)
mjtSize nbuffer; // size of main buffer in bytes mjtSize nbuffer; // size of main buffer in bytes
@@ -388,9 +383,8 @@ struct mjData_ {
// compilation signature // compilation signature
uint64_t signature; // also held by the mjSpec that compiled the model uint64_t signature; // also held by the mjSpec that compiled the model
}; } mjData;
typedef struct mjData_ mjData; typedef struct mjLROpt_ { // options for mj_setLengthRange()
struct mjLROpt_ { // options for mj_setLengthRange()
// flags // flags
int mode; // which actuators to process (mjtLRMode) int mode; // which actuators to process (mjtLRMode)
int useexisting; // use existing length range if available int useexisting; // use existing length range if available
@@ -404,17 +398,14 @@ struct mjLROpt_ { // options for mj_setLengthRange()
mjtNum inttotal; // total simulation time interval mjtNum inttotal; // total simulation time interval
mjtNum interval; // evaluation time interval (at the end) mjtNum interval; // evaluation time interval (at the end)
mjtNum tolrange; // convergence tolerance (relative to range) mjtNum tolrange; // convergence tolerance (relative to range)
}; } mjLROpt;
typedef struct mjLROpt_ mjLROpt; typedef struct mjCache_ { // asset cache used by the compiler
struct mjCache_ { // asset cache used by the compiler
void* impl_; // internal pointer to cache void* impl_; // internal pointer to cache
}; } mjCache;
typedef struct mjCache_ mjCache; typedef struct mjVFS_ { // virtual file system for loading from memory
struct mjVFS_ { // virtual file system for loading from memory
void* impl_; // internal pointer to VFS memory void* impl_; // internal pointer to VFS memory
}; } mjVFS;
typedef struct mjVFS_ mjVFS; typedef struct mjOption_ { // physics options
struct mjOption_ { // physics options
// timing parameters // timing parameters
mjtNum timestep; // timestep mjtNum timestep; // timestep
@@ -457,9 +448,8 @@ struct mjOption_ { // physics options
// sdf collision settings // sdf collision settings
int sdf_initpoints; // number of starting points for gradient descent int sdf_initpoints; // number of starting points for gradient descent
int sdf_iterations; // max number of iterations for gradient descent int sdf_iterations; // max number of iterations for gradient descent
}; } mjOption;
typedef struct mjOption_ mjOption; typedef struct mjVisual_ { // visualization options
struct mjVisual_ { // visualization options
struct { // global parameters struct { // global parameters
int cameraid; // initial camera id (-1: free) int cameraid; // initial camera id (-1: free)
int orthographic; // is the free camera orthographic (0: no, 1: yes) int orthographic; // is the free camera orthographic (0: no, 1: yes)
@@ -554,17 +544,15 @@ struct mjVisual_ { // visualization options
float bv[4]; // bounding volume float bv[4]; // bounding volume
float bvactive[4]; // active bounding volume float bvactive[4]; // active bounding volume
} rgba; } rgba;
}; } mjVisual;
typedef struct mjVisual_ mjVisual; typedef struct mjStatistic_ { // model statistics (in qpos0)
struct mjStatistic_ { // model statistics (in qpos0)
mjtNum meaninertia; // mean diagonal inertia mjtNum meaninertia; // mean diagonal inertia
mjtNum meanmass; // mean body mass mjtNum meanmass; // mean body mass
mjtNum meansize; // mean body size mjtNum meansize; // mean body size
mjtNum extent; // spatial extent mjtNum extent; // spatial extent
mjtNum center[3]; // center of model mjtNum center[3]; // center of model
}; } mjStatistic;
typedef struct mjStatistic_ mjStatistic; typedef struct mjModel_ {
struct mjModel_ {
// ------------------------------- sizes // ------------------------------- sizes
// sizes needed at mjModel construction // sizes needed at mjModel construction
@@ -1215,17 +1203,15 @@ struct mjModel_ {
// compilation signature // compilation signature
uint64_t signature; // also held by the mjSpec that compiled this model uint64_t signature; // also held by the mjSpec that compiled this model
}; } mjModel;
typedef struct mjModel_ mjModel; typedef struct mjResource_ {
struct mjResource_ {
char* name; // name of resource (filename, etc) char* name; // name of resource (filename, etc)
void* data; // opaque data pointer void* data; // opaque data pointer
mjVFS* vfs; // pointer to the VFS mjVFS* vfs; // pointer to the VFS
char timestamp[512]; // timestamp of the resource char timestamp[512]; // timestamp of the resource
const struct mjpResourceProvider* provider; // pointer to the provider const struct mjpResourceProvider* provider; // pointer to the provider
}; } mjResource;
typedef struct mjResource_ mjResource; typedef struct mjpResourceProvider {
struct mjpResourceProvider {
const char* prefix; // prefix for match against a resource name const char* prefix; // prefix for match against a resource name
mjfOpenResource open; // opening callback mjfOpenResource open; // opening callback
mjfReadResource read; // reading callback mjfReadResource read; // reading callback
@@ -1234,9 +1220,8 @@ struct mjpResourceProvider {
mjfUnmountResource unmount; // unmounting callback (optional) mjfUnmountResource unmount; // unmounting callback (optional)
mjfResourceModified modified; // resource modified callback (optional) mjfResourceModified modified; // resource modified callback (optional)
void* data; // opaque data pointer (resource invariant) void* data; // opaque data pointer (resource invariant)
}; } mjpResourceProvider;
typedef struct mjpResourceProvider mjpResourceProvider; typedef struct mjpDecoder {
struct mjpDecoder {
const char* content_type; const char* content_type;
const char* extension; const char* extension;
// user-facing functions // user-facing functions
@@ -1244,22 +1229,20 @@ struct mjpDecoder {
mjfDecode decode; // main decoding function mjfDecode decode; // main decoding function
// the caller takes ownership of the spec returned by decode and is responsible // the caller takes ownership of the spec returned by decode and is responsible
// for cleaning it up // for cleaning it up
}; } mjpDecoder;
typedef struct mjpDecoder mjpDecoder; typedef struct mjpEncoder {
struct mjpEncoder {
const char* content_type; const char* content_type;
const char* extension; const char* extension;
mjfEncode encode; // Function to encode an mjSpec and mjModel to a mjResource. mjfEncode encode; // Function to encode an mjSpec and mjModel to a mjResource.
mjfCloseResource close_resource; // Function to close/free the resource. mjfCloseResource close_resource; // Function to close/free the resource.
}; } mjpEncoder;
typedef struct mjpEncoder mjpEncoder;
typedef enum mjtPluginCapabilityBit_ { typedef enum mjtPluginCapabilityBit_ {
mjPLUGIN_ACTUATOR = 1<<0, // actuator forces mjPLUGIN_ACTUATOR = 1<<0, // actuator forces
mjPLUGIN_SENSOR = 1<<1, // sensor measurements mjPLUGIN_SENSOR = 1<<1, // sensor measurements
mjPLUGIN_PASSIVE = 1<<2, // passive forces mjPLUGIN_PASSIVE = 1<<2, // passive forces
mjPLUGIN_SDF = 1<<3, // signed distance fields mjPLUGIN_SDF = 1<<3, // signed distance fields
} mjtPluginCapabilityBit; } mjtPluginCapabilityBit;
struct mjpPlugin_ { typedef struct mjpPlugin_ {
const char* name; // globally unique name identifying the plugin const char* name; // globally unique name identifying the plugin
int nattribute; // number of configuration attributes int nattribute; // number of configuration attributes
@@ -1317,17 +1300,15 @@ struct mjpPlugin_ {
// bounding box of implicit surface // bounding box of implicit surface
void (*sdf_aabb)(mjtNum aabb[6], const mjtNum* attributes); void (*sdf_aabb)(mjtNum aabb[6], const mjtNum* attributes);
}; } mjpPlugin;
typedef struct mjpPlugin_ mjpPlugin; typedef struct mjSDF_ {
struct mjSDF_ {
const mjpPlugin** plugin; const mjpPlugin** plugin;
int* id; int* id;
mjtSDFType type; mjtSDFType type;
mjtNum* relpos; mjtNum* relpos;
mjtNum* relmat; mjtNum* relmat;
mjtGeom* geomtype; mjtGeom* geomtype;
}; } mjSDF;
typedef struct mjSDF_ mjSDF;
typedef enum mjtGridPos_ { // grid position for overlay typedef enum mjtGridPos_ { // grid position for overlay
mjGRID_TOPLEFT = 0, // top left mjGRID_TOPLEFT = 0, // top left
mjGRID_TOPRIGHT, // top right mjGRID_TOPRIGHT, // top right
@@ -1389,20 +1370,18 @@ typedef enum mjrMeshPrimitiveType_ { // type of mesh primitive
mjMESH_PRIMITIVE_TYPE_TRIANGLES = 0, // triangles mjMESH_PRIMITIVE_TYPE_TRIANGLES = 0, // triangles
mjMESH_PRIMITIVE_TYPE_LINES, // lines mjMESH_PRIMITIVE_TYPE_LINES, // lines
} mjrMeshPrimitiveType; } mjrMeshPrimitiveType;
struct mjrRect_ { // OpenGL rectangle typedef struct mjrRect_ { // OpenGL rectangle
int left; // left (usually 0) int left; // left (usually 0)
int bottom; // bottom (usually 0) int bottom; // bottom (usually 0)
int width; // width (usually buffer width) int width; // width (usually buffer width)
int height; // height (usually buffer height) int height; // height (usually buffer height)
}; } mjrRect;
typedef struct mjrRect_ mjrRect; typedef struct mjrVertexAttribute_ { // vertex attribute format specification
struct mjrVertexAttribute_ { // vertex attribute format specification const void* bytes; // vertex data
const void* bytes; // vertex data int usage; // mjrVertexAttributeUsage; e.g. position, normal, etc.
int usage; // mjrVertexAttributeUsage; e.g. position, normal, etc. int type; // mjrVertexAttributeType; e.g. float3, ubyte4, etc.
int type; // mjrVertexAttributeType; e.g. float3, ubyte4, etc. } mjrVertexAttribute;
}; typedef struct mjrContext_ { // custom OpenGL context
typedef struct mjrVertexAttribute_ mjrVertexAttribute;
struct mjrContext_ { // custom OpenGL context
// parameters copied from mjVisual // parameters copied from mjVisual
float lineWidth; // line width for wireframe rendering float lineWidth; // line width for wireframe rendering
float shadowClip; // clipping radius for directional lights float shadowClip; // clipping radius for directional lights
@@ -1493,19 +1472,18 @@ struct mjrContext_ { // custom OpenGL context
// depth output format // depth output format
int readDepthMap; // depth mapping: mjDEPTH_ZERONEAR or mjDEPTH_ZEROFAR int readDepthMap; // depth mapping: mjDEPTH_ZERONEAR or mjDEPTH_ZEROFAR
}; } mjrContext;
typedef struct mjrContext_ mjrContext; typedef enum mjtGeomInertia { // type of inertia inference
typedef enum mjtGeomInertia_ { // type of inertia inference
mjINERTIA_VOLUME = 0, // mass distributed in the volume mjINERTIA_VOLUME = 0, // mass distributed in the volume
mjINERTIA_SHELL, // mass distributed on the surface mjINERTIA_SHELL, // mass distributed on the surface
} mjtGeomInertia; } mjtGeomInertia;
typedef enum mjtMeshInertia_ { // type of mesh inertia typedef enum mjtMeshInertia { // type of mesh inertia
mjMESH_INERTIA_CONVEX = 0, // convex mesh inertia mjMESH_INERTIA_CONVEX = 0, // convex mesh inertia
mjMESH_INERTIA_EXACT, // exact mesh inertia mjMESH_INERTIA_EXACT, // exact mesh inertia
mjMESH_INERTIA_LEGACY, // legacy mesh inertia mjMESH_INERTIA_LEGACY, // legacy mesh inertia
mjMESH_INERTIA_SHELL // shell mesh inertia mjMESH_INERTIA_SHELL // shell mesh inertia
} mjtMeshInertia; } mjtMeshInertia;
typedef enum mjtMeshBuiltin_ { // type of built-in procedural mesh typedef enum mjtMeshBuiltin { // type of built-in procedural mesh
mjMESH_BUILTIN_NONE = 0, // no built-in mesh mjMESH_BUILTIN_NONE = 0, // no built-in mesh
mjMESH_BUILTIN_SPHERE, // sphere mjMESH_BUILTIN_SPHERE, // sphere
mjMESH_BUILTIN_HEMISPHERE, // hemisphere mjMESH_BUILTIN_HEMISPHERE, // hemisphere
@@ -1515,46 +1493,46 @@ typedef enum mjtMeshBuiltin_ { // type of built-in procedural mesh
mjMESH_BUILTIN_WEDGE, // wedge mjMESH_BUILTIN_WEDGE, // wedge
mjMESH_BUILTIN_PLATE, // plate mjMESH_BUILTIN_PLATE, // plate
} mjtMeshBuiltin; } mjtMeshBuiltin;
typedef enum mjtBuiltin_ { // type of built-in procedural texture typedef enum mjtBuiltin { // type of built-in procedural texture
mjBUILTIN_NONE = 0, // no built-in texture mjBUILTIN_NONE = 0, // no built-in texture
mjBUILTIN_GRADIENT, // gradient: rgb1->rgb2 mjBUILTIN_GRADIENT, // gradient: rgb1->rgb2
mjBUILTIN_CHECKER, // checker pattern: rgb1, rgb2 mjBUILTIN_CHECKER, // checker pattern: rgb1, rgb2
mjBUILTIN_FLAT // 2d: rgb1; cube: rgb1-up, rgb2-side, rgb3-down mjBUILTIN_FLAT // 2d: rgb1; cube: rgb1-up, rgb2-side, rgb3-down
} mjtBuiltin; } mjtBuiltin;
typedef enum mjtMark_ { // mark type for procedural textures typedef enum mjtMark { // mark type for procedural textures
mjMARK_NONE = 0, // no mark mjMARK_NONE = 0, // no mark
mjMARK_EDGE, // edges mjMARK_EDGE, // edges
mjMARK_CROSS, // cross mjMARK_CROSS, // cross
mjMARK_RANDOM // random dots mjMARK_RANDOM // random dots
} mjtMark; } mjtMark;
typedef enum mjtLimited_ { // type of limit specification typedef enum mjtLimited { // type of limit specification
mjLIMITED_FALSE = 0, // not limited mjLIMITED_FALSE = 0, // not limited
mjLIMITED_TRUE, // limited mjLIMITED_TRUE, // limited
mjLIMITED_AUTO, // limited inferred from presence of range mjLIMITED_AUTO, // limited inferred from presence of range
} mjtLimited; } mjtLimited;
typedef enum mjtAlignFree_ { // whether to align free joints with the inertial frame typedef enum mjtAlignFree { // whether to align free joints with the inertial frame
mjALIGNFREE_FALSE = 0, // don't align mjALIGNFREE_FALSE = 0, // don't align
mjALIGNFREE_TRUE, // align mjALIGNFREE_TRUE, // align
mjALIGNFREE_AUTO, // respect the global compiler flag mjALIGNFREE_AUTO, // respect the global compiler flag
} mjtAlignFree; } mjtAlignFree;
typedef enum mjtInertiaFromGeom_ { // whether to infer body inertias from child geoms typedef enum mjtInertiaFromGeom { // whether to infer body inertias from child geoms
mjINERTIAFROMGEOM_FALSE = 0, // do not use; inertial element required mjINERTIAFROMGEOM_FALSE = 0, // do not use; inertial element required
mjINERTIAFROMGEOM_TRUE, // always use; overwrite inertial element mjINERTIAFROMGEOM_TRUE, // always use; overwrite inertial element
mjINERTIAFROMGEOM_AUTO // use only if inertial element is missing mjINERTIAFROMGEOM_AUTO // use only if inertial element is missing
} mjtInertiaFromGeom; } mjtInertiaFromGeom;
typedef enum mjtOrientation_ { // type of orientation specifier typedef enum mjtOrientation { // type of orientation specifier
mjORIENTATION_QUAT = 0, // quaternion mjORIENTATION_QUAT = 0, // quaternion
mjORIENTATION_AXISANGLE, // axis and angle mjORIENTATION_AXISANGLE, // axis and angle
mjORIENTATION_XYAXES, // x and y axes mjORIENTATION_XYAXES, // x and y axes
mjORIENTATION_ZAXIS, // z axis (minimal rotation) mjORIENTATION_ZAXIS, // z axis (minimal rotation)
mjORIENTATION_EULER, // Euler angles mjORIENTATION_EULER, // Euler angles
} mjtOrientation; } mjtOrientation;
typedef enum mjtConflict_ { // conflict resolution for attach typedef enum mjtConflict { // conflict resolution for attach
mjCONFLICT_WARNING = 0, // keep parent, warn on conflict mjCONFLICT_WARNING = 0, // keep parent, warn on conflict
mjCONFLICT_MERGE, // merge: min/max/error per field mjCONFLICT_MERGE, // merge: min/max/error per field
mjCONFLICT_ERROR, // error on any conflict mjCONFLICT_ERROR, // error on any conflict
} mjtConflict; } mjtConflict;
typedef enum mjtCTimer_ { // compiler timing categories typedef enum mjtCTimer { // compiler timing categories
// top-level timers (wall-clock) // top-level timers (wall-clock)
mjCTIMER_TOTAL = 0, // total compile time mjCTIMER_TOTAL = 0, // total compile time
mjCTIMER_ASSETS, // asset compilation mjCTIMER_ASSETS, // asset compilation
@@ -1590,7 +1568,7 @@ typedef struct mjsCompiler_ { // compiler options
int inertiagrouprange[2]; // range of geom groups used to compute inertia int inertiagrouprange[2]; // range of geom groups used to compute inertia
mjtByte saveinertial; // save explicit inertial clause for all bodies to XML mjtByte saveinertial; // save explicit inertial clause for all bodies to XML
int alignfree; // align free joints with inertial frame int alignfree; // align free joints with inertial frame
int conflict; // conflict resolution for attach (mjtConflict) int conflict; // conflict resolution for attach (mjtConflict)
mjLROpt LRopt; // options for lengthrange computation mjLROpt LRopt; // options for lengthrange computation
mjString* meshdir; // mesh and hfield directory mjString* meshdir; // mesh and hfield directory
mjString* texturedir; // texture directory mjString* texturedir; // texture directory
@@ -2193,7 +2171,7 @@ typedef struct mjsDefault_ { // default specification
mjsTendon* tendon; // tendon defaults mjsTendon* tendon; // tendon defaults
mjsActuator* actuator; // actuator defaults mjsActuator* actuator; // actuator defaults
} mjsDefault; } mjsDefault;
typedef enum mjtDisableBit_ { // disable default feature bitflags typedef enum mjtDisableBit { // disable default feature bitflags
mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver
mjDSBL_EQUALITY = 1<<1, // equality constraints mjDSBL_EQUALITY = 1<<1, // equality constraints
mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints
@@ -2217,7 +2195,7 @@ typedef enum mjtDisableBit_ { // disable default feature bitflags
mjNDISABLE = 20 // number of disable flags mjNDISABLE = 20 // number of disable flags
} mjtDisableBit; } mjtDisableBit;
typedef enum mjtEnableBit_ { // enable optional feature bitflags typedef enum mjtEnableBit { // enable optional feature bitflags
mjENBL_OVERRIDE = 1<<0, // override contact parameters mjENBL_OVERRIDE = 1<<0, // override contact parameters
mjENBL_ENERGY = 1<<1, // energy computation mjENBL_ENERGY = 1<<1, // energy computation
mjENBL_FWDINV = 1<<2, // record solver statistics mjENBL_FWDINV = 1<<2, // record solver statistics
@@ -2227,13 +2205,13 @@ typedef enum mjtEnableBit_ { // enable optional feature bitflags
mjNENABLE = 6 // number of enable flags mjNENABLE = 6 // number of enable flags
} mjtEnableBit; } mjtEnableBit;
typedef enum mjtJoint_ { // type of degree of freedom typedef enum mjtJoint { // type of degree of freedom
mjJNT_FREE = 0, // global position and orientation (quat) (7) mjJNT_FREE = 0, // global position and orientation (quat) (7)
mjJNT_BALL, // orientation (quat) relative to parent (4) mjJNT_BALL, // orientation (quat) relative to parent (4)
mjJNT_SLIDE, // sliding distance along body-fixed axis (1) mjJNT_SLIDE, // sliding distance along body-fixed axis (1)
mjJNT_HINGE // rotation angle (rad) around body-fixed axis (1) mjJNT_HINGE // rotation angle (rad) around body-fixed axis (1)
} mjtJoint; } mjtJoint;
typedef enum mjtGeom_ { // type of geometric shape typedef enum mjtGeom { // type of geometric shape
// regular geom types // regular geom types
mjGEOM_PLANE = 0, // plane mjGEOM_PLANE = 0, // plane
mjGEOM_HFIELD, // height field mjGEOM_HFIELD, // height field
@@ -2260,29 +2238,29 @@ typedef enum mjtGeom_ { // type of geometric shape
mjGEOM_NONE = 1001 // missing geom type mjGEOM_NONE = 1001 // missing geom type
} mjtGeom; } mjtGeom;
typedef enum mjtProjection_ { // type of camera projection typedef enum mjtProjection { // type of camera projection
mjPROJ_PERSPECTIVE = 0, // perspective mjPROJ_PERSPECTIVE = 0, // perspective
mjPROJ_ORTHOGRAPHIC // orthographic mjPROJ_ORTHOGRAPHIC // orthographic
} mjtProjection; } mjtProjection;
typedef enum mjtCamLight_ { // tracking mode for camera and light typedef enum mjtCamLight { // tracking mode for camera and light
mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body
mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global
mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body
mjCAMLIGHT_TARGETBODY, // pos fixed in body, rot tracks target body mjCAMLIGHT_TARGETBODY, // pos fixed in body, rot tracks target body
mjCAMLIGHT_TARGETBODYCOM // pos fixed in body, rot tracks target subtree com mjCAMLIGHT_TARGETBODYCOM // pos fixed in body, rot tracks target subtree com
} mjtCamLight; } mjtCamLight;
typedef enum mjtLightType_ { // type of light typedef enum mjtLightType { // type of light
mjLIGHT_SPOT = 0, // spot mjLIGHT_SPOT = 0, // spot
mjLIGHT_DIRECTIONAL, // directional mjLIGHT_DIRECTIONAL, // directional
mjLIGHT_POINT, // point mjLIGHT_POINT, // point
mjLIGHT_IMAGE, // image-based mjLIGHT_IMAGE, // image-based
} mjtLightType; } mjtLightType;
typedef enum mjtTexture_ { // type of texture typedef enum mjtTexture { // type of texture
mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields
mjTEXTURE_CUBE, // cube texture, suitable for all other geom types mjTEXTURE_CUBE, // cube texture, suitable for all other geom types
mjTEXTURE_SKYBOX // cube texture used as skybox mjTEXTURE_SKYBOX // cube texture used as skybox
} mjtTexture; } mjtTexture;
typedef enum mjtTextureRole_ { // role of texture map in rendering typedef enum mjtTextureRole { // role of texture map in rendering
mjTEXROLE_USER = 0, // unspecified mjTEXROLE_USER = 0, // unspecified
mjTEXROLE_RGB, // base color (albedo) mjTEXROLE_RGB, // base color (albedo)
mjTEXROLE_OCCLUSION, // ambient occlusion mjTEXROLE_OCCLUSION, // ambient occlusion
@@ -2295,32 +2273,32 @@ typedef enum mjtTextureRole_ { // role of texture map in rendering
mjTEXROLE_ORM, // occlusion, roughness, metallic mjTEXROLE_ORM, // occlusion, roughness, metallic
mjNTEXROLE mjNTEXROLE
} mjtTextureRole; } mjtTextureRole;
typedef enum mjtColorSpace_ { // type of color space encoding typedef enum mjtColorSpace { // type of color space encoding
mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear
mjCOLORSPACE_LINEAR, // linear color space mjCOLORSPACE_LINEAR, // linear color space
mjCOLORSPACE_SRGB // standard RGB color space mjCOLORSPACE_SRGB // standard RGB color space
} mjtColorSpace; } mjtColorSpace;
typedef enum mjtIntegrator_ { // integrator mode typedef enum mjtIntegrator { // integrator mode
mjINT_EULER = 0, // semi-implicit Euler mjINT_EULER = 0, // semi-implicit Euler
mjINT_RK4, // 4th-order Runge Kutta mjINT_RK4, // 4th-order Runge Kutta
mjINT_IMPLICIT, // implicit in velocity mjINT_IMPLICIT, // implicit in velocity
mjINT_IMPLICITFAST // implicit in velocity, no rne derivative mjINT_IMPLICITFAST // implicit in velocity, no rne derivative
} mjtIntegrator; } mjtIntegrator;
typedef enum mjtCone_ { // type of friction cone typedef enum mjtCone { // type of friction cone
mjCONE_PYRAMIDAL = 0, // pyramidal mjCONE_PYRAMIDAL = 0, // pyramidal
mjCONE_ELLIPTIC // elliptic mjCONE_ELLIPTIC // elliptic
} mjtCone; } mjtCone;
typedef enum mjtJacobian_ { // type of constraint Jacobian typedef enum mjtJacobian { // type of constraint Jacobian
mjJAC_DENSE = 0, // dense mjJAC_DENSE = 0, // dense
mjJAC_SPARSE, // sparse mjJAC_SPARSE, // sparse
mjJAC_AUTO // dense if nv<60, sparse otherwise mjJAC_AUTO // dense if nv<60, sparse otherwise
} mjtJacobian; } mjtJacobian;
typedef enum mjtSolver_ { // constraint solver algorithm typedef enum mjtSolver { // constraint solver algorithm
mjSOL_PGS = 0, // PGS (dual) mjSOL_PGS = 0, // PGS (dual)
mjSOL_CG, // CG (primal) mjSOL_CG, // CG (primal)
mjSOL_NEWTON // Newton (primal) mjSOL_NEWTON // Newton (primal)
} mjtSolver; } mjtSolver;
typedef enum mjtEq_ { // type of equality constraint typedef enum mjtEq { // type of equality constraint
mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint) mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint)
mjEQ_WELD, // fix relative position and orientation of two bodies mjEQ_WELD, // fix relative position and orientation of two bodies
mjEQ_JOINT, // couple the values of two scalar joints with cubic mjEQ_JOINT, // couple the values of two scalar joints with cubic
@@ -2330,7 +2308,7 @@ typedef enum mjtEq_ { // type of equality constraint
mjEQ_FLEXSTRAIN, // constrain strain of a trilinear/quadratic flex (B-bar) mjEQ_FLEXSTRAIN, // constrain strain of a trilinear/quadratic flex (B-bar)
mjEQ_DISTANCE // unsupported, will cause an error if used mjEQ_DISTANCE // unsupported, will cause an error if used
} mjtEq; } mjtEq;
typedef enum mjtWrap_ { // type of tendon wrap object typedef enum mjtWrap { // type of tendon wrap object
mjWRAP_NONE = 0, // null object mjWRAP_NONE = 0, // null object
mjWRAP_JOINT, // constant moment arm mjWRAP_JOINT, // constant moment arm
mjWRAP_PULLEY, // pulley used to split tendon mjWRAP_PULLEY, // pulley used to split tendon
@@ -2338,7 +2316,7 @@ typedef enum mjtWrap_ { // type of tendon wrap object
mjWRAP_SPHERE, // wrap around sphere mjWRAP_SPHERE, // wrap around sphere
mjWRAP_CYLINDER // wrap around (infinite) cylinder mjWRAP_CYLINDER // wrap around (infinite) cylinder
} mjtWrap; } mjtWrap;
typedef enum mjtTrn_ { // type of actuator transmission typedef enum mjtTrn { // type of actuator transmission
mjTRN_JOINT = 0, // force on joint mjTRN_JOINT = 0, // force on joint
mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame
mjTRN_SLIDERCRANK, // force via slider-crank linkage mjTRN_SLIDERCRANK, // force via slider-crank linkage
@@ -2348,7 +2326,7 @@ typedef enum mjtTrn_ { // type of actuator transmission
mjTRN_UNDEFINED = 1000 // undefined transmission type mjTRN_UNDEFINED = 1000 // undefined transmission type
} mjtTrn; } mjtTrn;
typedef enum mjtDyn_ { // type of actuator dynamics typedef enum mjtDyn { // type of actuator dynamics
mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force
mjDYN_INTEGRATOR, // integrator: da/dt = u mjDYN_INTEGRATOR, // integrator: da/dt = u
mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau
@@ -2357,21 +2335,21 @@ typedef enum mjtDyn_ { // type of actuator dynamics
mjDYN_DCMOTOR, // DC motor electrical dynamics mjDYN_DCMOTOR, // DC motor electrical dynamics
mjDYN_USER // user-defined dynamics type mjDYN_USER // user-defined dynamics type
} mjtDyn; } mjtDyn;
typedef enum mjtGain_ { // type of actuator gain typedef enum mjtGain { // type of actuator gain
mjGAIN_FIXED = 0, // fixed gain mjGAIN_FIXED = 0, // fixed gain
mjGAIN_AFFINE, // const + kp*length + kv*velocity mjGAIN_AFFINE, // const + kp*length + kv*velocity
mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain() mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain()
mjGAIN_DCMOTOR, // DC motor gain: K or K/R mjGAIN_DCMOTOR, // DC motor gain: K or K/R
mjGAIN_USER // user-defined gain type mjGAIN_USER // user-defined gain type
} mjtGain; } mjtGain;
typedef enum mjtBias_ { // type of actuator bias typedef enum mjtBias { // type of actuator bias
mjBIAS_NONE = 0, // no bias mjBIAS_NONE = 0, // no bias
mjBIAS_AFFINE, // const + kp*length + kv*velocity mjBIAS_AFFINE, // const + kp*length + kv*velocity
mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias() mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias()
mjBIAS_DCMOTOR, // DC motor bias: back-EMF, cogging, LuGre friction mjBIAS_DCMOTOR, // DC motor bias: back-EMF, cogging, LuGre friction
mjBIAS_USER // user-defined bias type mjBIAS_USER // user-defined bias type
} mjtBias; } mjtBias;
typedef enum mjtObj_ { // type of MujoCo object typedef enum mjtObj { // type of MujoCo object
mjOBJ_UNKNOWN = 0, // unknown object type mjOBJ_UNKNOWN = 0, // unknown object type
mjOBJ_BODY, // body mjOBJ_BODY, // body
mjOBJ_XBODY, // body, used to access regular frame instead of i-frame mjOBJ_XBODY, // body, used to access regular frame instead of i-frame
@@ -2406,7 +2384,7 @@ typedef enum mjtObj_ { // type of MujoCo object
mjOBJ_DEFAULT, // default mjOBJ_DEFAULT, // default
mjOBJ_MODEL // entire model mjOBJ_MODEL // entire model
} mjtObj; } mjtObj;
typedef enum mjtSensor_ { // type of sensor typedef enum mjtSensor { // type of sensor
// common robotic sensors, attached to a site // common robotic sensors, attached to a site
mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone
mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame
@@ -2480,19 +2458,19 @@ typedef enum mjtSensor_ { // type of sensor
// user-defined sensor // user-defined sensor
mjSENS_USER // sensor data provided by mjcb_sensor callback mjSENS_USER // sensor data provided by mjcb_sensor callback
} mjtSensor; } mjtSensor;
typedef enum mjtStage_ { // computation stage typedef enum mjtStage { // computation stage
mjSTAGE_NONE = 0, // no computations mjSTAGE_NONE = 0, // no computations
mjSTAGE_POS, // position-dependent computations mjSTAGE_POS, // position-dependent computations
mjSTAGE_VEL, // velocity-dependent computations mjSTAGE_VEL, // velocity-dependent computations
mjSTAGE_ACC // acceleration/force-dependent computations mjSTAGE_ACC // acceleration/force-dependent computations
} mjtStage; } mjtStage;
typedef enum mjtDataType_ { // data type for sensors typedef enum mjtDataType { // data type for sensors
mjDATATYPE_REAL = 0, // real values, no constraints mjDATATYPE_REAL = 0, // real values, no constraints
mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive
mjDATATYPE_AXIS, // 3D unit vector mjDATATYPE_AXIS, // 3D unit vector
mjDATATYPE_QUATERNION // unit quaternion mjDATATYPE_QUATERNION // unit quaternion
} mjtDataType; } mjtDataType;
typedef enum mjtConDataField_ { // data fields returned by contact sensors typedef enum mjtConDataField { // data fields returned by contact sensors
mjCONDATA_FOUND = 0, // whether a contact was found mjCONDATA_FOUND = 0, // whether a contact was found
mjCONDATA_FORCE, // contact force mjCONDATA_FORCE, // contact force
mjCONDATA_TORQUE, // contact torque mjCONDATA_TORQUE, // contact torque
@@ -2503,7 +2481,7 @@ typedef enum mjtConDataField_ { // data fields returned by contact sensors
mjNCONDATA // number of contact sensor data fields mjNCONDATA // number of contact sensor data fields
} mjtConDataField; } mjtConDataField;
typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors typedef enum mjtRayDataField { // data fields returned by rangefinder sensors
mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface
mjRAYDATA_DIR, // normalized ray direction mjRAYDATA_DIR, // normalized ray direction
mjRAYDATA_ORIGIN, // ray origin mjRAYDATA_ORIGIN, // ray origin
@@ -2513,7 +2491,7 @@ typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors
mjNRAYDATA // number of rangefinder sensor data fields mjNRAYDATA // number of rangefinder sensor data fields
} mjtRayDataField; } mjtRayDataField;
typedef enum mjtCamOutBit_ { // camera output type bitflags typedef enum mjtCamOutBit { // camera output type bitflags
mjCAMOUT_RGB = 1<<0, // RGB image mjCAMOUT_RGB = 1<<0, // RGB image
mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane) mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane)
mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin) mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin)
@@ -2522,14 +2500,14 @@ typedef enum mjtCamOutBit_ { // camera output type bitflags
mjNCAMOUT = 5 // number of camera output types mjNCAMOUT = 5 // number of camera output types
} mjtCamOutBit; } mjtCamOutBit;
typedef enum mjtSameFrame_ { // frame alignment of bodies with their children typedef enum mjtSameFrame { // frame alignment of bodies with their children
mjSAMEFRAME_NONE = 0, // no alignment mjSAMEFRAME_NONE = 0, // no alignment
mjSAMEFRAME_BODY, // frame is same as body frame mjSAMEFRAME_BODY, // frame is same as body frame
mjSAMEFRAME_INERTIA, // frame is same as inertial frame mjSAMEFRAME_INERTIA, // frame is same as inertial frame
mjSAMEFRAME_BODYROT, // frame orientation is same as body orientation mjSAMEFRAME_BODYROT, // frame orientation is same as body orientation
mjSAMEFRAME_INERTIAROT // frame orientation is same as inertia orientation mjSAMEFRAME_INERTIAROT // frame orientation is same as inertia orientation
} mjtSameFrame; } mjtSameFrame;
typedef enum mjtSleepPolicy_ { // per-tree sleep policy typedef enum mjtSleepPolicy { // per-tree sleep policy
mjSLEEP_AUTO = 0, // compiler chooses sleep policy mjSLEEP_AUTO = 0, // compiler chooses sleep policy
mjSLEEP_AUTO_NEVER, // compiler sleep policy: never mjSLEEP_AUTO_NEVER, // compiler sleep policy: never
mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed
@@ -2537,26 +2515,26 @@ typedef enum mjtSleepPolicy_ { // per-tree sleep policy
mjSLEEP_ALLOWED, // user sleep policy: allowed mjSLEEP_ALLOWED, // user sleep policy: allowed
mjSLEEP_INIT, // user sleep policy: initialized asleep mjSLEEP_INIT, // user sleep policy: initialized asleep
} mjtSleepPolicy; } mjtSleepPolicy;
typedef enum mjtLRMode_ { // mode for actuator length range computation typedef enum mjtLRMode { // mode for actuator length range computation
mjLRMODE_NONE = 0, // do not process any actuators mjLRMODE_NONE = 0, // do not process any actuators
mjLRMODE_MUSCLE, // process muscle actuators mjLRMODE_MUSCLE, // process muscle actuators
mjLRMODE_MUSCLEUSER, // process muscle and user actuators mjLRMODE_MUSCLEUSER, // process muscle and user actuators
mjLRMODE_ALL // process all actuators mjLRMODE_ALL // process all actuators
} mjtLRMode; } mjtLRMode;
typedef enum mjtFlexSelf_ { // mode for flex selfcollide typedef enum mjtFlexSelf { // mode for flex selfcollide
mjFLEXSELF_NONE = 0, // no self-collisions mjFLEXSELF_NONE = 0, // no self-collisions
mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase
mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled) mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled)
mjFLEXSELF_SAP, // use SAP in midphase mjFLEXSELF_SAP, // use SAP in midphase
mjFLEXSELF_AUTO // choose between BVH and SAP automatically mjFLEXSELF_AUTO // choose between BVH and SAP automatically
} mjtFlexSelf; } mjtFlexSelf;
typedef enum mjtSDFType_ { // signed distance function (SDF) type typedef enum mjtSDFType { // signed distance function (SDF) type
mjSDFTYPE_SINGLE = 0, // single SDF mjSDFTYPE_SINGLE = 0, // single SDF
mjSDFTYPE_INTERSECTION, // max(A, B) mjSDFTYPE_INTERSECTION, // max(A, B)
mjSDFTYPE_MIDSURFACE, // A - B mjSDFTYPE_MIDSURFACE, // A - B
mjSDFTYPE_COLLISION, // A + B + abs(max(A, B)) mjSDFTYPE_COLLISION, // A + B + abs(max(A, B))
} mjtSDFType; } mjtSDFType;
typedef enum mjtState_ { // state elements typedef enum mjtState { // state elements
mjSTATE_TIME = 1<<0, // time mjSTATE_TIME = 1<<0, // time
mjSTATE_QPOS = 1<<1, // position mjSTATE_QPOS = 1<<1, // position
mjSTATE_QVEL = 1<<2, // velocity mjSTATE_QVEL = 1<<2, // velocity
@@ -2582,7 +2560,7 @@ typedef enum mjtState_ { // state elements
mjSTATE_USERDATA, mjSTATE_USERDATA,
mjSTATE_INTEGRATION = mjSTATE_FULLPHYSICS | mjSTATE_USER | mjSTATE_WARMSTART mjSTATE_INTEGRATION = mjSTATE_FULLPHYSICS | mjSTATE_USER | mjSTATE_WARMSTART
} mjtState; } mjtState;
typedef enum mjtConstraint_ { // type of constraint typedef enum mjtConstraint { // type of constraint
mjCNSTR_EQUALITY = 0, // equality constraint mjCNSTR_EQUALITY = 0, // equality constraint
mjCNSTR_FRICTION_DOF, // dof friction mjCNSTR_FRICTION_DOF, // dof friction
mjCNSTR_FRICTION_TENDON, // tendon friction mjCNSTR_FRICTION_TENDON, // tendon friction
@@ -2592,14 +2570,14 @@ typedef enum mjtConstraint_ { // type of constraint
mjCNSTR_CONTACT_PYRAMIDAL, // frictional contact, pyramidal friction cone mjCNSTR_CONTACT_PYRAMIDAL, // frictional contact, pyramidal friction cone
mjCNSTR_CONTACT_ELLIPTIC // frictional contact, elliptic friction cone mjCNSTR_CONTACT_ELLIPTIC // frictional contact, elliptic friction cone
} mjtConstraint; } mjtConstraint;
typedef enum mjtConstraintState_ { // constraint state typedef enum mjtConstraintState { // constraint state
mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact) mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact)
mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact) mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact)
mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction) mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction)
mjCNSTRSTATE_LINEARPOS, // linear cost, positive side (friction) mjCNSTRSTATE_LINEARPOS, // linear cost, positive side (friction)
mjCNSTRSTATE_CONE // squared distance to cone cost (elliptic contact) mjCNSTRSTATE_CONE // squared distance to cone cost (elliptic contact)
} mjtConstraintState; } mjtConstraintState;
typedef enum mjtWarning_ { // warning types typedef enum mjtWarning { // warning types
mjWARN_INERTIA = 0, // (near) singular inertia matrix mjWARN_INERTIA = 0, // (near) singular inertia matrix
mjWARN_CONTACTFULL, // too many contacts in contact list mjWARN_CONTACTFULL, // too many contacts in contact list
mjWARN_CNSTRFULL, // too many constraints mjWARN_CNSTRFULL, // too many constraints
@@ -2610,7 +2588,7 @@ typedef enum mjtWarning_ { // warning types
mjNWARNING // number of warnings mjNWARNING // number of warnings
} mjtWarning; } mjtWarning;
typedef enum mjtTimer_ { // internal timers typedef enum mjtTimer { // internal timers
// main api // main api
mjTIMER_STEP = 0, // step mjTIMER_STEP = 0, // step
mjTIMER_FORWARD, // forward mjTIMER_FORWARD, // forward
@@ -2636,18 +2614,18 @@ typedef enum mjtTimer_ { // internal timers
mjNTIMER // number of timers mjNTIMER // number of timers
} mjtTimer; } mjtTimer;
typedef enum mjtSleepState_ { // sleep state of an object typedef enum mjtSleepState { // sleep state of an object
mjS_STATIC = -1, // object is static mjS_STATIC = -1, // object is static
mjS_ASLEEP = 0, // object is asleep mjS_ASLEEP = 0, // object is asleep
mjS_AWAKE = 1 // object is awake mjS_AWAKE = 1 // object is awake
} mjtSleepState; } mjtSleepState;
typedef enum mjtLogLevel_ { // log message severity typedef enum mjtLogLevel { // log message severity
mjLOG_DEBUG = 0, // internal engine debug trace (opt-in via topic filtering) mjLOG_DEBUG = 0, // internal engine debug trace (opt-in via topic filtering)
mjLOG_INFO, // informational (opt-in via topic filtering) mjLOG_INFO, // informational (opt-in via topic filtering)
mjLOG_WARNING, // warning mjLOG_WARNING, // warning
mjLOG_ERROR, // error mjLOG_ERROR, // error
} mjtLogLevel; } mjtLogLevel;
typedef enum mjtLogTopic_ { // log topic identifiers typedef enum mjtLogTopic { // log topic identifiers
mjTOPIC_NONE = 0, // no topic (always passes filtering) mjTOPIC_NONE = 0, // no topic (always passes filtering)
// INFO topics: // INFO topics:
mjTOPIC_TIME_STP = 1, // timing diagnostics (step) mjTOPIC_TIME_STP = 1, // timing diagnostics (step)
@@ -2673,13 +2651,13 @@ typedef struct mjLogConfig_ { // log handler default configuration
char logfile[1024]; // log file path (default: "MUJOCO_LOG.TXT") char logfile[1024]; // log file path (default: "MUJOCO_LOG.TXT")
int topics; // enabled info topic bitmask (default: 0) int topics; // enabled info topic bitmask (default: 0)
} mjLogConfig; } mjLogConfig;
typedef enum mjtButton_ { // mouse button typedef enum mjtButton { // mouse button
mjBUTTON_NONE = 0, // no button mjBUTTON_NONE = 0, // no button
mjBUTTON_LEFT, // left button mjBUTTON_LEFT, // left button
mjBUTTON_RIGHT, // right button mjBUTTON_RIGHT, // right button
mjBUTTON_MIDDLE // middle button mjBUTTON_MIDDLE // middle button
} mjtButton; } mjtButton;
typedef enum mjtEvent_ { // mouse and keyboard event type typedef enum mjtEvent { // mouse and keyboard event type
mjEVENT_NONE = 0, // no event mjEVENT_NONE = 0, // no event
mjEVENT_MOVE, // mouse move mjEVENT_MOVE, // mouse move
mjEVENT_PRESS, // mouse button press mjEVENT_PRESS, // mouse button press
@@ -2690,7 +2668,7 @@ typedef enum mjtEvent_ { // mouse and keyboard event type
mjEVENT_REDRAW, // redraw mjEVENT_REDRAW, // redraw
mjEVENT_FILESDROP // files drop mjEVENT_FILESDROP // files drop
} mjtEvent; } mjtEvent;
typedef enum mjtItem_ { // UI item type typedef enum mjtItem { // UI item type
mjITEM_END = -2, // end of definition list (not an item) mjITEM_END = -2, // end of definition list (not an item)
mjITEM_SECTION = -1, // section (not an item) mjITEM_SECTION = -1, // section (not an item)
mjITEM_SEPARATOR = 0, // separator mjITEM_SEPARATOR = 0, // separator
@@ -2712,12 +2690,12 @@ typedef enum mjtItem_ { // UI item type
mjNITEM // number of item types mjNITEM // number of item types
} mjtItem; } mjtItem;
typedef enum mjtSection_ { // UI section state typedef enum mjtSection { // UI section state
mjSECT_CLOSED = 0, // closed state (regular section) mjSECT_CLOSED = 0, // closed state (regular section)
mjSECT_OPEN, // open state (regular section) mjSECT_OPEN, // open state (regular section)
mjSECT_FIXED // fixed section: always open, no title mjSECT_FIXED // fixed section: always open, no title
} mjtSection; } mjtSection;
struct mjuiState_ { // mouse and keyboard state typedef struct mjuiState_ { // mouse and keyboard state
// constants set by user // constants set by user
int nrect; // number of rectangles used int nrect; // number of rectangles used
mjrRect rect[mjMAXUIRECT]; // rectangles (index 0: entire window) mjrRect rect[mjMAXUIRECT]; // rectangles (index 0: entire window)
@@ -2757,25 +2735,23 @@ struct mjuiState_ { // mouse and keyboard state
// files dropping (only valid when type == mjEVENT_FILESDROP) // files dropping (only valid when type == mjEVENT_FILESDROP)
int dropcount; // number of files dropped int dropcount; // number of files dropped
const char** droppaths; // paths to files dropped const char** droppaths; // paths to files dropped
}; } mjuiState;
typedef struct mjuiState_ mjuiState; typedef struct mjuiThemeSpacing_ { // UI visualization theme spacing
struct mjuiThemeSpacing_ { // UI visualization theme spacing int total; // total width
int total; // total width int scroll; // scrollbar width
int scroll; // scrollbar width int label; // label width
int label; // label width int section; // section gap
int section; // section gap int cornersect; // corner radius for section
int cornersect; // corner radius for section int cornersep; // corner radius for separator
int cornersep; // corner radius for separator int itemside; // item side gap
int itemside; // item side gap int itemmid; // item middle gap
int itemmid; // item middle gap int itemver; // item vertical gap
int itemver; // item vertical gap int texthor; // text horizontal gap
int texthor; // text horizontal gap int textver; // text vertical gap
int textver; // text vertical gap int linescroll; // number of pixels to scroll
int linescroll; // number of pixels to scroll int samples; // number of multisamples
int samples; // number of multisamples } mjuiThemeSpacing;
}; typedef struct mjuiThemeColor_ { // UI visualization theme color
typedef struct mjuiThemeSpacing_ mjuiThemeSpacing;
struct mjuiThemeColor_ { // UI visualization theme color
float master[3]; // master background float master[3]; // master background
float thumb[3]; // scrollbar thumb float thumb[3]; // scrollbar thumb
float secttitle[3]; // section title float secttitle[3]; // section title
@@ -2804,8 +2780,7 @@ struct mjuiThemeColor_ { // UI visualization theme color
float edit[3]; // edit float edit[3]; // edit
float edit2[3]; // edit invalid float edit2[3]; // edit invalid
float cursor[3]; // edit cursor float cursor[3]; // edit cursor
}; } mjuiThemeColor;
typedef struct mjuiThemeColor_ mjuiThemeColor;
struct mjuiItemSingle_ { // check and button-related struct mjuiItemSingle_ { // check and button-related
int modifier; // 0: none, 1: control, 2: shift; 4: alt int modifier; // 0: none, 1: control, 2: shift; 4: alt
int shortcut; // shortcut key; 0: undefined int shortcut; // shortcut key; 0: undefined
@@ -2830,7 +2805,7 @@ struct mjuiItemEdit_ { // edit-related
}; };
struct mjuiItem_ { // UI item typedef struct mjuiItem_ { // UI item
// common properties // common properties
int type; // type (mjtItem) int type; // type (mjtItem)
char name[mjMAXUINAME]; // name char name[mjMAXUINAME]; // name
@@ -2851,9 +2826,8 @@ struct mjuiItem_ { // UI item
// internal // internal
mjrRect rect; // rectangle occupied by item mjrRect rect; // rectangle occupied by item
int skip; // item skipped due to closed separator int skip; // item skipped due to closed separator
}; } mjuiItem;
typedef struct mjuiItem_ mjuiItem; typedef struct mjuiSection_ { // UI section
struct mjuiSection_ { // UI section
// properties // properties
char name[mjMAXUINAME]; // name char name[mjMAXUINAME]; // name
int state; // section state (mjtSection) int state; // section state (mjtSection)
@@ -2867,9 +2841,8 @@ struct mjuiSection_ { // UI section
mjrRect rtitle; // rectangle occupied by title mjrRect rtitle; // rectangle occupied by title
mjrRect rcontent; // rectangle occupied by content mjrRect rcontent; // rectangle occupied by content
int lastclick; // last mouse click over this section int lastclick; // last mouse click over this section
}; } mjuiSection;
typedef struct mjuiSection_ mjuiSection; typedef struct mjUI_ { // entire UI
struct mjUI_ { // entire UI
// constants set by user // constants set by user
mjuiThemeSpacing spacing; // UI theme spacing mjuiThemeSpacing spacing; // UI theme spacing
mjuiThemeColor color; // UI theme color mjuiThemeColor color; // UI theme color
@@ -2903,17 +2876,15 @@ struct mjUI_ { // entire UI
// sections // sections
int nsect; // number of sections in use int nsect; // number of sections in use
mjuiSection sect[mjMAXUISECT]; // preallocated array of sections mjuiSection sect[mjMAXUISECT]; // preallocated array of sections
}; } mjUI;
typedef struct mjUI_ mjUI; typedef struct mjuiDef_ { // table passed to mjui_add()
struct mjuiDef_ { // table passed to mjui_add()
int type; // type (mjtItem); -1: section int type; // type (mjtItem); -1: section
char name[mjMAXUINAME]; // name char name[mjMAXUINAME]; // name
int state; // state int state; // state
void* pdata; // pointer to data void* pdata; // pointer to data
char other[mjMAXUITEXT]; // string with type-specific properties char other[mjMAXUITEXT]; // string with type-specific properties
int otherint; // int with type-specific properties int otherint; // int with type-specific properties
}; } mjuiDef;
typedef struct mjuiDef_ mjuiDef;
typedef enum mjtCatBit_ { // bitflags for mjvGeom category typedef enum mjtCatBit_ { // bitflags for mjvGeom category
mjCAT_STATIC = 1, // model elements in body 0 mjCAT_STATIC = 1, // model elements in body 0
mjCAT_DYNAMIC = 2, // model elements in all other bodies mjCAT_DYNAMIC = 2, // model elements in all other bodies
@@ -3028,7 +2999,7 @@ typedef enum mjtStereo_ { // type of stereo rendering
mjSTEREO_QUADBUFFERED, // quad buffered; revert to side-by-side if no hardware support mjSTEREO_QUADBUFFERED, // quad buffered; revert to side-by-side if no hardware support
mjSTEREO_SIDEBYSIDE // side-by-side mjSTEREO_SIDEBYSIDE // side-by-side
} mjtStereo; } mjtStereo;
struct mjvPerturb_ { // object selection and perturbation typedef struct mjvPerturb_ { // object selection and perturbation
int select; // selected body id; non-positive: none int select; // selected body id; non-positive: none
int flexselect; // selected flex id; negative: none int flexselect; // selected flex id; negative: none
int skinselect; // selected skin id; negative: none int skinselect; // selected skin id; negative: none
@@ -3040,9 +3011,8 @@ struct mjvPerturb_ { // object selection and perturbation
mjtNum localpos[3]; // selection point in object coordinates mjtNum localpos[3]; // selection point in object coordinates
mjtNum localmass; // spatial inertia at selection point mjtNum localmass; // spatial inertia at selection point
mjtNum scale; // relative mouse motion-to-space scaling (set by initPerturb) mjtNum scale; // relative mouse motion-to-space scaling (set by initPerturb)
}; } mjvPerturb;
typedef struct mjvPerturb_ mjvPerturb; typedef struct mjvCamera_ { // abstract camera
struct mjvCamera_ { // abstract camera
// type and ids // type and ids
int type; // camera type (mjtCamera) int type; // camera type (mjtCamera)
int fixedcamid; // fixed camera id int fixedcamid; // fixed camera id
@@ -3056,9 +3026,8 @@ struct mjvCamera_ { // abstract camera
// orthographic / perspective // orthographic / perspective
int orthographic; // 0: perspective; 1: orthographic int orthographic; // 0: perspective; 1: orthographic
}; } mjvCamera;
typedef struct mjvCamera_ mjvCamera; typedef struct mjvGLCamera_ { // OpenGL camera
struct mjvGLCamera_ { // OpenGL camera
// camera frame // camera frame
float pos[3]; // position float pos[3]; // position
float forward[3]; // forward direction float forward[3]; // forward direction
@@ -3074,9 +3043,8 @@ struct mjvGLCamera_ { // OpenGL camera
// orthographic / perspective // orthographic / perspective
int orthographic; // 0: perspective; 1: orthographic int orthographic; // 0: perspective; 1: orthographic
}; } mjvGLCamera;
typedef struct mjvGLCamera_ mjvGLCamera; typedef struct mjvGeom_ { // abstract geom
struct mjvGeom_ { // abstract geom
// type info // type info
int type; // geom type (mjtGeom) int type; // geom type (mjtGeom)
int dataid; // mesh, hfield or plane id; -1: none; mesh: 2*id or 2*id+1 (hull) int dataid; // mesh, hfield or plane id; -1: none; mesh: 2*id or 2*id+1 (hull)
@@ -3105,9 +3073,8 @@ struct mjvGeom_ { // abstract geom
float camdist; // distance to camera (used by sorter) float camdist; // distance to camera (used by sorter)
float modelrbound; // geom rbound from model, 0 if not model geom float modelrbound; // geom rbound from model, 0 if not model geom
mjtByte transparent; // treat geom as transparent mjtByte transparent; // treat geom as transparent
}; } mjvGeom;
typedef struct mjvGeom_ mjvGeom; typedef struct mjvLight_ { // OpenGL light
struct mjvLight_ { // OpenGL light
int id; // light id, -1 for headlight int id; // light id, -1 for headlight
float pos[3]; // position rel. to body frame float pos[3]; // position rel. to body frame
float dir[3]; // direction rel. to body frame float dir[3]; // direction rel. to body frame
@@ -3124,9 +3091,8 @@ struct mjvLight_ { // OpenGL light
float bulbradius; // bulb radius for soft shadows float bulbradius; // bulb radius for soft shadows
float intensity; // intensity, in candelas float intensity; // intensity, in candelas
float range; // range of effectiveness float range; // range of effectiveness
}; } mjvLight;
typedef struct mjvLight_ mjvLight; typedef struct mjvOption_ { // abstract visualization options
struct mjvOption_ { // abstract visualization options
int label; // what objects to label (mjtLabel) int label; // what objects to label (mjtLabel)
int frame; // which frame to show (mjtFrame) int frame; // which frame to show (mjtFrame)
mjtByte geomgroup[mjNGROUP]; // geom visualization by group mjtByte geomgroup[mjNGROUP]; // geom visualization by group
@@ -3139,9 +3105,8 @@ struct mjvOption_ { // abstract visualization options
mjtByte flags[mjNVISFLAG]; // visualization flags (indexed by mjtVisFlag) mjtByte flags[mjNVISFLAG]; // visualization flags (indexed by mjtVisFlag)
int bvh_depth; // depth of the bounding volume hierarchy to be visualized int bvh_depth; // depth of the bounding volume hierarchy to be visualized
int flex_layer; // element layer to be visualized for 3D flex int flex_layer; // element layer to be visualized for 3D flex
}; } mjvOption;
typedef struct mjvOption_ mjvOption; typedef struct mjvScene_ { // abstract scene passed to OpenGL renderer
struct mjvScene_ { // abstract scene passed to OpenGL renderer
// abstract geoms // abstract geoms
int maxgeom; // size of allocated geom buffer int maxgeom; // size of allocated geom buffer
int ngeom; // number of geoms currently in buffer int ngeom; // number of geoms currently in buffer
@@ -3198,9 +3163,8 @@ struct mjvScene_ { // abstract scene passed to OpenGL renderer
// geom buffer status // geom buffer status
int status; // 0: ok, 1: geoms exhausted, warning issued int status; // 0: ok, 1: geoms exhausted, warning issued
}; } mjvScene;
typedef struct mjvScene_ mjvScene; typedef struct mjvFigure_ { // abstract 2D figure passed to OpenGL renderer
struct mjvFigure_ { // abstract 2D figure passed to OpenGL renderer
// enable flags // enable flags
int flg_legend; // show legend int flg_legend; // show legend
int flg_ticklabel[2]; // show grid tick labels (x,y) int flg_ticklabel[2]; // show grid tick labels (x,y)
@@ -3245,8 +3209,7 @@ struct mjvFigure_ { // abstract 2D figure passed to OpenGL rendere
int yaxispixel[2]; // range of y-axis in pixels int yaxispixel[2]; // range of y-axis in pixels
float xaxisdata[2]; // range of x-axis in data units float xaxisdata[2]; // range of x-axis in data units
float yaxisdata[2]; // range of y-axis in data units float yaxisdata[2]; // range of y-axis in data units
}; } mjvFigure;
typedef struct mjvFigure_ mjvFigure;
//----------------------------- MJAPI FUNCTIONS -------------------------------- //----------------------------- MJAPI FUNCTIONS --------------------------------
void mj_defaultVFS(mjVFS* vfs); void mj_defaultVFS(mjVFS* vfs);
+24 -29
View File
@@ -26,15 +26,15 @@
//------------------------------------- Contact ---------------------------------------------------- //------------------------------------- Contact ----------------------------------------------------
struct mjPreContact_ { // contact parameters set by narrowphase collision functions typedef struct mjPreContact_ { // contact parameters set by narrowphase collision functions
mjtNum dist; mjtNum dist;
mjtNum pos[3]; mjtNum pos[3];
mjtNum normal[3]; // contact normal of the collision mjtNum normal[3]; // contact normal of the collision
mjtNum tangent[3]; // first tangent direction mjtNum tangent[3]; // first tangent direction
}; } mjPreContact;
typedef struct mjPreContact_ mjPreContact;
struct mjContact_ { // result of collision detection functions
typedef struct mjContact_ { // result of collision detection functions
// contact parameters set by narrowphase collision function // contact parameters set by narrowphase collision function
mjtNum dist; // distance between nearest points; neg: penetration mjtNum dist; // distance between nearest points; neg: penetration
mjtNum pos[3]; // position of contact point: midpoint between geoms mjtNum pos[3]; // position of contact point: midpoint between geoms
@@ -65,41 +65,37 @@ struct mjContact_ { // result of collision detection functions
// address computed by mj_instantiateContact // address computed by mj_instantiateContact
int efc_address; // address in efc; -1: not included int efc_address; // address in efc; -1: not included
}; } mjContact;
typedef struct mjContact_ mjContact;
//---------------------------------- diagnostics --------------------------------------------------- //---------------------------------- diagnostics ---------------------------------------------------
struct mjWarningStat_ { // warning statistics typedef struct mjWarningStat_ { // warning statistics
int lastinfo; // info from last warning int lastinfo; // info from last warning
int number; // how many times was warning raised int number; // how many times was warning raised
}; } mjWarningStat;
typedef struct mjWarningStat_ mjWarningStat;
struct mjTimerStat_ { // timer statistics typedef struct mjTimerStat_ { // timer statistics
mjtNum duration; // cumulative duration mjtNum duration; // cumulative duration
int number; // how many times was timer called int number; // how many times was timer called
}; } mjTimerStat;
typedef struct mjTimerStat_ mjTimerStat;
struct mjSolverStat_ { // per-iteration solver statistics typedef struct mjSolverStat_ { // per-iteration solver statistics
mjtNum improvement; // cost reduction, scaled by 1/trace(M(qpos0)) mjtNum improvement; // cost reduction, scaled by 1/trace(M(qpos0))
mjtNum gradient; // gradient norm (primal only, scaled) mjtNum gradient; // gradient norm (primal only, scaled)
mjtNum lineslope; // slope in linesearch mjtNum lineslope; // slope in linesearch
int nactive; // number of active constraints int nactive; // number of active constraints
int nchange; // number of constraint state changes int nchange; // number of constraint state changes
int neval; // number of cost evaluations in line search int neval; // number of cost evaluations in line search
int nupdate; // number of Cholesky updates in line search int nupdate; // number of Cholesky updates in line search
}; } mjSolverStat;
typedef struct mjSolverStat_ mjSolverStat;
//---------------------------------- mjData -------------------------------------------------------- //---------------------------------- mjData --------------------------------------------------------
struct mjData_ { typedef struct mjData_ {
// constant sizes // constant sizes
mjtSize narena; // size of the arena in bytes (inclusive of the stack) mjtSize narena; // size of the arena in bytes (inclusive of the stack)
mjtSize nbuffer; // size of main buffer in bytes mjtSize nbuffer; // size of main buffer in bytes
@@ -411,8 +407,7 @@ struct mjData_ {
// compilation signature // compilation signature
uint64_t signature; // also held by the mjSpec that compiled the model uint64_t signature; // also held by the mjSpec that compiled the model
}; } mjData;
typedef struct mjData_ mjData;
//---------------------------------- callback function types --------------------------------------- //---------------------------------- callback function types ---------------------------------------
+14 -21
View File
@@ -50,7 +50,7 @@
//---------------------------------- mjLROpt ------------------------------------------------------- //---------------------------------- mjLROpt -------------------------------------------------------
struct mjLROpt_ { // options for mj_setLengthRange() typedef struct mjLROpt_ { // options for mj_setLengthRange()
// flags // flags
int mode; // which actuators to process (mjtLRMode) int mode; // which actuators to process (mjtLRMode)
int useexisting; // use existing length range if available int useexisting; // use existing length range if available
@@ -64,26 +64,23 @@ struct mjLROpt_ { // options for mj_setLengthRange()
mjtNum inttotal; // total simulation time interval mjtNum inttotal; // total simulation time interval
mjtNum interval; // evaluation time interval (at the end) mjtNum interval; // evaluation time interval (at the end)
mjtNum tolrange; // convergence tolerance (relative to range) mjtNum tolrange; // convergence tolerance (relative to range)
}; } mjLROpt;
typedef struct mjLROpt_ mjLROpt;
//---------------------------------- mjCache ------------------------------------------------------- //---------------------------------- mjCache -------------------------------------------------------
struct mjCache_ { // asset cache used by the compiler typedef struct mjCache_ { // asset cache used by the compiler
void* impl_; // internal pointer to cache void* impl_; // internal pointer to cache
}; } mjCache;
typedef struct mjCache_ mjCache;
//---------------------------------- mjVFS --------------------------------------------------------- //---------------------------------- mjVFS ---------------------------------------------------------
struct mjVFS_ { // virtual file system for loading from memory typedef struct mjVFS_ { // virtual file system for loading from memory
void* impl_; // internal pointer to VFS memory void* impl_; // internal pointer to VFS memory
}; } mjVFS;
typedef struct mjVFS_ mjVFS;
//---------------------------------- mjOption ------------------------------------------------------ //---------------------------------- mjOption ------------------------------------------------------
struct mjOption_ { // physics options typedef struct mjOption_ { // physics options
// timing parameters // timing parameters
mjtNum timestep; // timestep mjtNum timestep; // timestep
@@ -126,13 +123,12 @@ struct mjOption_ { // physics options
// sdf collision settings // sdf collision settings
int sdf_initpoints; // number of starting points for gradient descent int sdf_initpoints; // number of starting points for gradient descent
int sdf_iterations; // max number of iterations for gradient descent int sdf_iterations; // max number of iterations for gradient descent
}; } mjOption;
typedef struct mjOption_ mjOption;
//---------------------------------- mjVisual ------------------------------------------------------ //---------------------------------- mjVisual ------------------------------------------------------
struct mjVisual_ { // visualization options typedef struct mjVisual_ { // visualization options
struct { // global parameters struct { // global parameters
int cameraid; // initial camera id (-1: free) int cameraid; // initial camera id (-1: free)
int orthographic; // is the free camera orthographic (0: no, 1: yes) int orthographic; // is the free camera orthographic (0: no, 1: yes)
@@ -227,25 +223,23 @@ struct mjVisual_ { // visualization options
float bv[4]; // bounding volume float bv[4]; // bounding volume
float bvactive[4]; // active bounding volume float bvactive[4]; // active bounding volume
} rgba; } rgba;
}; } mjVisual;
typedef struct mjVisual_ mjVisual;
//---------------------------------- mjStatistic --------------------------------------------------- //---------------------------------- mjStatistic ---------------------------------------------------
struct mjStatistic_ { // model statistics (in qpos0) typedef struct mjStatistic_ { // model statistics (in qpos0)
mjtNum meaninertia; // mean diagonal inertia mjtNum meaninertia; // mean diagonal inertia
mjtNum meanmass; // mean body mass mjtNum meanmass; // mean body mass
mjtNum meansize; // mean body size mjtNum meansize; // mean body size
mjtNum extent; // spatial extent mjtNum extent; // spatial extent
mjtNum center[3]; // center of model mjtNum center[3]; // center of model
}; } mjStatistic;
typedef struct mjStatistic_ mjStatistic;
//---------------------------------- mjModel ------------------------------------------------------- //---------------------------------- mjModel -------------------------------------------------------
struct mjModel_ { typedef struct mjModel_ {
// ------------------------------- sizes // ------------------------------- sizes
// sizes needed at mjModel construction // sizes needed at mjModel construction
@@ -896,7 +890,6 @@ struct mjModel_ {
// compilation signature // compilation signature
uint64_t signature; // also held by the mjSpec that compiled this model uint64_t signature; // also held by the mjSpec that compiled this model
}; } mjModel;
typedef struct mjModel_ mjModel;
#endif // MUJOCO_MJMODEL_H_ #endif // MUJOCO_MJMODEL_H_
+12 -18
View File
@@ -24,14 +24,13 @@
//---------------------------------- Resource Provider --------------------------------------------- //---------------------------------- Resource Provider ---------------------------------------------
struct mjResource_ { typedef struct mjResource_ {
char* name; // name of resource (filename, etc) char* name; // name of resource (filename, etc)
void* data; // opaque data pointer void* data; // opaque data pointer
mjVFS* vfs; // pointer to the VFS mjVFS* vfs; // pointer to the VFS
char timestamp[512]; // timestamp of the resource char timestamp[512]; // timestamp of the resource
const struct mjpResourceProvider* provider; // pointer to the provider const struct mjpResourceProvider* provider; // pointer to the provider
}; } mjResource;
typedef struct mjResource_ mjResource;
// callback for opening a resource, returns zero on failure. // callback for opening a resource, returns zero on failure.
// Note: If opening fails, the close callback will not be called. Therefore, the // Note: If opening fails, the close callback will not be called. Therefore, the
@@ -60,7 +59,7 @@ typedef int (*mjfUnmountResource)(mjResource* resource);
typedef int (*mjfResourceModified)(const mjResource* resource, const char* timestamp); typedef int (*mjfResourceModified)(const mjResource* resource, const char* timestamp);
// struct describing a single resource provider // struct describing a single resource provider
struct mjpResourceProvider { typedef struct mjpResourceProvider {
const char* prefix; // prefix for match against a resource name const char* prefix; // prefix for match against a resource name
mjfOpenResource open; // opening callback mjfOpenResource open; // opening callback
mjfReadResource read; // reading callback mjfReadResource read; // reading callback
@@ -69,8 +68,7 @@ struct mjpResourceProvider {
mjfUnmountResource unmount; // unmounting callback (optional) mjfUnmountResource unmount; // unmounting callback (optional)
mjfResourceModified modified; // resource modified callback (optional) mjfResourceModified modified; // resource modified callback (optional)
void* data; // opaque data pointer (resource invariant) void* data; // opaque data pointer (resource invariant)
}; } mjpResourceProvider;
typedef struct mjpResourceProvider mjpResourceProvider;
//---------------------------------- Decoder ------------------------------------------------------- //---------------------------------- Decoder -------------------------------------------------------
@@ -81,7 +79,7 @@ typedef mjSpec* (*mjfDecode)(mjResource* resource, const mjVFS* vfs);
typedef int (*mjfCanDecode)(const mjResource* resource); typedef int (*mjfCanDecode)(const mjResource* resource);
// the struct defining the decoder plugin's interface // the struct defining the decoder plugin's interface
struct mjpDecoder { typedef struct mjpDecoder {
const char* content_type; const char* content_type;
const char* extension; const char* extension;
// user-facing functions // user-facing functions
@@ -89,21 +87,19 @@ struct mjpDecoder {
mjfDecode decode; // main decoding function mjfDecode decode; // main decoding function
// the caller takes ownership of the spec returned by decode and is responsible // the caller takes ownership of the spec returned by decode and is responsible
// for cleaning it up // for cleaning it up
}; } mjpDecoder;
typedef struct mjpDecoder mjpDecoder;
//---------------------------------- Encoder ------------------------------------------------------- //---------------------------------- Encoder -------------------------------------------------------
typedef int (*mjfEncode)(const mjSpec* s, const mjModel* m, const mjVFS* vfs, typedef int (*mjfEncode)(const mjSpec* s, const mjModel* m, const mjVFS* vfs,
mjResource* resource); mjResource* resource);
struct mjpEncoder { typedef struct mjpEncoder {
const char* content_type; const char* content_type;
const char* extension; const char* extension;
mjfEncode encode; // Function to encode an mjSpec and mjModel to a mjResource. mjfEncode encode; // Function to encode an mjSpec and mjModel to a mjResource.
mjfCloseResource close_resource; // Function to close/free the resource. mjfCloseResource close_resource; // Function to close/free the resource.
}; } mjpEncoder;
typedef struct mjpEncoder mjpEncoder;
//---------------------------------- Plugins ------------------------------------------------------- //---------------------------------- Plugins -------------------------------------------------------
@@ -114,7 +110,7 @@ typedef enum mjtPluginCapabilityBit_ {
mjPLUGIN_SDF = 1<<3, // signed distance fields mjPLUGIN_SDF = 1<<3, // signed distance fields
} mjtPluginCapabilityBit; } mjtPluginCapabilityBit;
struct mjpPlugin_ { typedef struct mjpPlugin_ {
const char* name; // globally unique name identifying the plugin const char* name; // globally unique name identifying the plugin
int nattribute; // number of configuration attributes int nattribute; // number of configuration attributes
@@ -172,18 +168,16 @@ struct mjpPlugin_ {
// bounding box of implicit surface // bounding box of implicit surface
void (*sdf_aabb)(mjtNum aabb[6], const mjtNum* attributes); void (*sdf_aabb)(mjtNum aabb[6], const mjtNum* attributes);
}; } mjpPlugin;
typedef struct mjpPlugin_ mjpPlugin;
struct mjSDF_ { typedef struct mjSDF_ {
const mjpPlugin** plugin; const mjpPlugin** plugin;
int* id; int* id;
mjtSDFType type; mjtSDFType type;
mjtNum* relpos; mjtNum* relpos;
mjtNum* relmat; mjtNum* relmat;
mjtGeom* geomtype; mjtGeom* geomtype;
}; } mjSDF;
typedef struct mjSDF_ mjSDF;
//------------------------------------ Initialization ---------------------------------------------- //------------------------------------ Initialization ----------------------------------------------
+9 -12
View File
@@ -109,21 +109,19 @@ typedef enum mjrMeshPrimitiveType_ { // type of mesh primitive
} mjrMeshPrimitiveType; } mjrMeshPrimitiveType;
struct mjrRect_ { // OpenGL rectangle typedef struct mjrRect_ { // OpenGL rectangle
int left; // left (usually 0) int left; // left (usually 0)
int bottom; // bottom (usually 0) int bottom; // bottom (usually 0)
int width; // width (usually buffer width) int width; // width (usually buffer width)
int height; // height (usually buffer height) int height; // height (usually buffer height)
}; } mjrRect;
typedef struct mjrRect_ mjrRect;
struct mjrVertexAttribute_ { // vertex attribute format specification typedef struct mjrVertexAttribute_ { // vertex attribute format specification
const void* bytes; // vertex data const void* bytes; // vertex data
int usage; // mjrVertexAttributeUsage; e.g. position, normal, etc. int usage; // mjrVertexAttributeUsage; e.g. position, normal, etc.
int type; // mjrVertexAttributeType; e.g. float3, ubyte4, etc. int type; // mjrVertexAttributeType; e.g. float3, ubyte4, etc.
}; } mjrVertexAttribute;
typedef struct mjrVertexAttribute_ mjrVertexAttribute;
// alias non-rendering types into mjr namespace // alias non-rendering types into mjr namespace
@@ -135,7 +133,7 @@ typedef mjvGLCamera mjrCamera;
//---------------------------------- mjrContext ---------------------------------------------------- //---------------------------------- mjrContext ----------------------------------------------------
struct mjrContext_ { // custom OpenGL context typedef struct mjrContext_ { // custom OpenGL context
// parameters copied from mjVisual // parameters copied from mjVisual
float lineWidth; // line width for wireframe rendering float lineWidth; // line width for wireframe rendering
float shadowClip; // clipping radius for directional lights float shadowClip; // clipping radius for directional lights
@@ -226,8 +224,7 @@ struct mjrContext_ { // custom OpenGL context
// depth output format // depth output format
int readDepthMap; // depth mapping: mjDEPTH_ZERONEAR or mjDEPTH_ZEROFAR int readDepthMap; // depth mapping: mjDEPTH_ZERONEAR or mjDEPTH_ZEROFAR
}; } mjrContext;
typedef struct mjrContext_ mjrContext;
#if defined(__cplusplus) #if defined(__cplusplus)
} }
+90 -102
View File
@@ -89,12 +89,11 @@ typedef enum mjrGraphicsApi_ { // underlying graphics API to use for rendering
mjGRAPHICS_API_VULKAN, // vulkan mjGRAPHICS_API_VULKAN, // vulkan
} mjrGraphicsApi; } mjrGraphicsApi;
struct mjrfContextConfig_ { // parameters for creating filament context (mjrfContext) typedef struct mjrfContextConfig_ { // parameters for creating filament context (mjrfContext)
int graphics_api; // mjrGraphicsApi; rendering graphics API int graphics_api; // mjrGraphicsApi; rendering graphics API
mjtBool force_software_rendering; // force backend to use software rendering mjtBool force_software_rendering; // force backend to use software rendering
void* native_window; // platform-dependent window handle (or nullptr for windowless) void* native_window; // platform-dependent window handle (or nullptr for windowless)
}; } mjrfContextConfig;
typedef struct mjrfContextConfig_ mjrfContextConfig;
// Initializes the mjrfContextConfig to default values. // Initializes the mjrfContextConfig to default values.
void mjrf_defaultContextConfig(mjrfContextConfig* config); void mjrf_defaultContextConfig(mjrfContextConfig* config);
@@ -115,29 +114,27 @@ typedef enum mjrDrawMode_ { // how to draw objects in the scene
mjDRAW_MODE_SEGMENTATION_BY_COLOR, // generate visually distinct colors using segmentation id mjDRAW_MODE_SEGMENTATION_BY_COLOR, // generate visually distinct colors using segmentation id
} mjrDrawMode; } mjrDrawMode;
struct mjrfRenderRequest_ { // a single rendering operation typedef struct mjrfRenderRequest_ { // a single rendering operation
mjrfScene* scene; // scene to render mjrfScene* scene; // scene to render
mjrCamera camera; // camera (viewpoint) from which to render scene mjrCamera camera; // camera (viewpoint) from which to render scene
mjrRect viewport; // viewport (rect area) into which to render mjrRect viewport; // viewport (rect area) into which to render
mjrfRenderTarget* target; // target used for rendering (or nullptr for window rendering) mjrfRenderTarget* target; // target used for rendering (or nullptr for window rendering)
int draw_mode; // mjrDrawMode; method to use for drawing objects int draw_mode; // mjrDrawMode; method to use for drawing objects
mjtBool enable_post_processing; // enable post processing, enabled by default mjtBool enable_post_processing; // enable post processing, enabled by default
mjtBool enable_reflections; // enable reflections, enabled by default mjtBool enable_reflections; // enable reflections, enabled by default
mjtBool enable_shadows; // enable shadows, enabled by default mjtBool enable_shadows; // enable shadows, enabled by default
}; } mjrfRenderRequest;
typedef struct mjrfRenderRequest_ mjrfRenderRequest;
// Initializes the mjrfRenderRequest to default values. // Initializes the mjrfRenderRequest to default values.
void mjrf_defaultRenderRequest(mjrfRenderRequest* request); void mjrf_defaultRenderRequest(mjrfRenderRequest* request);
struct mjrfReadPixelsRequest_ { // a single read operation typedef struct mjrfReadPixelsRequest_ { // a single read operation
mjrfRenderTarget* target; // render target from which to read the image pixels mjrfRenderTarget* target; // render target from which to read the image pixels
void* output; // buffer into which the pixels will be stored void* output; // buffer into which the pixels will be stored
mjtSize num_bytes; // size of output buffer mjtSize num_bytes; // size of output buffer
mjrfCallback read_completed; // callback when read is complete; can use to free output mjrfCallback read_completed; // callback when read is complete; can use to free output
void* user_data; // user data for read_completed_callback void* user_data; // user data for read_completed_callback
}; } mjrfReadPixelsRequest;
typedef struct mjrfReadPixelsRequest_ mjrfReadPixelsRequest;
// Initializes the mjrfReadPixelsRequest to default values. // Initializes the mjrfReadPixelsRequest to default values.
void mjrf_defaultReadPixelsRequest(mjrfReadPixelsRequest* request); void mjrf_defaultReadPixelsRequest(mjrfReadPixelsRequest* request);
@@ -164,10 +161,9 @@ void mjrf_waitForFrame(mjrfContext* ctx, mjrfFrameHandle frame);
// Sets the clear color for the renderer. // Sets the clear color for the renderer.
void mjrf_setClearColor(mjrfContext* ctx, const float color[3]); void mjrf_setClearColor(mjrfContext* ctx, const float color[3]);
struct mjrfFrameStats_ { // stats for a single frame of rendering typedef struct mjrfFrameStats_ { // stats for a single frame of rendering
double frame_rate; // frame rate, in frames per second double frame_rate; // frame rate, in frames per second
}; } mjrfFrameStats;
typedef struct mjrfFrameStats_ mjrfFrameStats;
// Initializes the mjrFrameStats to default values. // Initializes the mjrFrameStats to default values.
void mjrf_defaultFrameStats(mjrfFrameStats* stats); void mjrf_defaultFrameStats(mjrfFrameStats* stats);
@@ -184,14 +180,13 @@ void mjrf_getFrameStats(mjrfContext* ctx, mjrfFrameHandle frame, mjrfFrameStats*
// filament's `cmgen` tool to generate a KTX image from your source image. This tool will calculate // filament's `cmgen` tool to generate a KTX image from your source image. This tool will calculate
// additional data (i.e. the spherical harmonics) and encode that information into the KTX file. // additional data (i.e. the spherical harmonics) and encode that information into the KTX file.
struct mjrfTextureConfig_ { // parameters for creating a texture (mjrfTexture) typedef struct mjrfTextureConfig_ { // parameters for creating a texture (mjrfTexture)
int width; // texture width; or number of bytes for compressed data (e.g. KTX) int width; // width; or number of bytes for compressed data (e.g. KTX)
int height; // texture height; or 0 for compressed data (e.g. KTX) int height; // height; or 0 for compressed data (e.g. KTX)
int format; // mjrPixelFormat; (e.g. RGB8, RGBA8, KTX, etc.) int format; // mjrPixelFormat; (e.g. RGB8, RGBA8, KTX, etc.)
int color_space; // mjrColorSpace; (e.g. LINEAR, sRGB, etc.) int color_space; // mjrColorSpace; (e.g. LINEAR, sRGB, etc.)
int sampler_type; // mjrSamplerType; texture sampler (e.g. 2D, cube, etc.) int sampler_type; // mjrSamplerType; texture sampler (e.g. 2D, cube, etc.)
}; } mjrfTextureConfig;
typedef struct mjrfTextureConfig_ mjrfTextureConfig;
// Initializes the mjrfTextureConfig to default values. // Initializes the mjrfTextureConfig to default values.
void mjrf_defaultTextureConfig(mjrfTextureConfig* config); void mjrf_defaultTextureConfig(mjrfTextureConfig* config);
@@ -204,13 +199,12 @@ mjrfTexture* mjrf_createTexture(mjrfContext* ctx,
// Destroys the texture. // Destroys the texture.
void mjrf_destroyTexture(mjrfTexture* texture); void mjrf_destroyTexture(mjrfTexture* texture);
struct mjrfTextureData_ { // binary data for a texture (mjrfTexture) typedef struct mjrfTextureData_ { // binary data for a texture (mjrfTexture)
const void* bytes; // pointer to image data, or nullptr for empty texture const void* bytes; // pointer to image data, or nullptr for empty texture
mjtSize num_bytes; // number of bytes in the image data mjtSize num_bytes; // number of bytes in the image data
mjrfCallback release; // callback when data has finished uploading mjrfCallback release; // callback when data has finished uploading
void* user_data; // user data for release callback void* user_data; // user data for release callback
}; } mjrfTextureData;
typedef struct mjrfTextureData_ mjrfTextureData;
// Initializes the mjrfTextureData to default values. // Initializes the mjrfTextureData to default values.
void mjrf_defaultTextureData(mjrfTextureData* data); void mjrf_defaultTextureData(mjrfTextureData* data);
@@ -252,22 +246,21 @@ int mjrf_getSamplerType(const mjrfTexture* texture);
// Maximum number of vertex attributes in a mesh. // Maximum number of vertex attributes in a mesh.
enum { mjMAX_VERTEX_ATTRIBUTES = 16 }; enum { mjMAX_VERTEX_ATTRIBUTES = 16 };
struct mjrfMeshData_ { // binary data for a mesh (mjrfMesh) typedef struct mjrfMeshData_ { // binary data for a mesh (mjrfMesh)
mjtSize num_vertices; // number of vertices; all vertex attributes share this size mjtSize num_vertices; // number of vertices; all vertex attributes share this size
int num_attributes; // number of attributes defined int num_attributes; // number of attributes defined
mjrVertexAttribute attributes[mjMAX_VERTEX_ATTRIBUTES]; // per-vertex attribute information mjrVertexAttribute attributes[mjMAX_VERTEX_ATTRIBUTES]; // per-vertex attribute information
mjtBool interleaved; // true if vertex attributes are interleaved mjtBool interleaved; // true if vertex attributes are interleaved
mjtSize num_indices; // number of indices mjtSize num_indices; // number of indices
const void* indices; // indices data array const void* indices; // indices data array
int index_type; // mjrIndexType; (e.g. UINT16 or UINT32) int index_type; // mjrIndexType; (e.g. UINT16 or UINT32)
int primitive_type; // mjrMeshPrimitiveType; (e.g. TRIANGLES, etc.) int primitive_type; // mjrMeshPrimitiveType; (e.g. TRIANGLES, etc.)
mjtBool compute_bounds; // if true, compute bounds from vertex positions mjtBool compute_bounds; // if true, compute bounds from vertex positions
float bounds_min[3]; // min/max bounds; assume unset if bounds_min == bounds_max float bounds_min[3]; // min/max bounds; assume unset if bounds_min == bounds_max
float bounds_max[3]; float bounds_max[3];
mjrfCallback release; // callback when data has finished uploading mjrfCallback release; // callback when data has finished uploading
void* user_data; // user data for release callback void* user_data; // user data for release callback
}; } mjrfMeshData;
typedef struct mjrfMeshData_ mjrfMeshData;
// Initializes the mjrfMeshData to default values. // Initializes the mjrfMeshData to default values.
void mjrf_defaultMeshData(mjrfMeshData* data); void mjrf_defaultMeshData(mjrfMeshData* data);
@@ -283,9 +276,8 @@ void mjrf_destroyMesh(mjrfMesh* mesh);
// A scene is a collection of entities (Lights and Renderables) that describes what is to be // A scene is a collection of entities (Lights and Renderables) that describes what is to be
// rendered. // rendered.
struct mjrfSceneParams_ { // parameters for creating a scene (mjrfScene) typedef struct mjrfSceneParams_ { // parameters for creating a scene (mjrfScene)
}; } mjrfSceneParams;
typedef struct mjrfSceneParams_ mjrfSceneParams;
// Initializes the mjrfSceneParams to default values. // Initializes the mjrfSceneParams to default values.
void mjrf_defaultSceneParams(mjrfSceneParams* params); void mjrf_defaultSceneParams(mjrfSceneParams* params);
@@ -331,19 +323,18 @@ void mjrf_configureSceneFromModel(mjrfScene* scene, const mjModel* model);
// lights as you want. Each light source (except image based lights) may or may not cast shadows. // lights as you want. Each light source (except image based lights) may or may not cast shadows.
// Each shadow-casting light incurs a performance cost. // Each shadow-casting light incurs a performance cost.
struct mjrfLightParams_ { // parameters for creating a light (mjrfLight) typedef struct mjrfLightParams_ { // parameters for creating a light (mjrfLight)
int type; // mjrLightType; type of light (e.g. spot, point, image, etc.) int type; // mjrLightType; type of light (e.g. spot, point, image, etc.)
const mjrfTexture* texture; // texture; only for image lights const mjrfTexture* texture; // texture; only for image lights
float color[3]; // RGB color float color[3]; // RGB color
float intensity; // light intensity, in candela float intensity; // light intensity, in candela
mjtBool cast_shadows; // if true, cast shadows mjtBool cast_shadows; // if true, cast shadows
float range; // effective range of light, in meters float range; // effective range of light, in meters
float spot_cone_angle; // spot light cone angle, in degrees float spot_cone_angle; // spot light cone angle, in degrees
int shadow_map_size; // size of shadow map texture, 0 to use default size int shadow_map_size; // size of shadow map texture, 0 to use default size
float bulb_radius; // bulb radius, used for soft shadows float bulb_radius; // bulb radius, used for soft shadows
float vsm_blur_width; // variance shadow map blur width float vsm_blur_width; // variance shadow map blur width
}; } mjrfLightParams;
typedef struct mjrfLightParams_ mjrfLightParams;
// Initializes the mjrfLightParams to default values. // Initializes the mjrfLightParams to default values.
void mjrf_defaultLightParams(mjrfLightParams* params); void mjrf_defaultLightParams(mjrfLightParams* params);
@@ -385,22 +376,22 @@ int mjrf_getLightType(const mjrfLight* light);
// //
// Which lighting model is used is determined by the mjrfMaterial properties. // Which lighting model is used is determined by the mjrfMaterial properties.
struct mjrfMaterial_ { // material properties for a renderable (mjrfMaterial) typedef struct mjrfMaterial_ { // material properties for a renderable (mjrfMaterial)
float color[4]; // object color; defaults to white float color[4]; // object color; defaults to white
int32_t segmentation_id; // ID for segmentation rendering; maps to RGB8 color (i.e. 24 bits) int32_t segmentation_id; // ID for segmentation rendering; maps to RGB8 color (i.e. 24 bits)
int32_t island_id; // ID to which the renderable belongs int32_t island_id; // ID to which the renderable belongs
int sleep_state; // mjtSleepState; sleep state of the renderable int sleep_state; // mjtSleepState; sleep state of the renderable
float uv_scale[3]; // scale applied to UV coordinates; defaults to (1,1,1) float uv_scale[3]; // scale applied to UV coordinates; defaults to (1,1,1)
float uv_offset[3]; // offset applied to UV coordinates; defaults to (0,0,0) float uv_offset[3]; // offset applied to UV coordinates; defaults to (0,0,0)
float scissor[4]; // if non-zero, applies scissor testing when rendering float scissor[4]; // if non-zero, applies scissor testing when rendering
float metallic; // metallic factory [0, 1]; disabled if < 0 float metallic; // metallic factory [0, 1]; disabled if < 0
float roughness; // roughness factor [0, 1]; disabled if < 0 float roughness; // roughness factor [0, 1]; disabled if < 0
float specular; // specular factor [0, 1]; disabled if < 0 float specular; // specular factor [0, 1]; disabled if < 0
float glossiness; // glossiness factor [0, 1]; disabled if < 0 float glossiness; // glossiness factor [0, 1]; disabled if < 0
float emissive; // emissive/glow factor [0, 1]; disabled if < 0 float emissive; // emissive/glow factor [0, 1]; disabled if < 0
float reflectance; // blend factor for reflective surfaces [0, 1]; applies only to planes float reflectance; // blend factor for reflective surfaces [0, 1]; only for planes
mjtBool decor_ux; // for ux elements, does not apply any lighting mjtBool decor_ux; // for ux elements, does not apply any lighting
mjtBool selected; // for "selected" ux elements, adds additional styling mjtBool selected; // for "selected" ux elements, adds additional styling
const mjrfTexture* color_texture; // color/albedo texture (RGB8) const mjrfTexture* color_texture; // color/albedo texture (RGB8)
const mjrfTexture* opacity_texture; // opacity texture (A8) const mjrfTexture* opacity_texture; // opacity texture (A8)
const mjrfTexture* normal_texture; // normal map texture (RGB8) const mjrfTexture* normal_texture; // normal map texture (RGB8)
@@ -410,18 +401,16 @@ struct mjrfMaterial_ { // material properties for a renderable (mjrfMater
const mjrfTexture* orm_texture; // occlusion/roughness/metallic texture (RGB8) const mjrfTexture* orm_texture; // occlusion/roughness/metallic texture (RGB8)
const mjrfTexture* emissive_texture; // emissive texture (RGB8) const mjrfTexture* emissive_texture; // emissive texture (RGB8)
const mjrfTexture* reflection_texture; // reflection texture, for internal use only const mjrfTexture* reflection_texture; // reflection texture, for internal use only
}; } mjrfMaterial;
typedef struct mjrfMaterial_ mjrfMaterial;
// Initializes the mjrfMaterial to default values. // Initializes the mjrfMaterial to default values.
void mjrf_defaultMaterial(mjrfMaterial* material); void mjrf_defaultMaterial(mjrfMaterial* material);
struct mjrfRenderableParams_ { // parameters for creating a renderable (mjrfRenderable) typedef struct mjrfRenderableParams_ { // parameters for creating a renderable (mjrfRenderable)
mjtBool cast_shadows; // if true, casts shadows mjtBool cast_shadows; // if true, casts shadows
mjtBool receive_shadows; // if true, receives shadows mjtBool receive_shadows; // if true, receives shadows
uint16_t blend_order; // controls draw order for transparent objects [0, 8] uint16_t blend_order; // controls draw order for transparent objects [0, 8]
}; } mjrfRenderableParams;
typedef struct mjrfRenderableParams_ mjrfRenderableParams;
// Initializes the mjrfRenderableParams to default values. // Initializes the mjrfRenderableParams to default values.
void mjrf_defaultRenderableParams(mjrfRenderableParams* params); void mjrf_defaultRenderableParams(mjrfRenderableParams* params);
@@ -462,13 +451,12 @@ void mjrf_setRenderableSize(mjrfRenderable* renderable, const float size[3]);
// A render target is a memory buffer that holds the results of a rendering operation. (This is an // A render target is a memory buffer that holds the results of a rendering operation. (This is an
// alternative to rendering directly to the screen.) See mjrf_render for more details. // alternative to rendering directly to the screen.) See mjrf_render for more details.
struct mjrfRenderTargetConfig_ { // parameters for creating a render target (mjrfRenderTarget) typedef struct mjrfRenderTargetConfig_ { // parameters for creating a render target
int width; // texture width int width; // texture width
int height; // texture height int height; // texture height
int color_format; // mjrPixelFormat; pixel format for color buffer int color_format; // mjrPixelFormat; pixel format for color buffer
int depth_format; // mjrPixelFormat; pixel format for depth buffer int depth_format; // mjrPixelFormat; pixel format for depth buffer
}; } mjrfRenderTargetConfig;
typedef struct mjrfRenderTargetConfig_ mjrfRenderTargetConfig;
// Initializes the RenderTargetConfig to default values. // Initializes the RenderTargetConfig to default values.
void mjrf_defaultRenderTargetConfig(mjrfRenderTargetConfig* config); void mjrf_defaultRenderTargetConfig(mjrfRenderTargetConfig* config);
+12 -12
View File
@@ -57,13 +57,13 @@ extern "C" {
//-------------------------------- enum types (mjt) ------------------------------------------------ //-------------------------------- enum types (mjt) ------------------------------------------------
typedef enum mjtGeomInertia_ { // type of inertia inference typedef enum mjtGeomInertia { // type of inertia inference
mjINERTIA_VOLUME = 0, // mass distributed in the volume mjINERTIA_VOLUME = 0, // mass distributed in the volume
mjINERTIA_SHELL, // mass distributed on the surface mjINERTIA_SHELL, // mass distributed on the surface
} mjtGeomInertia; } mjtGeomInertia;
typedef enum mjtMeshInertia_ { // type of mesh inertia typedef enum mjtMeshInertia { // type of mesh inertia
mjMESH_INERTIA_CONVEX = 0, // convex mesh inertia mjMESH_INERTIA_CONVEX = 0, // convex mesh inertia
mjMESH_INERTIA_EXACT, // exact mesh inertia mjMESH_INERTIA_EXACT, // exact mesh inertia
mjMESH_INERTIA_LEGACY, // legacy mesh inertia mjMESH_INERTIA_LEGACY, // legacy mesh inertia
@@ -71,7 +71,7 @@ typedef enum mjtMeshInertia_ { // type of mesh inertia
} mjtMeshInertia; } mjtMeshInertia;
typedef enum mjtMeshBuiltin_ { // type of built-in procedural mesh typedef enum mjtMeshBuiltin { // type of built-in procedural mesh
mjMESH_BUILTIN_NONE = 0, // no built-in mesh mjMESH_BUILTIN_NONE = 0, // no built-in mesh
mjMESH_BUILTIN_SPHERE, // sphere mjMESH_BUILTIN_SPHERE, // sphere
mjMESH_BUILTIN_HEMISPHERE, // hemisphere mjMESH_BUILTIN_HEMISPHERE, // hemisphere
@@ -83,7 +83,7 @@ typedef enum mjtMeshBuiltin_ { // type of built-in procedural mesh
} mjtMeshBuiltin; } mjtMeshBuiltin;
typedef enum mjtBuiltin_ { // type of built-in procedural texture typedef enum mjtBuiltin { // type of built-in procedural texture
mjBUILTIN_NONE = 0, // no built-in texture mjBUILTIN_NONE = 0, // no built-in texture
mjBUILTIN_GRADIENT, // gradient: rgb1->rgb2 mjBUILTIN_GRADIENT, // gradient: rgb1->rgb2
mjBUILTIN_CHECKER, // checker pattern: rgb1, rgb2 mjBUILTIN_CHECKER, // checker pattern: rgb1, rgb2
@@ -91,7 +91,7 @@ typedef enum mjtBuiltin_ { // type of built-in procedural texture
} mjtBuiltin; } mjtBuiltin;
typedef enum mjtMark_ { // mark type for procedural textures typedef enum mjtMark { // mark type for procedural textures
mjMARK_NONE = 0, // no mark mjMARK_NONE = 0, // no mark
mjMARK_EDGE, // edges mjMARK_EDGE, // edges
mjMARK_CROSS, // cross mjMARK_CROSS, // cross
@@ -99,28 +99,28 @@ typedef enum mjtMark_ { // mark type for procedural textures
} mjtMark; } mjtMark;
typedef enum mjtLimited_ { // type of limit specification typedef enum mjtLimited { // type of limit specification
mjLIMITED_FALSE = 0, // not limited mjLIMITED_FALSE = 0, // not limited
mjLIMITED_TRUE, // limited mjLIMITED_TRUE, // limited
mjLIMITED_AUTO, // limited inferred from presence of range mjLIMITED_AUTO, // limited inferred from presence of range
} mjtLimited; } mjtLimited;
typedef enum mjtAlignFree_ { // whether to align free joints with the inertial frame typedef enum mjtAlignFree { // whether to align free joints with the inertial frame
mjALIGNFREE_FALSE = 0, // don't align mjALIGNFREE_FALSE = 0, // don't align
mjALIGNFREE_TRUE, // align mjALIGNFREE_TRUE, // align
mjALIGNFREE_AUTO, // respect the global compiler flag mjALIGNFREE_AUTO, // respect the global compiler flag
} mjtAlignFree; } mjtAlignFree;
typedef enum mjtInertiaFromGeom_ { // whether to infer body inertias from child geoms typedef enum mjtInertiaFromGeom { // whether to infer body inertias from child geoms
mjINERTIAFROMGEOM_FALSE = 0, // do not use; inertial element required mjINERTIAFROMGEOM_FALSE = 0, // do not use; inertial element required
mjINERTIAFROMGEOM_TRUE, // always use; overwrite inertial element mjINERTIAFROMGEOM_TRUE, // always use; overwrite inertial element
mjINERTIAFROMGEOM_AUTO // use only if inertial element is missing mjINERTIAFROMGEOM_AUTO // use only if inertial element is missing
} mjtInertiaFromGeom; } mjtInertiaFromGeom;
typedef enum mjtOrientation_ { // type of orientation specifier typedef enum mjtOrientation { // type of orientation specifier
mjORIENTATION_QUAT = 0, // quaternion mjORIENTATION_QUAT = 0, // quaternion
mjORIENTATION_AXISANGLE, // axis and angle mjORIENTATION_AXISANGLE, // axis and angle
mjORIENTATION_XYAXES, // x and y axes mjORIENTATION_XYAXES, // x and y axes
@@ -128,13 +128,13 @@ typedef enum mjtOrientation_ { // type of orientation specifier
mjORIENTATION_EULER, // Euler angles mjORIENTATION_EULER, // Euler angles
} mjtOrientation; } mjtOrientation;
typedef enum mjtConflict_ { // conflict resolution for attach typedef enum mjtConflict { // conflict resolution for attach
mjCONFLICT_WARNING = 0, // keep parent, warn on conflict mjCONFLICT_WARNING = 0, // keep parent, warn on conflict
mjCONFLICT_MERGE, // merge: min/max/error per field mjCONFLICT_MERGE, // merge: min/max/error per field
mjCONFLICT_ERROR, // error on any conflict mjCONFLICT_ERROR, // error on any conflict
} mjtConflict; } mjtConflict;
typedef enum mjtCTimer_ { // compiler timing categories typedef enum mjtCTimer { // compiler timing categories
// top-level timers (wall-clock) // top-level timers (wall-clock)
mjCTIMER_TOTAL = 0, // total compile time mjCTIMER_TOTAL = 0, // total compile time
mjCTIMER_ASSETS, // asset compilation mjCTIMER_ASSETS, // asset compilation
@@ -176,7 +176,7 @@ typedef struct mjsCompiler_ { // compiler options
int inertiagrouprange[2]; // range of geom groups used to compute inertia int inertiagrouprange[2]; // range of geom groups used to compute inertia
mjtByte saveinertial; // save explicit inertial clause for all bodies to XML mjtByte saveinertial; // save explicit inertial clause for all bodies to XML
int alignfree; // align free joints with inertial frame int alignfree; // align free joints with inertial frame
int conflict; // conflict resolution for attach (mjtConflict) int conflict; // conflict resolution for attach (mjtConflict)
mjLROpt LRopt; // options for lengthrange computation mjLROpt LRopt; // options for lengthrange computation
mjString* meshdir; // mesh and hfield directory mjString* meshdir; // mesh and hfield directory
mjString* texturedir; // texture directory mjString* texturedir; // texture directory
+40 -40
View File
@@ -50,7 +50,7 @@ typedef int64_t mjtSize; // used for buffer sizes
//---------------------------------- enum types (mjModel) ------------------------------------------ //---------------------------------- enum types (mjModel) ------------------------------------------
typedef enum mjtDisableBit_ { // disable default feature bitflags typedef enum mjtDisableBit { // disable default feature bitflags
mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver
mjDSBL_EQUALITY = 1<<1, // equality constraints mjDSBL_EQUALITY = 1<<1, // equality constraints
mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints
@@ -76,7 +76,7 @@ typedef enum mjtDisableBit_ { // disable default feature bitflags
} mjtDisableBit; } mjtDisableBit;
typedef enum mjtEnableBit_ { // enable optional feature bitflags typedef enum mjtEnableBit { // enable optional feature bitflags
mjENBL_OVERRIDE = 1<<0, // override contact parameters mjENBL_OVERRIDE = 1<<0, // override contact parameters
mjENBL_ENERGY = 1<<1, // energy computation mjENBL_ENERGY = 1<<1, // energy computation
mjENBL_FWDINV = 1<<2, // record solver statistics mjENBL_FWDINV = 1<<2, // record solver statistics
@@ -88,7 +88,7 @@ typedef enum mjtEnableBit_ { // enable optional feature bitflags
} mjtEnableBit; } mjtEnableBit;
typedef enum mjtJoint_ { // type of degree of freedom typedef enum mjtJoint { // type of degree of freedom
mjJNT_FREE = 0, // global position and orientation (quat) (7) mjJNT_FREE = 0, // global position and orientation (quat) (7)
mjJNT_BALL, // orientation (quat) relative to parent (4) mjJNT_BALL, // orientation (quat) relative to parent (4)
mjJNT_SLIDE, // sliding distance along body-fixed axis (1) mjJNT_SLIDE, // sliding distance along body-fixed axis (1)
@@ -96,7 +96,7 @@ typedef enum mjtJoint_ { // type of degree of freedom
} mjtJoint; } mjtJoint;
typedef enum mjtGeom_ { // type of geometric shape typedef enum mjtGeom { // type of geometric shape
// regular geom types // regular geom types
mjGEOM_PLANE = 0, // plane mjGEOM_PLANE = 0, // plane
mjGEOM_HFIELD, // height field mjGEOM_HFIELD, // height field
@@ -125,13 +125,13 @@ typedef enum mjtGeom_ { // type of geometric shape
} mjtGeom; } mjtGeom;
typedef enum mjtProjection_ { // type of camera projection typedef enum mjtProjection { // type of camera projection
mjPROJ_PERSPECTIVE = 0, // perspective mjPROJ_PERSPECTIVE = 0, // perspective
mjPROJ_ORTHOGRAPHIC // orthographic mjPROJ_ORTHOGRAPHIC // orthographic
} mjtProjection; } mjtProjection;
typedef enum mjtCamLight_ { // tracking mode for camera and light typedef enum mjtCamLight { // tracking mode for camera and light
mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body
mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global
mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body
@@ -140,7 +140,7 @@ typedef enum mjtCamLight_ { // tracking mode for camera and light
} mjtCamLight; } mjtCamLight;
typedef enum mjtLightType_ { // type of light typedef enum mjtLightType { // type of light
mjLIGHT_SPOT = 0, // spot mjLIGHT_SPOT = 0, // spot
mjLIGHT_DIRECTIONAL, // directional mjLIGHT_DIRECTIONAL, // directional
mjLIGHT_POINT, // point mjLIGHT_POINT, // point
@@ -148,14 +148,14 @@ typedef enum mjtLightType_ { // type of light
} mjtLightType; } mjtLightType;
typedef enum mjtTexture_ { // type of texture typedef enum mjtTexture { // type of texture
mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields
mjTEXTURE_CUBE, // cube texture, suitable for all other geom types mjTEXTURE_CUBE, // cube texture, suitable for all other geom types
mjTEXTURE_SKYBOX // cube texture used as skybox mjTEXTURE_SKYBOX // cube texture used as skybox
} mjtTexture; } mjtTexture;
typedef enum mjtTextureRole_ { // role of texture map in rendering typedef enum mjtTextureRole { // role of texture map in rendering
mjTEXROLE_USER = 0, // unspecified mjTEXROLE_USER = 0, // unspecified
mjTEXROLE_RGB, // base color (albedo) mjTEXROLE_RGB, // base color (albedo)
mjTEXROLE_OCCLUSION, // ambient occlusion mjTEXROLE_OCCLUSION, // ambient occlusion
@@ -170,14 +170,14 @@ typedef enum mjtTextureRole_ { // role of texture map in rendering
} mjtTextureRole; } mjtTextureRole;
typedef enum mjtColorSpace_ { // type of color space encoding typedef enum mjtColorSpace { // type of color space encoding
mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear
mjCOLORSPACE_LINEAR, // linear color space mjCOLORSPACE_LINEAR, // linear color space
mjCOLORSPACE_SRGB // standard RGB color space mjCOLORSPACE_SRGB // standard RGB color space
} mjtColorSpace; } mjtColorSpace;
typedef enum mjtIntegrator_ { // integrator mode typedef enum mjtIntegrator { // integrator mode
mjINT_EULER = 0, // semi-implicit Euler mjINT_EULER = 0, // semi-implicit Euler
mjINT_RK4, // 4th-order Runge Kutta mjINT_RK4, // 4th-order Runge Kutta
mjINT_IMPLICIT, // implicit in velocity mjINT_IMPLICIT, // implicit in velocity
@@ -185,27 +185,27 @@ typedef enum mjtIntegrator_ { // integrator mode
} mjtIntegrator; } mjtIntegrator;
typedef enum mjtCone_ { // type of friction cone typedef enum mjtCone { // type of friction cone
mjCONE_PYRAMIDAL = 0, // pyramidal mjCONE_PYRAMIDAL = 0, // pyramidal
mjCONE_ELLIPTIC // elliptic mjCONE_ELLIPTIC // elliptic
} mjtCone; } mjtCone;
typedef enum mjtJacobian_ { // type of constraint Jacobian typedef enum mjtJacobian { // type of constraint Jacobian
mjJAC_DENSE = 0, // dense mjJAC_DENSE = 0, // dense
mjJAC_SPARSE, // sparse mjJAC_SPARSE, // sparse
mjJAC_AUTO // dense if nv<60, sparse otherwise mjJAC_AUTO // dense if nv<60, sparse otherwise
} mjtJacobian; } mjtJacobian;
typedef enum mjtSolver_ { // constraint solver algorithm typedef enum mjtSolver { // constraint solver algorithm
mjSOL_PGS = 0, // PGS (dual) mjSOL_PGS = 0, // PGS (dual)
mjSOL_CG, // CG (primal) mjSOL_CG, // CG (primal)
mjSOL_NEWTON // Newton (primal) mjSOL_NEWTON // Newton (primal)
} mjtSolver; } mjtSolver;
typedef enum mjtEq_ { // type of equality constraint typedef enum mjtEq { // type of equality constraint
mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint) mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint)
mjEQ_WELD, // fix relative position and orientation of two bodies mjEQ_WELD, // fix relative position and orientation of two bodies
mjEQ_JOINT, // couple the values of two scalar joints with cubic mjEQ_JOINT, // couple the values of two scalar joints with cubic
@@ -217,7 +217,7 @@ typedef enum mjtEq_ { // type of equality constraint
} mjtEq; } mjtEq;
typedef enum mjtWrap_ { // type of tendon wrap object typedef enum mjtWrap { // type of tendon wrap object
mjWRAP_NONE = 0, // null object mjWRAP_NONE = 0, // null object
mjWRAP_JOINT, // constant moment arm mjWRAP_JOINT, // constant moment arm
mjWRAP_PULLEY, // pulley used to split tendon mjWRAP_PULLEY, // pulley used to split tendon
@@ -227,7 +227,7 @@ typedef enum mjtWrap_ { // type of tendon wrap object
} mjtWrap; } mjtWrap;
typedef enum mjtTrn_ { // type of actuator transmission typedef enum mjtTrn { // type of actuator transmission
mjTRN_JOINT = 0, // force on joint mjTRN_JOINT = 0, // force on joint
mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame
mjTRN_SLIDERCRANK, // force via slider-crank linkage mjTRN_SLIDERCRANK, // force via slider-crank linkage
@@ -239,7 +239,7 @@ typedef enum mjtTrn_ { // type of actuator transmission
} mjtTrn; } mjtTrn;
typedef enum mjtDyn_ { // type of actuator dynamics typedef enum mjtDyn { // type of actuator dynamics
mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force
mjDYN_INTEGRATOR, // integrator: da/dt = u mjDYN_INTEGRATOR, // integrator: da/dt = u
mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau
@@ -250,7 +250,7 @@ typedef enum mjtDyn_ { // type of actuator dynamics
} mjtDyn; } mjtDyn;
typedef enum mjtGain_ { // type of actuator gain typedef enum mjtGain { // type of actuator gain
mjGAIN_FIXED = 0, // fixed gain mjGAIN_FIXED = 0, // fixed gain
mjGAIN_AFFINE, // const + kp*length + kv*velocity mjGAIN_AFFINE, // const + kp*length + kv*velocity
mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain() mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain()
@@ -259,7 +259,7 @@ typedef enum mjtGain_ { // type of actuator gain
} mjtGain; } mjtGain;
typedef enum mjtBias_ { // type of actuator bias typedef enum mjtBias { // type of actuator bias
mjBIAS_NONE = 0, // no bias mjBIAS_NONE = 0, // no bias
mjBIAS_AFFINE, // const + kp*length + kv*velocity mjBIAS_AFFINE, // const + kp*length + kv*velocity
mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias() mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias()
@@ -268,7 +268,7 @@ typedef enum mjtBias_ { // type of actuator bias
} mjtBias; } mjtBias;
typedef enum mjtObj_ { // type of MujoCo object typedef enum mjtObj { // type of MujoCo object
mjOBJ_UNKNOWN = 0, // unknown object type mjOBJ_UNKNOWN = 0, // unknown object type
mjOBJ_BODY, // body mjOBJ_BODY, // body
mjOBJ_XBODY, // body, used to access regular frame instead of i-frame mjOBJ_XBODY, // body, used to access regular frame instead of i-frame
@@ -305,7 +305,7 @@ typedef enum mjtObj_ { // type of MujoCo object
} mjtObj; } mjtObj;
typedef enum mjtSensor_ { // type of sensor typedef enum mjtSensor { // type of sensor
// common robotic sensors, attached to a site // common robotic sensors, attached to a site
mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone
mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame
@@ -381,7 +381,7 @@ typedef enum mjtSensor_ { // type of sensor
} mjtSensor; } mjtSensor;
typedef enum mjtStage_ { // computation stage typedef enum mjtStage { // computation stage
mjSTAGE_NONE = 0, // no computations mjSTAGE_NONE = 0, // no computations
mjSTAGE_POS, // position-dependent computations mjSTAGE_POS, // position-dependent computations
mjSTAGE_VEL, // velocity-dependent computations mjSTAGE_VEL, // velocity-dependent computations
@@ -389,7 +389,7 @@ typedef enum mjtStage_ { // computation stage
} mjtStage; } mjtStage;
typedef enum mjtDataType_ { // data type for sensors typedef enum mjtDataType { // data type for sensors
mjDATATYPE_REAL = 0, // real values, no constraints mjDATATYPE_REAL = 0, // real values, no constraints
mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive
mjDATATYPE_AXIS, // 3D unit vector mjDATATYPE_AXIS, // 3D unit vector
@@ -397,7 +397,7 @@ typedef enum mjtDataType_ { // data type for sensors
} mjtDataType; } mjtDataType;
typedef enum mjtConDataField_ { // data fields returned by contact sensors typedef enum mjtConDataField { // data fields returned by contact sensors
mjCONDATA_FOUND = 0, // whether a contact was found mjCONDATA_FOUND = 0, // whether a contact was found
mjCONDATA_FORCE, // contact force mjCONDATA_FORCE, // contact force
mjCONDATA_TORQUE, // contact torque mjCONDATA_TORQUE, // contact torque
@@ -410,7 +410,7 @@ typedef enum mjtConDataField_ { // data fields returned by contact sensors
} mjtConDataField; } mjtConDataField;
typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors typedef enum mjtRayDataField { // data fields returned by rangefinder sensors
mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface
mjRAYDATA_DIR, // normalized ray direction mjRAYDATA_DIR, // normalized ray direction
mjRAYDATA_ORIGIN, // ray origin mjRAYDATA_ORIGIN, // ray origin
@@ -422,7 +422,7 @@ typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors
} mjtRayDataField; } mjtRayDataField;
typedef enum mjtCamOutBit_ { // camera output type bitflags typedef enum mjtCamOutBit { // camera output type bitflags
mjCAMOUT_RGB = 1<<0, // RGB image mjCAMOUT_RGB = 1<<0, // RGB image
mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane) mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane)
mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin) mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin)
@@ -433,7 +433,7 @@ typedef enum mjtCamOutBit_ { // camera output type bitflags
} mjtCamOutBit; } mjtCamOutBit;
typedef enum mjtSameFrame_ { // frame alignment of bodies with their children typedef enum mjtSameFrame { // frame alignment of bodies with their children
mjSAMEFRAME_NONE = 0, // no alignment mjSAMEFRAME_NONE = 0, // no alignment
mjSAMEFRAME_BODY, // frame is same as body frame mjSAMEFRAME_BODY, // frame is same as body frame
mjSAMEFRAME_INERTIA, // frame is same as inertial frame mjSAMEFRAME_INERTIA, // frame is same as inertial frame
@@ -442,7 +442,7 @@ typedef enum mjtSameFrame_ { // frame alignment of bodies with their childr
} mjtSameFrame; } mjtSameFrame;
typedef enum mjtSleepPolicy_ { // per-tree sleep policy typedef enum mjtSleepPolicy { // per-tree sleep policy
mjSLEEP_AUTO = 0, // compiler chooses sleep policy mjSLEEP_AUTO = 0, // compiler chooses sleep policy
mjSLEEP_AUTO_NEVER, // compiler sleep policy: never mjSLEEP_AUTO_NEVER, // compiler sleep policy: never
mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed
@@ -452,7 +452,7 @@ typedef enum mjtSleepPolicy_ { // per-tree sleep policy
} mjtSleepPolicy; } mjtSleepPolicy;
typedef enum mjtLRMode_ { // mode for actuator length range computation typedef enum mjtLRMode { // mode for actuator length range computation
mjLRMODE_NONE = 0, // do not process any actuators mjLRMODE_NONE = 0, // do not process any actuators
mjLRMODE_MUSCLE, // process muscle actuators mjLRMODE_MUSCLE, // process muscle actuators
mjLRMODE_MUSCLEUSER, // process muscle and user actuators mjLRMODE_MUSCLEUSER, // process muscle and user actuators
@@ -460,7 +460,7 @@ typedef enum mjtLRMode_ { // mode for actuator length range computation
} mjtLRMode; } mjtLRMode;
typedef enum mjtFlexSelf_ { // mode for flex selfcollide typedef enum mjtFlexSelf { // mode for flex selfcollide
mjFLEXSELF_NONE = 0, // no self-collisions mjFLEXSELF_NONE = 0, // no self-collisions
mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase
mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled) mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled)
@@ -469,7 +469,7 @@ typedef enum mjtFlexSelf_ { // mode for flex selfcollide
} mjtFlexSelf; } mjtFlexSelf;
typedef enum mjtSDFType_ { // signed distance function (SDF) type typedef enum mjtSDFType { // signed distance function (SDF) type
mjSDFTYPE_SINGLE = 0, // single SDF mjSDFTYPE_SINGLE = 0, // single SDF
mjSDFTYPE_INTERSECTION, // max(A, B) mjSDFTYPE_INTERSECTION, // max(A, B)
mjSDFTYPE_MIDSURFACE, // A - B mjSDFTYPE_MIDSURFACE, // A - B
@@ -480,7 +480,7 @@ typedef enum mjtSDFType_ { // signed distance function (SDF) type
//---------------------------------- enum types (mjData) ------------------------------------------- //---------------------------------- enum types (mjData) -------------------------------------------
typedef enum mjtState_ { // state elements typedef enum mjtState { // state elements
mjSTATE_TIME = 1<<0, // time mjSTATE_TIME = 1<<0, // time
mjSTATE_QPOS = 1<<1, // position mjSTATE_QPOS = 1<<1, // position
mjSTATE_QVEL = 1<<2, // velocity mjSTATE_QVEL = 1<<2, // velocity
@@ -508,7 +508,7 @@ typedef enum mjtState_ { // state elements
} mjtState; } mjtState;
typedef enum mjtConstraint_ { // type of constraint typedef enum mjtConstraint { // type of constraint
mjCNSTR_EQUALITY = 0, // equality constraint mjCNSTR_EQUALITY = 0, // equality constraint
mjCNSTR_FRICTION_DOF, // dof friction mjCNSTR_FRICTION_DOF, // dof friction
mjCNSTR_FRICTION_TENDON, // tendon friction mjCNSTR_FRICTION_TENDON, // tendon friction
@@ -520,7 +520,7 @@ typedef enum mjtConstraint_ { // type of constraint
} mjtConstraint; } mjtConstraint;
typedef enum mjtConstraintState_ { // constraint state typedef enum mjtConstraintState { // constraint state
mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact) mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact)
mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact) mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact)
mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction) mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction)
@@ -529,7 +529,7 @@ typedef enum mjtConstraintState_ { // constraint state
} mjtConstraintState; } mjtConstraintState;
typedef enum mjtWarning_ { // warning types typedef enum mjtWarning { // warning types
mjWARN_INERTIA = 0, // (near) singular inertia matrix mjWARN_INERTIA = 0, // (near) singular inertia matrix
mjWARN_CONTACTFULL, // too many contacts in contact list mjWARN_CONTACTFULL, // too many contacts in contact list
mjWARN_CNSTRFULL, // too many constraints mjWARN_CNSTRFULL, // too many constraints
@@ -542,7 +542,7 @@ typedef enum mjtWarning_ { // warning types
} mjtWarning; } mjtWarning;
typedef enum mjtTimer_ { // internal timers typedef enum mjtTimer { // internal timers
// main api // main api
mjTIMER_STEP = 0, // step mjTIMER_STEP = 0, // step
mjTIMER_FORWARD, // forward mjTIMER_FORWARD, // forward
@@ -570,7 +570,7 @@ typedef enum mjtTimer_ { // internal timers
} mjtTimer; } mjtTimer;
typedef enum mjtSleepState_ { // sleep state of an object typedef enum mjtSleepState { // sleep state of an object
mjS_STATIC = -1, // object is static mjS_STATIC = -1, // object is static
mjS_ASLEEP = 0, // object is asleep mjS_ASLEEP = 0, // object is asleep
mjS_AWAKE = 1 // object is awake mjS_AWAKE = 1 // object is awake
@@ -580,14 +580,14 @@ typedef enum mjtSleepState_ { // sleep state of an object
//---------------------------------- logging ------------------------------------------------------- //---------------------------------- logging -------------------------------------------------------
typedef enum mjtLogLevel_ { // log message severity typedef enum mjtLogLevel { // log message severity
mjLOG_DEBUG = 0, // internal engine debug trace (opt-in via topic filtering) mjLOG_DEBUG = 0, // internal engine debug trace (opt-in via topic filtering)
mjLOG_INFO, // informational (opt-in via topic filtering) mjLOG_INFO, // informational (opt-in via topic filtering)
mjLOG_WARNING, // warning mjLOG_WARNING, // warning
mjLOG_ERROR, // error mjLOG_ERROR, // error
} mjtLogLevel; } mjtLogLevel;
typedef enum mjtLogTopic_ { // log topic identifiers typedef enum mjtLogTopic { // log topic identifiers
mjTOPIC_NONE = 0, // no topic (always passes filtering) mjTOPIC_NONE = 0, // no topic (always passes filtering)
// INFO topics: // INFO topics:
mjTOPIC_TIME_STP = 1, // timing diagnostics (step) mjTOPIC_TIME_STP = 1, // timing diagnostics (step)
+31 -38
View File
@@ -62,7 +62,7 @@
//---------------------------------- primitive types (mjt) ----------------------------------------- //---------------------------------- primitive types (mjt) -----------------------------------------
typedef enum mjtButton_ { // mouse button typedef enum mjtButton { // mouse button
mjBUTTON_NONE = 0, // no button mjBUTTON_NONE = 0, // no button
mjBUTTON_LEFT, // left button mjBUTTON_LEFT, // left button
mjBUTTON_RIGHT, // right button mjBUTTON_RIGHT, // right button
@@ -70,7 +70,7 @@ typedef enum mjtButton_ { // mouse button
} mjtButton; } mjtButton;
typedef enum mjtEvent_ { // mouse and keyboard event type typedef enum mjtEvent { // mouse and keyboard event type
mjEVENT_NONE = 0, // no event mjEVENT_NONE = 0, // no event
mjEVENT_MOVE, // mouse move mjEVENT_MOVE, // mouse move
mjEVENT_PRESS, // mouse button press mjEVENT_PRESS, // mouse button press
@@ -83,7 +83,7 @@ typedef enum mjtEvent_ { // mouse and keyboard event type
} mjtEvent; } mjtEvent;
typedef enum mjtItem_ { // UI item type typedef enum mjtItem { // UI item type
mjITEM_END = -2, // end of definition list (not an item) mjITEM_END = -2, // end of definition list (not an item)
mjITEM_SECTION = -1, // section (not an item) mjITEM_SECTION = -1, // section (not an item)
mjITEM_SEPARATOR = 0, // separator mjITEM_SEPARATOR = 0, // separator
@@ -107,7 +107,7 @@ typedef enum mjtItem_ { // UI item type
} mjtItem; } mjtItem;
typedef enum mjtSection_ { // UI section state typedef enum mjtSection { // UI section state
mjSECT_CLOSED = 0, // closed state (regular section) mjSECT_CLOSED = 0, // closed state (regular section)
mjSECT_OPEN, // open state (regular section) mjSECT_OPEN, // open state (regular section)
mjSECT_FIXED // fixed section: always open, no title mjSECT_FIXED // fixed section: always open, no title
@@ -120,7 +120,7 @@ typedef int (*mjfItemEnable)(int category, void* data);
//---------------------------------- mjuiState ----------------------------------------------------- //---------------------------------- mjuiState -----------------------------------------------------
struct mjuiState_ { // mouse and keyboard state typedef struct mjuiState_ { // mouse and keyboard state
// constants set by user // constants set by user
int nrect; // number of rectangles used int nrect; // number of rectangles used
mjrRect rect[mjMAXUIRECT]; // rectangles (index 0: entire window) mjrRect rect[mjMAXUIRECT]; // rectangles (index 0: entire window)
@@ -160,33 +160,31 @@ struct mjuiState_ { // mouse and keyboard state
// files dropping (only valid when type == mjEVENT_FILESDROP) // files dropping (only valid when type == mjEVENT_FILESDROP)
int dropcount; // number of files dropped int dropcount; // number of files dropped
const char** droppaths; // paths to files dropped const char** droppaths; // paths to files dropped
}; } mjuiState;
typedef struct mjuiState_ mjuiState;
//---------------------------------- mjuiThemeSpacing ---------------------------------------------- //---------------------------------- mjuiThemeSpacing ----------------------------------------------
struct mjuiThemeSpacing_ { // UI visualization theme spacing typedef struct mjuiThemeSpacing_ { // UI visualization theme spacing
int total; // total width int total; // total width
int scroll; // scrollbar width int scroll; // scrollbar width
int label; // label width int label; // label width
int section; // section gap int section; // section gap
int cornersect; // corner radius for section int cornersect; // corner radius for section
int cornersep; // corner radius for separator int cornersep; // corner radius for separator
int itemside; // item side gap int itemside; // item side gap
int itemmid; // item middle gap int itemmid; // item middle gap
int itemver; // item vertical gap int itemver; // item vertical gap
int texthor; // text horizontal gap int texthor; // text horizontal gap
int textver; // text vertical gap int textver; // text vertical gap
int linescroll; // number of pixels to scroll int linescroll; // number of pixels to scroll
int samples; // number of multisamples int samples; // number of multisamples
}; } mjuiThemeSpacing;
typedef struct mjuiThemeSpacing_ mjuiThemeSpacing;
//---------------------------------- mjuiThemeColor ------------------------------------------------ //---------------------------------- mjuiThemeColor ------------------------------------------------
struct mjuiThemeColor_ { // UI visualization theme color typedef struct mjuiThemeColor_ { // UI visualization theme color
float master[3]; // master background float master[3]; // master background
float thumb[3]; // scrollbar thumb float thumb[3]; // scrollbar thumb
float secttitle[3]; // section title float secttitle[3]; // section title
@@ -215,8 +213,7 @@ struct mjuiThemeColor_ { // UI visualization theme color
float edit[3]; // edit float edit[3]; // edit
float edit2[3]; // edit invalid float edit2[3]; // edit invalid
float cursor[3]; // edit cursor float cursor[3]; // edit cursor
}; } mjuiThemeColor;
typedef struct mjuiThemeColor_ mjuiThemeColor;
//---------------------------------- mjuiItem ------------------------------------------------------ //---------------------------------- mjuiItem ------------------------------------------------------
@@ -245,7 +242,7 @@ struct mjuiItemEdit_ { // edit-related
}; };
struct mjuiItem_ { // UI item typedef struct mjuiItem_ { // UI item
// common properties // common properties
int type; // type (mjtItem) int type; // type (mjtItem)
char name[mjMAXUINAME]; // name char name[mjMAXUINAME]; // name
@@ -266,13 +263,12 @@ struct mjuiItem_ { // UI item
// internal // internal
mjrRect rect; // rectangle occupied by item mjrRect rect; // rectangle occupied by item
int skip; // item skipped due to closed separator int skip; // item skipped due to closed separator
}; } mjuiItem;
typedef struct mjuiItem_ mjuiItem;
//---------------------------------- mjuiSection --------------------------------------------------- //---------------------------------- mjuiSection ---------------------------------------------------
struct mjuiSection_ { // UI section typedef struct mjuiSection_ { // UI section
// properties // properties
char name[mjMAXUINAME]; // name char name[mjMAXUINAME]; // name
int state; // section state (mjtSection) int state; // section state (mjtSection)
@@ -286,13 +282,12 @@ struct mjuiSection_ { // UI section
mjrRect rtitle; // rectangle occupied by title mjrRect rtitle; // rectangle occupied by title
mjrRect rcontent; // rectangle occupied by content mjrRect rcontent; // rectangle occupied by content
int lastclick; // last mouse click over this section int lastclick; // last mouse click over this section
}; } mjuiSection;
typedef struct mjuiSection_ mjuiSection;
//---------------------------------- mjUI ---------------------------------------------------------- //---------------------------------- mjUI ----------------------------------------------------------
struct mjUI_ { // entire UI typedef struct mjUI_ { // entire UI
// constants set by user // constants set by user
mjuiThemeSpacing spacing; // UI theme spacing mjuiThemeSpacing spacing; // UI theme spacing
mjuiThemeColor color; // UI theme color mjuiThemeColor color; // UI theme color
@@ -326,20 +321,18 @@ struct mjUI_ { // entire UI
// sections // sections
int nsect; // number of sections in use int nsect; // number of sections in use
mjuiSection sect[mjMAXUISECT]; // preallocated array of sections mjuiSection sect[mjMAXUISECT]; // preallocated array of sections
}; } mjUI;
typedef struct mjUI_ mjUI;
//---------------------------------- mjuiDef ------------------------------------------------------- //---------------------------------- mjuiDef -------------------------------------------------------
struct mjuiDef_ { // table passed to mjui_add() typedef struct mjuiDef_ { // table passed to mjui_add()
int type; // type (mjtItem); -1: section int type; // type (mjtItem); -1: section
char name[mjMAXUINAME]; // name char name[mjMAXUINAME]; // name
int state; // state int state; // state
void* pdata; // pointer to data void* pdata; // pointer to data
char other[mjMAXUITEXT]; // string with type-specific properties char other[mjMAXUITEXT]; // string with type-specific properties
int otherint; // int with type-specific properties int otherint; // int with type-specific properties
}; } mjuiDef;
typedef struct mjuiDef_ mjuiDef;
#endif // MUJOCO_MJUI_H_ #endif // MUJOCO_MJUI_H_
+16 -24
View File
@@ -164,7 +164,7 @@ typedef enum mjtStereo_ { // type of stereo rendering
//---------------------------------- mjvPerturb ---------------------------------------------------- //---------------------------------- mjvPerturb ----------------------------------------------------
struct mjvPerturb_ { // object selection and perturbation typedef struct mjvPerturb_ { // object selection and perturbation
int select; // selected body id; non-positive: none int select; // selected body id; non-positive: none
int flexselect; // selected flex id; negative: none int flexselect; // selected flex id; negative: none
int skinselect; // selected skin id; negative: none int skinselect; // selected skin id; negative: none
@@ -176,13 +176,12 @@ struct mjvPerturb_ { // object selection and perturbation
mjtNum localpos[3]; // selection point in object coordinates mjtNum localpos[3]; // selection point in object coordinates
mjtNum localmass; // spatial inertia at selection point mjtNum localmass; // spatial inertia at selection point
mjtNum scale; // relative mouse motion-to-space scaling (set by initPerturb) mjtNum scale; // relative mouse motion-to-space scaling (set by initPerturb)
}; } mjvPerturb;
typedef struct mjvPerturb_ mjvPerturb;
//---------------------------------- mjvCamera ----------------------------------------------------- //---------------------------------- mjvCamera -----------------------------------------------------
struct mjvCamera_ { // abstract camera typedef struct mjvCamera_ { // abstract camera
// type and ids // type and ids
int type; // camera type (mjtCamera) int type; // camera type (mjtCamera)
int fixedcamid; // fixed camera id int fixedcamid; // fixed camera id
@@ -196,13 +195,12 @@ struct mjvCamera_ { // abstract camera
// orthographic / perspective // orthographic / perspective
int orthographic; // 0: perspective; 1: orthographic int orthographic; // 0: perspective; 1: orthographic
}; } mjvCamera;
typedef struct mjvCamera_ mjvCamera;
//---------------------------------- mjvGLCamera --------------------------------------------------- //---------------------------------- mjvGLCamera ---------------------------------------------------
struct mjvGLCamera_ { // OpenGL camera typedef struct mjvGLCamera_ { // OpenGL camera
// camera frame // camera frame
float pos[3]; // position float pos[3]; // position
float forward[3]; // forward direction float forward[3]; // forward direction
@@ -218,13 +216,12 @@ struct mjvGLCamera_ { // OpenGL camera
// orthographic / perspective // orthographic / perspective
int orthographic; // 0: perspective; 1: orthographic int orthographic; // 0: perspective; 1: orthographic
}; } mjvGLCamera;
typedef struct mjvGLCamera_ mjvGLCamera;
//---------------------------------- mjvGeom ------------------------------------------------------- //---------------------------------- mjvGeom -------------------------------------------------------
struct mjvGeom_ { // abstract geom typedef struct mjvGeom_ { // abstract geom
// type info // type info
int type; // geom type (mjtGeom) int type; // geom type (mjtGeom)
int dataid; // mesh, hfield or plane id; -1: none; mesh: 2*id or 2*id+1 (hull) int dataid; // mesh, hfield or plane id; -1: none; mesh: 2*id or 2*id+1 (hull)
@@ -253,13 +250,12 @@ struct mjvGeom_ { // abstract geom
float camdist; // distance to camera (used by sorter) float camdist; // distance to camera (used by sorter)
float modelrbound; // geom rbound from model, 0 if not model geom float modelrbound; // geom rbound from model, 0 if not model geom
mjtByte transparent; // treat geom as transparent mjtByte transparent; // treat geom as transparent
}; } mjvGeom;
typedef struct mjvGeom_ mjvGeom;
//---------------------------------- mjvLight ------------------------------------------------------ //---------------------------------- mjvLight ------------------------------------------------------
struct mjvLight_ { // OpenGL light typedef struct mjvLight_ { // OpenGL light
int id; // light id, -1 for headlight int id; // light id, -1 for headlight
float pos[3]; // position rel. to body frame float pos[3]; // position rel. to body frame
float dir[3]; // direction rel. to body frame float dir[3]; // direction rel. to body frame
@@ -276,13 +272,12 @@ struct mjvLight_ { // OpenGL light
float bulbradius; // bulb radius for soft shadows float bulbradius; // bulb radius for soft shadows
float intensity; // intensity, in candelas float intensity; // intensity, in candelas
float range; // range of effectiveness float range; // range of effectiveness
}; } mjvLight;
typedef struct mjvLight_ mjvLight;
//---------------------------------- mjvOption ----------------------------------------------------- //---------------------------------- mjvOption -----------------------------------------------------
struct mjvOption_ { // abstract visualization options typedef struct mjvOption_ { // abstract visualization options
int label; // what objects to label (mjtLabel) int label; // what objects to label (mjtLabel)
int frame; // which frame to show (mjtFrame) int frame; // which frame to show (mjtFrame)
mjtByte geomgroup[mjNGROUP]; // geom visualization by group mjtByte geomgroup[mjNGROUP]; // geom visualization by group
@@ -295,13 +290,12 @@ struct mjvOption_ { // abstract visualization options
mjtByte flags[mjNVISFLAG]; // visualization flags (indexed by mjtVisFlag) mjtByte flags[mjNVISFLAG]; // visualization flags (indexed by mjtVisFlag)
int bvh_depth; // depth of the bounding volume hierarchy to be visualized int bvh_depth; // depth of the bounding volume hierarchy to be visualized
int flex_layer; // element layer to be visualized for 3D flex int flex_layer; // element layer to be visualized for 3D flex
}; } mjvOption;
typedef struct mjvOption_ mjvOption;
//---------------------------------- mjvScene ------------------------------------------------------ //---------------------------------- mjvScene ------------------------------------------------------
struct mjvScene_ { // abstract scene passed to OpenGL renderer typedef struct mjvScene_ { // abstract scene passed to OpenGL renderer
// abstract geoms // abstract geoms
int maxgeom; // size of allocated geom buffer int maxgeom; // size of allocated geom buffer
int ngeom; // number of geoms currently in buffer int ngeom; // number of geoms currently in buffer
@@ -358,13 +352,12 @@ struct mjvScene_ { // abstract scene passed to OpenGL renderer
// geom buffer status // geom buffer status
int status; // 0: ok, 1: geoms exhausted, warning issued int status; // 0: ok, 1: geoms exhausted, warning issued
}; } mjvScene;
typedef struct mjvScene_ mjvScene;
//---------------------------------- mjvFigure ----------------------------------------------------- //---------------------------------- mjvFigure -----------------------------------------------------
struct mjvFigure_ { // abstract 2D figure passed to OpenGL renderer typedef struct mjvFigure_ { // abstract 2D figure passed to OpenGL renderer
// enable flags // enable flags
int flg_legend; // show legend int flg_legend; // show legend
int flg_ticklabel[2]; // show grid tick labels (x,y) int flg_ticklabel[2]; // show grid tick labels (x,y)
@@ -409,7 +402,6 @@ struct mjvFigure_ { // abstract 2D figure passed to OpenGL rendere
int yaxispixel[2]; // range of y-axis in pixels int yaxispixel[2]; // range of y-axis in pixels
float xaxisdata[2]; // range of x-axis in data units float xaxisdata[2]; // range of x-axis in data units
float yaxisdata[2]; // range of y-axis in data units float yaxisdata[2]; // range of y-axis in data units
}; } mjvFigure;
typedef struct mjvFigure_ mjvFigure;
#endif // MUJOCO_MJVISUALIZE_H_ #endif // MUJOCO_MJVISUALIZE_H_
+55 -55
View File
@@ -25,7 +25,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtDisableBit', ('mjtDisableBit',
EnumDecl( EnumDecl(
name='mjtDisableBit', name='mjtDisableBit',
declname='enum mjtDisableBit_', declname='enum mjtDisableBit',
values=dict([ values=dict([
('mjDSBL_CONSTRAINT', 1), ('mjDSBL_CONSTRAINT', 1),
('mjDSBL_EQUALITY', 2), ('mjDSBL_EQUALITY', 2),
@@ -53,7 +53,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtEnableBit', ('mjtEnableBit',
EnumDecl( EnumDecl(
name='mjtEnableBit', name='mjtEnableBit',
declname='enum mjtEnableBit_', declname='enum mjtEnableBit',
values=dict([ values=dict([
('mjENBL_OVERRIDE', 1), ('mjENBL_OVERRIDE', 1),
('mjENBL_ENERGY', 2), ('mjENBL_ENERGY', 2),
@@ -67,7 +67,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtJoint', ('mjtJoint',
EnumDecl( EnumDecl(
name='mjtJoint', name='mjtJoint',
declname='enum mjtJoint_', declname='enum mjtJoint',
values=dict([ values=dict([
('mjJNT_FREE', 0), ('mjJNT_FREE', 0),
('mjJNT_BALL', 1), ('mjJNT_BALL', 1),
@@ -78,7 +78,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtGeom', ('mjtGeom',
EnumDecl( EnumDecl(
name='mjtGeom', name='mjtGeom',
declname='enum mjtGeom_', declname='enum mjtGeom',
values=dict([ values=dict([
('mjGEOM_PLANE', 0), ('mjGEOM_PLANE', 0),
('mjGEOM_HFIELD', 1), ('mjGEOM_HFIELD', 1),
@@ -105,7 +105,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtProjection', ('mjtProjection',
EnumDecl( EnumDecl(
name='mjtProjection', name='mjtProjection',
declname='enum mjtProjection_', declname='enum mjtProjection',
values=dict([ values=dict([
('mjPROJ_PERSPECTIVE', 0), ('mjPROJ_PERSPECTIVE', 0),
('mjPROJ_ORTHOGRAPHIC', 1), ('mjPROJ_ORTHOGRAPHIC', 1),
@@ -114,7 +114,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtCamLight', ('mjtCamLight',
EnumDecl( EnumDecl(
name='mjtCamLight', name='mjtCamLight',
declname='enum mjtCamLight_', declname='enum mjtCamLight',
values=dict([ values=dict([
('mjCAMLIGHT_FIXED', 0), ('mjCAMLIGHT_FIXED', 0),
('mjCAMLIGHT_TRACK', 1), ('mjCAMLIGHT_TRACK', 1),
@@ -126,7 +126,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtLightType', ('mjtLightType',
EnumDecl( EnumDecl(
name='mjtLightType', name='mjtLightType',
declname='enum mjtLightType_', declname='enum mjtLightType',
values=dict([ values=dict([
('mjLIGHT_SPOT', 0), ('mjLIGHT_SPOT', 0),
('mjLIGHT_DIRECTIONAL', 1), ('mjLIGHT_DIRECTIONAL', 1),
@@ -137,7 +137,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtTexture', ('mjtTexture',
EnumDecl( EnumDecl(
name='mjtTexture', name='mjtTexture',
declname='enum mjtTexture_', declname='enum mjtTexture',
values=dict([ values=dict([
('mjTEXTURE_2D', 0), ('mjTEXTURE_2D', 0),
('mjTEXTURE_CUBE', 1), ('mjTEXTURE_CUBE', 1),
@@ -147,7 +147,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtTextureRole', ('mjtTextureRole',
EnumDecl( EnumDecl(
name='mjtTextureRole', name='mjtTextureRole',
declname='enum mjtTextureRole_', declname='enum mjtTextureRole',
values=dict([ values=dict([
('mjTEXROLE_USER', 0), ('mjTEXROLE_USER', 0),
('mjTEXROLE_RGB', 1), ('mjTEXROLE_RGB', 1),
@@ -165,7 +165,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtColorSpace', ('mjtColorSpace',
EnumDecl( EnumDecl(
name='mjtColorSpace', name='mjtColorSpace',
declname='enum mjtColorSpace_', declname='enum mjtColorSpace',
values=dict([ values=dict([
('mjCOLORSPACE_AUTO', 0), ('mjCOLORSPACE_AUTO', 0),
('mjCOLORSPACE_LINEAR', 1), ('mjCOLORSPACE_LINEAR', 1),
@@ -175,7 +175,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtIntegrator', ('mjtIntegrator',
EnumDecl( EnumDecl(
name='mjtIntegrator', name='mjtIntegrator',
declname='enum mjtIntegrator_', declname='enum mjtIntegrator',
values=dict([ values=dict([
('mjINT_EULER', 0), ('mjINT_EULER', 0),
('mjINT_RK4', 1), ('mjINT_RK4', 1),
@@ -186,7 +186,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtCone', ('mjtCone',
EnumDecl( EnumDecl(
name='mjtCone', name='mjtCone',
declname='enum mjtCone_', declname='enum mjtCone',
values=dict([ values=dict([
('mjCONE_PYRAMIDAL', 0), ('mjCONE_PYRAMIDAL', 0),
('mjCONE_ELLIPTIC', 1), ('mjCONE_ELLIPTIC', 1),
@@ -195,7 +195,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtJacobian', ('mjtJacobian',
EnumDecl( EnumDecl(
name='mjtJacobian', name='mjtJacobian',
declname='enum mjtJacobian_', declname='enum mjtJacobian',
values=dict([ values=dict([
('mjJAC_DENSE', 0), ('mjJAC_DENSE', 0),
('mjJAC_SPARSE', 1), ('mjJAC_SPARSE', 1),
@@ -205,7 +205,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtSolver', ('mjtSolver',
EnumDecl( EnumDecl(
name='mjtSolver', name='mjtSolver',
declname='enum mjtSolver_', declname='enum mjtSolver',
values=dict([ values=dict([
('mjSOL_PGS', 0), ('mjSOL_PGS', 0),
('mjSOL_CG', 1), ('mjSOL_CG', 1),
@@ -215,7 +215,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtEq', ('mjtEq',
EnumDecl( EnumDecl(
name='mjtEq', name='mjtEq',
declname='enum mjtEq_', declname='enum mjtEq',
values=dict([ values=dict([
('mjEQ_CONNECT', 0), ('mjEQ_CONNECT', 0),
('mjEQ_WELD', 1), ('mjEQ_WELD', 1),
@@ -230,7 +230,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtWrap', ('mjtWrap',
EnumDecl( EnumDecl(
name='mjtWrap', name='mjtWrap',
declname='enum mjtWrap_', declname='enum mjtWrap',
values=dict([ values=dict([
('mjWRAP_NONE', 0), ('mjWRAP_NONE', 0),
('mjWRAP_JOINT', 1), ('mjWRAP_JOINT', 1),
@@ -243,7 +243,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtTrn', ('mjtTrn',
EnumDecl( EnumDecl(
name='mjtTrn', name='mjtTrn',
declname='enum mjtTrn_', declname='enum mjtTrn',
values=dict([ values=dict([
('mjTRN_JOINT', 0), ('mjTRN_JOINT', 0),
('mjTRN_JOINTINPARENT', 1), ('mjTRN_JOINTINPARENT', 1),
@@ -257,7 +257,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtDyn', ('mjtDyn',
EnumDecl( EnumDecl(
name='mjtDyn', name='mjtDyn',
declname='enum mjtDyn_', declname='enum mjtDyn',
values=dict([ values=dict([
('mjDYN_NONE', 0), ('mjDYN_NONE', 0),
('mjDYN_INTEGRATOR', 1), ('mjDYN_INTEGRATOR', 1),
@@ -271,7 +271,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtGain', ('mjtGain',
EnumDecl( EnumDecl(
name='mjtGain', name='mjtGain',
declname='enum mjtGain_', declname='enum mjtGain',
values=dict([ values=dict([
('mjGAIN_FIXED', 0), ('mjGAIN_FIXED', 0),
('mjGAIN_AFFINE', 1), ('mjGAIN_AFFINE', 1),
@@ -283,7 +283,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtBias', ('mjtBias',
EnumDecl( EnumDecl(
name='mjtBias', name='mjtBias',
declname='enum mjtBias_', declname='enum mjtBias',
values=dict([ values=dict([
('mjBIAS_NONE', 0), ('mjBIAS_NONE', 0),
('mjBIAS_AFFINE', 1), ('mjBIAS_AFFINE', 1),
@@ -295,7 +295,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtObj', ('mjtObj',
EnumDecl( EnumDecl(
name='mjtObj', name='mjtObj',
declname='enum mjtObj_', declname='enum mjtObj',
values=dict([ values=dict([
('mjOBJ_UNKNOWN', 0), ('mjOBJ_UNKNOWN', 0),
('mjOBJ_BODY', 1), ('mjOBJ_BODY', 1),
@@ -332,7 +332,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtSensor', ('mjtSensor',
EnumDecl( EnumDecl(
name='mjtSensor', name='mjtSensor',
declname='enum mjtSensor_', declname='enum mjtSensor',
values=dict([ values=dict([
('mjSENS_TOUCH', 0), ('mjSENS_TOUCH', 0),
('mjSENS_ACCELEROMETER', 1), ('mjSENS_ACCELEROMETER', 1),
@@ -388,7 +388,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtStage', ('mjtStage',
EnumDecl( EnumDecl(
name='mjtStage', name='mjtStage',
declname='enum mjtStage_', declname='enum mjtStage',
values=dict([ values=dict([
('mjSTAGE_NONE', 0), ('mjSTAGE_NONE', 0),
('mjSTAGE_POS', 1), ('mjSTAGE_POS', 1),
@@ -399,7 +399,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtDataType', ('mjtDataType',
EnumDecl( EnumDecl(
name='mjtDataType', name='mjtDataType',
declname='enum mjtDataType_', declname='enum mjtDataType',
values=dict([ values=dict([
('mjDATATYPE_REAL', 0), ('mjDATATYPE_REAL', 0),
('mjDATATYPE_POSITIVE', 1), ('mjDATATYPE_POSITIVE', 1),
@@ -410,7 +410,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtConDataField', ('mjtConDataField',
EnumDecl( EnumDecl(
name='mjtConDataField', name='mjtConDataField',
declname='enum mjtConDataField_', declname='enum mjtConDataField',
values=dict([ values=dict([
('mjCONDATA_FOUND', 0), ('mjCONDATA_FOUND', 0),
('mjCONDATA_FORCE', 1), ('mjCONDATA_FORCE', 1),
@@ -425,7 +425,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtRayDataField', ('mjtRayDataField',
EnumDecl( EnumDecl(
name='mjtRayDataField', name='mjtRayDataField',
declname='enum mjtRayDataField_', declname='enum mjtRayDataField',
values=dict([ values=dict([
('mjRAYDATA_DIST', 0), ('mjRAYDATA_DIST', 0),
('mjRAYDATA_DIR', 1), ('mjRAYDATA_DIR', 1),
@@ -439,7 +439,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtCamOutBit', ('mjtCamOutBit',
EnumDecl( EnumDecl(
name='mjtCamOutBit', name='mjtCamOutBit',
declname='enum mjtCamOutBit_', declname='enum mjtCamOutBit',
values=dict([ values=dict([
('mjCAMOUT_RGB', 1), ('mjCAMOUT_RGB', 1),
('mjCAMOUT_DEPTH', 2), ('mjCAMOUT_DEPTH', 2),
@@ -452,7 +452,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtSameFrame', ('mjtSameFrame',
EnumDecl( EnumDecl(
name='mjtSameFrame', name='mjtSameFrame',
declname='enum mjtSameFrame_', declname='enum mjtSameFrame',
values=dict([ values=dict([
('mjSAMEFRAME_NONE', 0), ('mjSAMEFRAME_NONE', 0),
('mjSAMEFRAME_BODY', 1), ('mjSAMEFRAME_BODY', 1),
@@ -464,7 +464,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtSleepPolicy', ('mjtSleepPolicy',
EnumDecl( EnumDecl(
name='mjtSleepPolicy', name='mjtSleepPolicy',
declname='enum mjtSleepPolicy_', declname='enum mjtSleepPolicy',
values=dict([ values=dict([
('mjSLEEP_AUTO', 0), ('mjSLEEP_AUTO', 0),
('mjSLEEP_AUTO_NEVER', 1), ('mjSLEEP_AUTO_NEVER', 1),
@@ -477,7 +477,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtLRMode', ('mjtLRMode',
EnumDecl( EnumDecl(
name='mjtLRMode', name='mjtLRMode',
declname='enum mjtLRMode_', declname='enum mjtLRMode',
values=dict([ values=dict([
('mjLRMODE_NONE', 0), ('mjLRMODE_NONE', 0),
('mjLRMODE_MUSCLE', 1), ('mjLRMODE_MUSCLE', 1),
@@ -488,7 +488,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtFlexSelf', ('mjtFlexSelf',
EnumDecl( EnumDecl(
name='mjtFlexSelf', name='mjtFlexSelf',
declname='enum mjtFlexSelf_', declname='enum mjtFlexSelf',
values=dict([ values=dict([
('mjFLEXSELF_NONE', 0), ('mjFLEXSELF_NONE', 0),
('mjFLEXSELF_NARROW', 1), ('mjFLEXSELF_NARROW', 1),
@@ -500,7 +500,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtSDFType', ('mjtSDFType',
EnumDecl( EnumDecl(
name='mjtSDFType', name='mjtSDFType',
declname='enum mjtSDFType_', declname='enum mjtSDFType',
values=dict([ values=dict([
('mjSDFTYPE_SINGLE', 0), ('mjSDFTYPE_SINGLE', 0),
('mjSDFTYPE_INTERSECTION', 1), ('mjSDFTYPE_INTERSECTION', 1),
@@ -511,7 +511,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtState', ('mjtState',
EnumDecl( EnumDecl(
name='mjtState', name='mjtState',
declname='enum mjtState_', declname='enum mjtState',
values=dict([ values=dict([
('mjSTATE_TIME', 1), ('mjSTATE_TIME', 1),
('mjSTATE_QPOS', 2), ('mjSTATE_QPOS', 2),
@@ -537,7 +537,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtConstraint', ('mjtConstraint',
EnumDecl( EnumDecl(
name='mjtConstraint', name='mjtConstraint',
declname='enum mjtConstraint_', declname='enum mjtConstraint',
values=dict([ values=dict([
('mjCNSTR_EQUALITY', 0), ('mjCNSTR_EQUALITY', 0),
('mjCNSTR_FRICTION_DOF', 1), ('mjCNSTR_FRICTION_DOF', 1),
@@ -552,7 +552,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtConstraintState', ('mjtConstraintState',
EnumDecl( EnumDecl(
name='mjtConstraintState', name='mjtConstraintState',
declname='enum mjtConstraintState_', declname='enum mjtConstraintState',
values=dict([ values=dict([
('mjCNSTRSTATE_SATISFIED', 0), ('mjCNSTRSTATE_SATISFIED', 0),
('mjCNSTRSTATE_QUADRATIC', 1), ('mjCNSTRSTATE_QUADRATIC', 1),
@@ -564,7 +564,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtWarning', ('mjtWarning',
EnumDecl( EnumDecl(
name='mjtWarning', name='mjtWarning',
declname='enum mjtWarning_', declname='enum mjtWarning',
values=dict([ values=dict([
('mjWARN_INERTIA', 0), ('mjWARN_INERTIA', 0),
('mjWARN_CONTACTFULL', 1), ('mjWARN_CONTACTFULL', 1),
@@ -579,7 +579,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtTimer', ('mjtTimer',
EnumDecl( EnumDecl(
name='mjtTimer', name='mjtTimer',
declname='enum mjtTimer_', declname='enum mjtTimer',
values=dict([ values=dict([
('mjTIMER_STEP', 0), ('mjTIMER_STEP', 0),
('mjTIMER_FORWARD', 1), ('mjTIMER_FORWARD', 1),
@@ -602,7 +602,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtSleepState', ('mjtSleepState',
EnumDecl( EnumDecl(
name='mjtSleepState', name='mjtSleepState',
declname='enum mjtSleepState_', declname='enum mjtSleepState',
values=dict([ values=dict([
('mjS_STATIC', -1), ('mjS_STATIC', -1),
('mjS_ASLEEP', 0), ('mjS_ASLEEP', 0),
@@ -612,7 +612,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtLogLevel', ('mjtLogLevel',
EnumDecl( EnumDecl(
name='mjtLogLevel', name='mjtLogLevel',
declname='enum mjtLogLevel_', declname='enum mjtLogLevel',
values=dict([ values=dict([
('mjLOG_DEBUG', 0), ('mjLOG_DEBUG', 0),
('mjLOG_INFO', 1), ('mjLOG_INFO', 1),
@@ -623,7 +623,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtLogTopic', ('mjtLogTopic',
EnumDecl( EnumDecl(
name='mjtLogTopic', name='mjtLogTopic',
declname='enum mjtLogTopic_', declname='enum mjtLogTopic',
values=dict([ values=dict([
('mjTOPIC_NONE', 0), ('mjTOPIC_NONE', 0),
('mjTOPIC_TIME_STP', 1), ('mjTOPIC_TIME_STP', 1),
@@ -635,7 +635,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtGeomInertia', ('mjtGeomInertia',
EnumDecl( EnumDecl(
name='mjtGeomInertia', name='mjtGeomInertia',
declname='enum mjtGeomInertia_', declname='enum mjtGeomInertia',
values=dict([ values=dict([
('mjINERTIA_VOLUME', 0), ('mjINERTIA_VOLUME', 0),
('mjINERTIA_SHELL', 1), ('mjINERTIA_SHELL', 1),
@@ -644,7 +644,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtMeshInertia', ('mjtMeshInertia',
EnumDecl( EnumDecl(
name='mjtMeshInertia', name='mjtMeshInertia',
declname='enum mjtMeshInertia_', declname='enum mjtMeshInertia',
values=dict([ values=dict([
('mjMESH_INERTIA_CONVEX', 0), ('mjMESH_INERTIA_CONVEX', 0),
('mjMESH_INERTIA_EXACT', 1), ('mjMESH_INERTIA_EXACT', 1),
@@ -655,7 +655,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtMeshBuiltin', ('mjtMeshBuiltin',
EnumDecl( EnumDecl(
name='mjtMeshBuiltin', name='mjtMeshBuiltin',
declname='enum mjtMeshBuiltin_', declname='enum mjtMeshBuiltin',
values=dict([ values=dict([
('mjMESH_BUILTIN_NONE', 0), ('mjMESH_BUILTIN_NONE', 0),
('mjMESH_BUILTIN_SPHERE', 1), ('mjMESH_BUILTIN_SPHERE', 1),
@@ -670,7 +670,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtBuiltin', ('mjtBuiltin',
EnumDecl( EnumDecl(
name='mjtBuiltin', name='mjtBuiltin',
declname='enum mjtBuiltin_', declname='enum mjtBuiltin',
values=dict([ values=dict([
('mjBUILTIN_NONE', 0), ('mjBUILTIN_NONE', 0),
('mjBUILTIN_GRADIENT', 1), ('mjBUILTIN_GRADIENT', 1),
@@ -681,7 +681,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtMark', ('mjtMark',
EnumDecl( EnumDecl(
name='mjtMark', name='mjtMark',
declname='enum mjtMark_', declname='enum mjtMark',
values=dict([ values=dict([
('mjMARK_NONE', 0), ('mjMARK_NONE', 0),
('mjMARK_EDGE', 1), ('mjMARK_EDGE', 1),
@@ -692,7 +692,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtLimited', ('mjtLimited',
EnumDecl( EnumDecl(
name='mjtLimited', name='mjtLimited',
declname='enum mjtLimited_', declname='enum mjtLimited',
values=dict([ values=dict([
('mjLIMITED_FALSE', 0), ('mjLIMITED_FALSE', 0),
('mjLIMITED_TRUE', 1), ('mjLIMITED_TRUE', 1),
@@ -702,7 +702,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtAlignFree', ('mjtAlignFree',
EnumDecl( EnumDecl(
name='mjtAlignFree', name='mjtAlignFree',
declname='enum mjtAlignFree_', declname='enum mjtAlignFree',
values=dict([ values=dict([
('mjALIGNFREE_FALSE', 0), ('mjALIGNFREE_FALSE', 0),
('mjALIGNFREE_TRUE', 1), ('mjALIGNFREE_TRUE', 1),
@@ -712,7 +712,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtInertiaFromGeom', ('mjtInertiaFromGeom',
EnumDecl( EnumDecl(
name='mjtInertiaFromGeom', name='mjtInertiaFromGeom',
declname='enum mjtInertiaFromGeom_', declname='enum mjtInertiaFromGeom',
values=dict([ values=dict([
('mjINERTIAFROMGEOM_FALSE', 0), ('mjINERTIAFROMGEOM_FALSE', 0),
('mjINERTIAFROMGEOM_TRUE', 1), ('mjINERTIAFROMGEOM_TRUE', 1),
@@ -722,7 +722,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtOrientation', ('mjtOrientation',
EnumDecl( EnumDecl(
name='mjtOrientation', name='mjtOrientation',
declname='enum mjtOrientation_', declname='enum mjtOrientation',
values=dict([ values=dict([
('mjORIENTATION_QUAT', 0), ('mjORIENTATION_QUAT', 0),
('mjORIENTATION_AXISANGLE', 1), ('mjORIENTATION_AXISANGLE', 1),
@@ -734,7 +734,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtConflict', ('mjtConflict',
EnumDecl( EnumDecl(
name='mjtConflict', name='mjtConflict',
declname='enum mjtConflict_', declname='enum mjtConflict',
values=dict([ values=dict([
('mjCONFLICT_WARNING', 0), ('mjCONFLICT_WARNING', 0),
('mjCONFLICT_MERGE', 1), ('mjCONFLICT_MERGE', 1),
@@ -744,7 +744,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtCTimer', ('mjtCTimer',
EnumDecl( EnumDecl(
name='mjtCTimer', name='mjtCTimer',
declname='enum mjtCTimer_', declname='enum mjtCTimer',
values=dict([ values=dict([
('mjCTIMER_TOTAL', 0), ('mjCTIMER_TOTAL', 0),
('mjCTIMER_ASSETS', 1), ('mjCTIMER_ASSETS', 1),
@@ -1038,7 +1038,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtButton', ('mjtButton',
EnumDecl( EnumDecl(
name='mjtButton', name='mjtButton',
declname='enum mjtButton_', declname='enum mjtButton',
values=dict([ values=dict([
('mjBUTTON_NONE', 0), ('mjBUTTON_NONE', 0),
('mjBUTTON_LEFT', 1), ('mjBUTTON_LEFT', 1),
@@ -1049,7 +1049,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtEvent', ('mjtEvent',
EnumDecl( EnumDecl(
name='mjtEvent', name='mjtEvent',
declname='enum mjtEvent_', declname='enum mjtEvent',
values=dict([ values=dict([
('mjEVENT_NONE', 0), ('mjEVENT_NONE', 0),
('mjEVENT_MOVE', 1), ('mjEVENT_MOVE', 1),
@@ -1065,7 +1065,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtItem', ('mjtItem',
EnumDecl( EnumDecl(
name='mjtItem', name='mjtItem',
declname='enum mjtItem_', declname='enum mjtItem',
values=dict([ values=dict([
('mjITEM_END', -2), ('mjITEM_END', -2),
('mjITEM_SECTION', -1), ('mjITEM_SECTION', -1),
@@ -1089,7 +1089,7 @@ ENUMS: Mapping[str, EnumDecl] = dict([
('mjtSection', ('mjtSection',
EnumDecl( EnumDecl(
name='mjtSection', name='mjtSection',
declname='enum mjtSection_', declname='enum mjtSection',
values=dict([ values=dict([
('mjSECT_CLOSED', 0), ('mjSECT_CLOSED', 0),
('mjSECT_OPEN', 1), ('mjSECT_OPEN', 1),
+3 -3
View File
@@ -25,7 +25,7 @@ class EnumsTest(absltest.TestCase):
def test_mjtJoint(self): # pylint: disable=invalid-name def test_mjtJoint(self): # pylint: disable=invalid-name
enum_decl = enums.ENUMS['mjtJoint'] enum_decl = enums.ENUMS['mjtJoint']
self.assertEqual(enum_decl.name, 'mjtJoint') self.assertEqual(enum_decl.name, 'mjtJoint')
self.assertEqual(enum_decl.declname, 'enum mjtJoint_') self.assertEqual(enum_decl.declname, 'enum mjtJoint')
self.assertEqual( self.assertEqual(
tuple(enum_decl.values.items()), (('mjJNT_FREE', 0), tuple(enum_decl.values.items()), (('mjJNT_FREE', 0),
('mjJNT_BALL', 1), ('mjJNT_BALL', 1),
@@ -36,7 +36,7 @@ class EnumsTest(absltest.TestCase):
def test_mjtEnableBit(self): # pylint: disable=invalid-name def test_mjtEnableBit(self): # pylint: disable=invalid-name
enum_decl = enums.ENUMS['mjtEnableBit'] enum_decl = enums.ENUMS['mjtEnableBit']
self.assertEqual(enum_decl.name, 'mjtEnableBit') self.assertEqual(enum_decl.name, 'mjtEnableBit')
self.assertEqual(enum_decl.declname, 'enum mjtEnableBit_') self.assertEqual(enum_decl.declname, 'enum mjtEnableBit')
self.assertEqual( self.assertEqual(
tuple(enum_decl.values.items()), (('mjENBL_OVERRIDE', 1<<0), tuple(enum_decl.values.items()), (('mjENBL_OVERRIDE', 1<<0),
('mjENBL_ENERGY', 1<<1), ('mjENBL_ENERGY', 1<<1),
@@ -50,7 +50,7 @@ class EnumsTest(absltest.TestCase):
def test_mjtGeom(self): # pylint: disable=invalid-name def test_mjtGeom(self): # pylint: disable=invalid-name
enum_decl = enums.ENUMS['mjtGeom'] enum_decl = enums.ENUMS['mjtGeom']
self.assertEqual(enum_decl.name, 'mjtGeom') self.assertEqual(enum_decl.name, 'mjtGeom')
self.assertEqual(enum_decl.declname, 'enum mjtGeom_') self.assertEqual(enum_decl.declname, 'enum mjtGeom')
self.assertEqual(enum_decl.values['mjGEOM_PLANE'], 0) self.assertEqual(enum_decl.values['mjGEOM_PLANE'], 0)
self.assertEqual(enum_decl.values['mjGEOM_HFIELD'], 1) self.assertEqual(enum_decl.values['mjGEOM_HFIELD'], 1)