Rename mjtnum.h to mjtype.h, move enum types to mjtype.h
PiperOrigin-RevId: 919020039 Change-Id: I441295c0baa0b7456f78239fbd5478d32ffc07c1
This commit is contained in:
committed by
Copybara-Service
parent
ad96acfb16
commit
2810edd27a
+1
-1
@@ -117,7 +117,7 @@ set(MUJOCO_HEADERS
|
|||||||
include/mujoco/mjsan.h
|
include/mujoco/mjsan.h
|
||||||
include/mujoco/mjspec.h
|
include/mujoco/mjspec.h
|
||||||
include/mujoco/mjthread.h
|
include/mujoco/mjthread.h
|
||||||
include/mujoco/mjtnum.h
|
include/mujoco/mjtype.h
|
||||||
include/mujoco/mjui.h
|
include/mujoco/mjui.h
|
||||||
include/mujoco/mjvisualize.h
|
include/mujoco/mjvisualize.h
|
||||||
include/mujoco/mjxmacro.h
|
include/mujoco/mjxmacro.h
|
||||||
|
|||||||
@@ -415,7 +415,7 @@ indicated otherwise.
|
|||||||
- 1E-15
|
- 1E-15
|
||||||
- The minimal value allowed in any denominator, and in general any mathematical operation where 0 is not allowed.
|
- The minimal value allowed in any denominator, and in general any mathematical operation where 0 is not allowed.
|
||||||
In almost all cases, MuJoCo silently clamps smaller values to mjMINVAL.
|
In almost all cases, MuJoCo silently clamps smaller values to mjMINVAL.
|
||||||
Defined in `mjtnum.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtnum.h>`_.
|
Defined in `mjtype.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtype.h>`_.
|
||||||
* - ``mjPI``
|
* - ``mjPI``
|
||||||
- :math:`\pi`
|
- :math:`\pi`
|
||||||
- The value of :math:`\pi`. This is used in various trigonometric functions, and also for conversion from degrees
|
- The value of :math:`\pi`. This is used in various trigonometric functions, and also for conversion from degrees
|
||||||
|
|||||||
@@ -46,7 +46,7 @@ MuJoCo defines a large number of types:
|
|||||||
Primitive types
|
Primitive types
|
||||||
---------------
|
---------------
|
||||||
|
|
||||||
The two types below are defined in `mjtnum.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtnum.h>`__.
|
The three types below are defined in `mjtype.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtype.h>`__.
|
||||||
|
|
||||||
|
|
||||||
.. _mjtNum:
|
.. _mjtNum:
|
||||||
@@ -63,7 +63,7 @@ double-precision version will always be available. Thus it is safe to write user
|
|||||||
However, our preference is to write code that works with either single or double precision. To this end we provide math
|
However, our preference is to write code that works with either single or double precision. To this end we provide math
|
||||||
utility functions that are always defined with the correct floating-point type.
|
utility functions that are always defined with the correct floating-point type.
|
||||||
|
|
||||||
Note that changing ``mjUSESINGLE`` in ``mjtnum.h`` will not change how the library was compiled, and instead will
|
Note that changing ``mjUSESINGLE`` in ``mjtype.h`` will not change how the library was compiled, and instead will
|
||||||
result in numerous link errors. In general, the header files distributed with precompiled MuJoCo should never be
|
result in numerous link errors. In general, the header files distributed with precompiled MuJoCo should never be
|
||||||
changed by the user.
|
changed by the user.
|
||||||
|
|
||||||
|
|||||||
+5
-1
@@ -73,6 +73,10 @@ General
|
|||||||
- The :ref:`mjfCollision` functions now populate the :ref:`mjPreContact` struct instead of the :ref:`mjContact`
|
- The :ref:`mjfCollision` functions now populate the :ref:`mjPreContact` struct instead of the :ref:`mjContact`
|
||||||
struct. The :ref:`mjPreContact` only contains the necessary fields needed for the narrowphase collision detection.
|
struct. The :ref:`mjPreContact` only contains the necessary fields needed for the narrowphase collision detection.
|
||||||
|
|
||||||
|
- The header file ``mjtnum.h`` was renamed to
|
||||||
|
`mjtype.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtype.h>` and now includes all
|
||||||
|
enum type definitions.
|
||||||
|
|
||||||
- MJX: Removed the deprecated ``nconmax`` argument from ``mjx.make_data`` and ``mjx.put_data`` in favor of
|
- MJX: Removed the deprecated ``nconmax`` argument from ``mjx.make_data`` and ``mjx.put_data`` in favor of
|
||||||
``naconmax``.
|
``naconmax``.
|
||||||
|
|
||||||
@@ -1194,7 +1198,7 @@ General
|
|||||||
10. Added :ref:`mj_setKeyframe` for saving the current state into a model keyframe.
|
10. Added :ref:`mj_setKeyframe` for saving the current state into a model keyframe.
|
||||||
11. Added support for ``ball`` joints in the URDF parser ("spherical" in URDF).
|
11. Added support for ``ball`` joints in the URDF parser ("spherical" in URDF).
|
||||||
12. Replaced ``mjUSEDOUBLE`` which was previously hard-coded in
|
12. Replaced ``mjUSEDOUBLE`` which was previously hard-coded in
|
||||||
`mjtnum.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtnum.h>`__
|
`mjtnum.h <https://github.com/google-deepmind/mujoco/blob/3577e2cf8bf841475b489aefff52276a39f24d51/include/mjtnum.h>`__
|
||||||
with the build-time flag ``mjUSESINGLE``. If this symbol is not defined, MuJoCo will use double-precision floating
|
with the build-time flag ``mjUSESINGLE``. If this symbol is not defined, MuJoCo will use double-precision floating
|
||||||
point, as usual. If ``mjUSESINGLE`` is defined, MuJoCo will use single-precision floating point. See :ref:`mjtNum`.
|
point, as usual. If ``mjUSESINGLE`` is defined, MuJoCo will use single-precision floating point. See :ref:`mjtNum`.
|
||||||
|
|
||||||
|
|||||||
+448
-448
@@ -16,91 +16,6 @@
|
|||||||
// Error: C reference not found
|
// Error: C reference not found
|
||||||
// NOLINTBEGIN
|
// NOLINTBEGIN
|
||||||
|
|
||||||
typedef enum mjtState_ { // state elements
|
|
||||||
mjSTATE_TIME = 1<<0, // time
|
|
||||||
mjSTATE_QPOS = 1<<1, // position
|
|
||||||
mjSTATE_QVEL = 1<<2, // velocity
|
|
||||||
mjSTATE_ACT = 1<<3, // actuator activation
|
|
||||||
mjSTATE_HISTORY = 1<<4, // history buffers (control, sensor)
|
|
||||||
mjSTATE_WARMSTART = 1<<5, // acceleration used for warmstart
|
|
||||||
mjSTATE_CTRL = 1<<6, // control
|
|
||||||
mjSTATE_QFRC_APPLIED = 1<<7, // applied generalized force
|
|
||||||
mjSTATE_XFRC_APPLIED = 1<<8, // applied Cartesian force/torque
|
|
||||||
mjSTATE_EQ_ACTIVE = 1<<9, // enable/disable constraints
|
|
||||||
mjSTATE_MOCAP_POS = 1<<10, // positions of mocap bodies
|
|
||||||
mjSTATE_MOCAP_QUAT = 1<<11, // orientations of mocap bodies
|
|
||||||
mjSTATE_USERDATA = 1<<12, // user data
|
|
||||||
mjSTATE_PLUGIN = 1<<13, // plugin state
|
|
||||||
|
|
||||||
mjNSTATE = 14, // number of state elements
|
|
||||||
|
|
||||||
// convenience values for commonly used state specifications
|
|
||||||
mjSTATE_PHYSICS = mjSTATE_QPOS | mjSTATE_QVEL | mjSTATE_ACT | mjSTATE_HISTORY,
|
|
||||||
mjSTATE_FULLPHYSICS = mjSTATE_TIME | mjSTATE_PHYSICS | mjSTATE_PLUGIN,
|
|
||||||
mjSTATE_USER = mjSTATE_CTRL | mjSTATE_QFRC_APPLIED | mjSTATE_XFRC_APPLIED |
|
|
||||||
mjSTATE_EQ_ACTIVE | mjSTATE_MOCAP_POS | mjSTATE_MOCAP_QUAT |
|
|
||||||
mjSTATE_USERDATA,
|
|
||||||
mjSTATE_INTEGRATION = mjSTATE_FULLPHYSICS | mjSTATE_USER | mjSTATE_WARMSTART
|
|
||||||
} mjtState;
|
|
||||||
typedef enum mjtConstraint_ { // type of constraint
|
|
||||||
mjCNSTR_EQUALITY = 0, // equality constraint
|
|
||||||
mjCNSTR_FRICTION_DOF, // dof friction
|
|
||||||
mjCNSTR_FRICTION_TENDON, // tendon friction
|
|
||||||
mjCNSTR_LIMIT_JOINT, // joint limit
|
|
||||||
mjCNSTR_LIMIT_TENDON, // tendon limit
|
|
||||||
mjCNSTR_CONTACT_FRICTIONLESS, // frictionless contact
|
|
||||||
mjCNSTR_CONTACT_PYRAMIDAL, // frictional contact, pyramidal friction cone
|
|
||||||
mjCNSTR_CONTACT_ELLIPTIC // frictional contact, elliptic friction cone
|
|
||||||
} mjtConstraint;
|
|
||||||
typedef enum mjtConstraintState_ { // constraint state
|
|
||||||
mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact)
|
|
||||||
mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact)
|
|
||||||
mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction)
|
|
||||||
mjCNSTRSTATE_LINEARPOS, // linear cost, positive side (friction)
|
|
||||||
mjCNSTRSTATE_CONE // squared distance to cone cost (elliptic contact)
|
|
||||||
} mjtConstraintState;
|
|
||||||
typedef enum mjtWarning_ { // warning types
|
|
||||||
mjWARN_INERTIA = 0, // (near) singular inertia matrix
|
|
||||||
mjWARN_CONTACTFULL, // too many contacts in contact list
|
|
||||||
mjWARN_CNSTRFULL, // too many constraints
|
|
||||||
mjWARN_BADQPOS, // bad number in qpos
|
|
||||||
mjWARN_BADQVEL, // bad number in qvel
|
|
||||||
mjWARN_BADQACC, // bad number in qacc
|
|
||||||
mjWARN_BADCTRL, // bad number in ctrl
|
|
||||||
|
|
||||||
mjNWARNING // number of warnings
|
|
||||||
} mjtWarning;
|
|
||||||
typedef enum mjtTimer_ { // internal timers
|
|
||||||
// main api
|
|
||||||
mjTIMER_STEP = 0, // step
|
|
||||||
mjTIMER_FORWARD, // forward
|
|
||||||
mjTIMER_INVERSE, // inverse
|
|
||||||
|
|
||||||
// breakdown of step/forward
|
|
||||||
mjTIMER_POSITION, // fwdPosition
|
|
||||||
mjTIMER_VELOCITY, // fwdVelocity
|
|
||||||
mjTIMER_ACTUATION, // fwdActuation
|
|
||||||
mjTIMER_CONSTRAINT, // fwdConstraint
|
|
||||||
mjTIMER_ADVANCE, // mj_Euler, mj_implicit
|
|
||||||
|
|
||||||
// breakdown of fwdPosition
|
|
||||||
mjTIMER_POS_KINEMATICS, // kinematics, com, tendon, transmission
|
|
||||||
mjTIMER_POS_INERTIA, // inertia computations
|
|
||||||
mjTIMER_POS_COLLISION, // collision detection
|
|
||||||
mjTIMER_POS_MAKE, // make constraints
|
|
||||||
mjTIMER_POS_PROJECT, // project constraints
|
|
||||||
|
|
||||||
// breakdown of mj_collision
|
|
||||||
mjTIMER_COL_BROAD, // broadphase
|
|
||||||
mjTIMER_COL_NARROW, // narrowphase
|
|
||||||
|
|
||||||
mjNTIMER // number of timers
|
|
||||||
} mjtTimer;
|
|
||||||
typedef enum mjtSleepState_ { // sleep state of an object
|
|
||||||
mjS_STATIC = -1, // object is static
|
|
||||||
mjS_ASLEEP = 0, // object is asleep
|
|
||||||
mjS_AWAKE = 1 // object is awake
|
|
||||||
} mjtSleepState;
|
|
||||||
struct mjPreContact_ { // contact parameters set by narrowphase collision functions
|
struct mjPreContact_ { // contact parameters set by narrowphase collision functions
|
||||||
mjtNum dist;
|
mjtNum dist;
|
||||||
mjtNum pos[3];
|
mjtNum pos[3];
|
||||||
@@ -486,369 +401,6 @@ struct mjData_ {
|
|||||||
uint64_t signature; // also held by the mjSpec that compiled the model
|
uint64_t signature; // also held by the mjSpec that compiled the model
|
||||||
};
|
};
|
||||||
typedef struct mjData_ mjData;
|
typedef struct mjData_ mjData;
|
||||||
typedef enum mjtDisableBit_ { // disable default feature bitflags
|
|
||||||
mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver
|
|
||||||
mjDSBL_EQUALITY = 1<<1, // equality constraints
|
|
||||||
mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints
|
|
||||||
mjDSBL_LIMIT = 1<<3, // joint and tendon limit constraints
|
|
||||||
mjDSBL_CONTACT = 1<<4, // contact constraints
|
|
||||||
mjDSBL_SPRING = 1<<5, // passive spring forces
|
|
||||||
mjDSBL_DAMPER = 1<<6, // passive damping forces
|
|
||||||
mjDSBL_GRAVITY = 1<<7, // gravitational forces
|
|
||||||
mjDSBL_CLAMPCTRL = 1<<8, // clamp control to specified range
|
|
||||||
mjDSBL_WARMSTART = 1<<9, // warmstart constraint solver
|
|
||||||
mjDSBL_FILTERPARENT = 1<<10, // remove collisions with parent body
|
|
||||||
mjDSBL_ACTUATION = 1<<11, // apply actuation forces
|
|
||||||
mjDSBL_REFSAFE = 1<<12, // integrator safety: make ref[0]>=2*timestep
|
|
||||||
mjDSBL_SENSOR = 1<<13, // sensors
|
|
||||||
mjDSBL_MIDPHASE = 1<<14, // mid-phase collision filtering
|
|
||||||
mjDSBL_EULERDAMP = 1<<15, // implicit integration of joint damping in Euler integrator
|
|
||||||
mjDSBL_AUTORESET = 1<<16, // automatic reset when numerical issues are detected
|
|
||||||
mjDSBL_NATIVECCD = 1<<17, // native convex collision detection
|
|
||||||
mjDSBL_ISLAND = 1<<18, // constraint island discovery
|
|
||||||
mjDSBL_MULTICCD = 1<<19, // multiple CCD contact points
|
|
||||||
|
|
||||||
mjNDISABLE = 20 // number of disable flags
|
|
||||||
} mjtDisableBit;
|
|
||||||
typedef enum mjtEnableBit_ { // enable optional feature bitflags
|
|
||||||
mjENBL_OVERRIDE = 1<<0, // override contact parameters
|
|
||||||
mjENBL_ENERGY = 1<<1, // energy computation
|
|
||||||
mjENBL_FWDINV = 1<<2, // record solver statistics
|
|
||||||
mjENBL_INVDISCRETE = 1<<3, // discrete-time inverse dynamics
|
|
||||||
mjENBL_SLEEP = 1<<4, // sleeping
|
|
||||||
mjENBL_DIAGEXACT = 1<<5, // exact diagonal of constraint inertia
|
|
||||||
|
|
||||||
mjNENABLE = 6 // number of enable flags
|
|
||||||
} mjtEnableBit;
|
|
||||||
typedef enum mjtJoint_ { // type of degree of freedom
|
|
||||||
mjJNT_FREE = 0, // global position and orientation (quat) (7)
|
|
||||||
mjJNT_BALL, // orientation (quat) relative to parent (4)
|
|
||||||
mjJNT_SLIDE, // sliding distance along body-fixed axis (1)
|
|
||||||
mjJNT_HINGE // rotation angle (rad) around body-fixed axis (1)
|
|
||||||
} mjtJoint;
|
|
||||||
typedef enum mjtGeom_ { // type of geometric shape
|
|
||||||
// regular geom types
|
|
||||||
mjGEOM_PLANE = 0, // plane
|
|
||||||
mjGEOM_HFIELD, // height field
|
|
||||||
mjGEOM_SPHERE, // sphere
|
|
||||||
mjGEOM_CAPSULE, // capsule
|
|
||||||
mjGEOM_ELLIPSOID, // ellipsoid
|
|
||||||
mjGEOM_CYLINDER, // cylinder
|
|
||||||
mjGEOM_BOX, // box
|
|
||||||
mjGEOM_MESH, // mesh
|
|
||||||
mjGEOM_SDF, // signed distance field
|
|
||||||
|
|
||||||
mjNGEOMTYPES, // number of regular geom types
|
|
||||||
|
|
||||||
// rendering-only geom types: not used in mjModel, not counted in mjNGEOMTYPES
|
|
||||||
mjGEOM_ARROW = 100, // arrow
|
|
||||||
mjGEOM_ARROW1, // arrow without wedges
|
|
||||||
mjGEOM_ARROW2, // arrow in both directions
|
|
||||||
mjGEOM_LINE, // line
|
|
||||||
mjGEOM_LINEBOX, // box with line edges
|
|
||||||
mjGEOM_FLEX, // flex
|
|
||||||
mjGEOM_SKIN, // skin
|
|
||||||
mjGEOM_LABEL, // text label
|
|
||||||
mjGEOM_TRIANGLE, // triangle
|
|
||||||
|
|
||||||
mjGEOM_NONE = 1001 // missing geom type
|
|
||||||
} mjtGeom;
|
|
||||||
typedef enum mjtProjection_ { // type of camera projection
|
|
||||||
mjPROJ_PERSPECTIVE = 0, // perspective
|
|
||||||
mjPROJ_ORTHOGRAPHIC // orthographic
|
|
||||||
} mjtProjection;
|
|
||||||
typedef enum mjtCamLight_ { // tracking mode for camera and light
|
|
||||||
mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body
|
|
||||||
mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global
|
|
||||||
mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body
|
|
||||||
mjCAMLIGHT_TARGETBODY, // pos fixed in body, rot tracks target body
|
|
||||||
mjCAMLIGHT_TARGETBODYCOM // pos fixed in body, rot tracks target subtree com
|
|
||||||
} mjtCamLight;
|
|
||||||
typedef enum mjtLightType_ { // type of light
|
|
||||||
mjLIGHT_SPOT = 0, // spot
|
|
||||||
mjLIGHT_DIRECTIONAL, // directional
|
|
||||||
mjLIGHT_POINT, // point
|
|
||||||
mjLIGHT_IMAGE, // image-based
|
|
||||||
} mjtLightType;
|
|
||||||
typedef enum mjtTexture_ { // type of texture
|
|
||||||
mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields
|
|
||||||
mjTEXTURE_CUBE, // cube texture, suitable for all other geom types
|
|
||||||
mjTEXTURE_SKYBOX // cube texture used as skybox
|
|
||||||
} mjtTexture;
|
|
||||||
typedef enum mjtTextureRole_ { // role of texture map in rendering
|
|
||||||
mjTEXROLE_USER = 0, // unspecified
|
|
||||||
mjTEXROLE_RGB, // base color (albedo)
|
|
||||||
mjTEXROLE_OCCLUSION, // ambient occlusion
|
|
||||||
mjTEXROLE_ROUGHNESS, // roughness
|
|
||||||
mjTEXROLE_METALLIC, // metallic
|
|
||||||
mjTEXROLE_NORMAL, // normal (bump) map
|
|
||||||
mjTEXROLE_OPACITY, // opacity
|
|
||||||
mjTEXROLE_EMISSIVE, // light emission
|
|
||||||
mjTEXROLE_RGBA, // base color, opacity
|
|
||||||
mjTEXROLE_ORM, // occlusion, roughness, metallic
|
|
||||||
mjNTEXROLE
|
|
||||||
} mjtTextureRole;
|
|
||||||
typedef enum mjtColorSpace_ { // type of color space encoding
|
|
||||||
mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear
|
|
||||||
mjCOLORSPACE_LINEAR, // linear color space
|
|
||||||
mjCOLORSPACE_SRGB // standard RGB color space
|
|
||||||
} mjtColorSpace;
|
|
||||||
typedef enum mjtIntegrator_ { // integrator mode
|
|
||||||
mjINT_EULER = 0, // semi-implicit Euler
|
|
||||||
mjINT_RK4, // 4th-order Runge Kutta
|
|
||||||
mjINT_IMPLICIT, // implicit in velocity
|
|
||||||
mjINT_IMPLICITFAST // implicit in velocity, no rne derivative
|
|
||||||
} mjtIntegrator;
|
|
||||||
typedef enum mjtCone_ { // type of friction cone
|
|
||||||
mjCONE_PYRAMIDAL = 0, // pyramidal
|
|
||||||
mjCONE_ELLIPTIC // elliptic
|
|
||||||
} mjtCone;
|
|
||||||
typedef enum mjtJacobian_ { // type of constraint Jacobian
|
|
||||||
mjJAC_DENSE = 0, // dense
|
|
||||||
mjJAC_SPARSE, // sparse
|
|
||||||
mjJAC_AUTO // dense if nv<60, sparse otherwise
|
|
||||||
} mjtJacobian;
|
|
||||||
typedef enum mjtSolver_ { // constraint solver algorithm
|
|
||||||
mjSOL_PGS = 0, // PGS (dual)
|
|
||||||
mjSOL_CG, // CG (primal)
|
|
||||||
mjSOL_NEWTON // Newton (primal)
|
|
||||||
} mjtSolver;
|
|
||||||
typedef enum mjtEq_ { // type of equality constraint
|
|
||||||
mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint)
|
|
||||||
mjEQ_WELD, // fix relative position and orientation of two bodies
|
|
||||||
mjEQ_JOINT, // couple the values of two scalar joints with cubic
|
|
||||||
mjEQ_TENDON, // couple the lengths of two tendons with cubic
|
|
||||||
mjEQ_FLEX, // fix all edge lengths of a flex
|
|
||||||
mjEQ_FLEXVERT, // fix all vertex lengths of a flex
|
|
||||||
mjEQ_FLEXSTRAIN, // constrain strain of a trilinear/quadratic flex (B-bar)
|
|
||||||
mjEQ_DISTANCE // unsupported, will cause an error if used
|
|
||||||
} mjtEq;
|
|
||||||
typedef enum mjtWrap_ { // type of tendon wrap object
|
|
||||||
mjWRAP_NONE = 0, // null object
|
|
||||||
mjWRAP_JOINT, // constant moment arm
|
|
||||||
mjWRAP_PULLEY, // pulley used to split tendon
|
|
||||||
mjWRAP_SITE, // pass through site
|
|
||||||
mjWRAP_SPHERE, // wrap around sphere
|
|
||||||
mjWRAP_CYLINDER // wrap around (infinite) cylinder
|
|
||||||
} mjtWrap;
|
|
||||||
typedef enum mjtTrn_ { // type of actuator transmission
|
|
||||||
mjTRN_JOINT = 0, // force on joint
|
|
||||||
mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame
|
|
||||||
mjTRN_SLIDERCRANK, // force via slider-crank linkage
|
|
||||||
mjTRN_TENDON, // force on tendon
|
|
||||||
mjTRN_SITE, // force on site
|
|
||||||
mjTRN_BODY, // adhesion force on a body's geoms
|
|
||||||
|
|
||||||
mjTRN_UNDEFINED = 1000 // undefined transmission type
|
|
||||||
} mjtTrn;
|
|
||||||
typedef enum mjtDyn_ { // type of actuator dynamics
|
|
||||||
mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force
|
|
||||||
mjDYN_INTEGRATOR, // integrator: da/dt = u
|
|
||||||
mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau
|
|
||||||
mjDYN_FILTEREXACT, // linear filter: da/dt = (u-a) / tau, with exact integration
|
|
||||||
mjDYN_MUSCLE, // piecewise linear filter with two time constants
|
|
||||||
mjDYN_DCMOTOR, // DC motor electrical dynamics
|
|
||||||
mjDYN_USER // user-defined dynamics type
|
|
||||||
} mjtDyn;
|
|
||||||
typedef enum mjtGain_ { // type of actuator gain
|
|
||||||
mjGAIN_FIXED = 0, // fixed gain
|
|
||||||
mjGAIN_AFFINE, // const + kp*length + kv*velocity
|
|
||||||
mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain()
|
|
||||||
mjGAIN_DCMOTOR, // DC motor gain: K or K/R
|
|
||||||
mjGAIN_USER // user-defined gain type
|
|
||||||
} mjtGain;
|
|
||||||
typedef enum mjtBias_ { // type of actuator bias
|
|
||||||
mjBIAS_NONE = 0, // no bias
|
|
||||||
mjBIAS_AFFINE, // const + kp*length + kv*velocity
|
|
||||||
mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias()
|
|
||||||
mjBIAS_DCMOTOR, // DC motor bias: back-EMF, cogging, LuGre friction
|
|
||||||
mjBIAS_USER // user-defined bias type
|
|
||||||
} mjtBias;
|
|
||||||
typedef enum mjtObj_ { // type of MujoCo object
|
|
||||||
mjOBJ_UNKNOWN = 0, // unknown object type
|
|
||||||
mjOBJ_BODY, // body
|
|
||||||
mjOBJ_XBODY, // body, used to access regular frame instead of i-frame
|
|
||||||
mjOBJ_JOINT, // joint
|
|
||||||
mjOBJ_DOF, // dof
|
|
||||||
mjOBJ_GEOM, // geom
|
|
||||||
mjOBJ_SITE, // site
|
|
||||||
mjOBJ_CAMERA, // camera
|
|
||||||
mjOBJ_LIGHT, // light
|
|
||||||
mjOBJ_FLEX, // flex
|
|
||||||
mjOBJ_MESH, // mesh
|
|
||||||
mjOBJ_SKIN, // skin
|
|
||||||
mjOBJ_HFIELD, // heightfield
|
|
||||||
mjOBJ_TEXTURE, // texture
|
|
||||||
mjOBJ_MATERIAL, // material for rendering
|
|
||||||
mjOBJ_PAIR, // geom pair to include
|
|
||||||
mjOBJ_EXCLUDE, // body pair to exclude
|
|
||||||
mjOBJ_EQUALITY, // equality constraint
|
|
||||||
mjOBJ_TENDON, // tendon
|
|
||||||
mjOBJ_ACTUATOR, // actuator
|
|
||||||
mjOBJ_SENSOR, // sensor
|
|
||||||
mjOBJ_NUMERIC, // numeric
|
|
||||||
mjOBJ_TEXT, // text
|
|
||||||
mjOBJ_TUPLE, // tuple
|
|
||||||
mjOBJ_KEY, // keyframe
|
|
||||||
mjOBJ_PLUGIN, // plugin instance
|
|
||||||
|
|
||||||
mjNOBJECT, // number of object types
|
|
||||||
|
|
||||||
// meta elements, do not appear in mjModel
|
|
||||||
mjOBJ_FRAME = 100, // frame
|
|
||||||
mjOBJ_DEFAULT, // default
|
|
||||||
mjOBJ_MODEL // entire model
|
|
||||||
} mjtObj;
|
|
||||||
typedef enum mjtSensor_ { // type of sensor
|
|
||||||
// common robotic sensors, attached to a site
|
|
||||||
mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone
|
|
||||||
mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame
|
|
||||||
mjSENS_VELOCIMETER, // 3D linear velocity, in local frame
|
|
||||||
mjSENS_GYRO, // 3D angular velocity, in local frame
|
|
||||||
mjSENS_FORCE, // 3D force between site's body and its parent body
|
|
||||||
mjSENS_TORQUE, // 3D torque between site's body and its parent body
|
|
||||||
mjSENS_MAGNETOMETER, // 3D magnetometer
|
|
||||||
mjSENS_RANGEFINDER, // scalar distance to nearest geom along z-axis
|
|
||||||
mjSENS_CAMPROJECTION, // pixel coordinates of a site in the camera image
|
|
||||||
|
|
||||||
// sensors related to scalar joints, tendons, actuators
|
|
||||||
mjSENS_JOINTPOS, // scalar joint position (hinge and slide only)
|
|
||||||
mjSENS_JOINTVEL, // scalar joint velocity (hinge and slide only)
|
|
||||||
mjSENS_TENDONPOS, // scalar tendon position
|
|
||||||
mjSENS_TENDONVEL, // scalar tendon velocity
|
|
||||||
mjSENS_ACTUATORPOS, // scalar actuator position
|
|
||||||
mjSENS_ACTUATORVEL, // scalar actuator velocity
|
|
||||||
mjSENS_ACTUATORFRC, // scalar actuator force
|
|
||||||
mjSENS_JOINTACTFRC, // scalar actuator force, measured at the joint
|
|
||||||
mjSENS_TENDONACTFRC, // scalar actuator force, measured at the tendon
|
|
||||||
|
|
||||||
// sensors related to ball joints
|
|
||||||
mjSENS_BALLQUAT, // 4D ball joint quaternion
|
|
||||||
mjSENS_BALLANGVEL, // 3D ball joint angular velocity
|
|
||||||
|
|
||||||
// joint and tendon limit sensors, in constraint space
|
|
||||||
mjSENS_JOINTLIMITPOS, // joint limit distance-margin
|
|
||||||
mjSENS_JOINTLIMITVEL, // joint limit velocity
|
|
||||||
mjSENS_JOINTLIMITFRC, // joint limit force
|
|
||||||
mjSENS_TENDONLIMITPOS, // tendon limit distance-margin
|
|
||||||
mjSENS_TENDONLIMITVEL, // tendon limit velocity
|
|
||||||
mjSENS_TENDONLIMITFRC, // tendon limit force
|
|
||||||
|
|
||||||
// sensors attached to an object with spatial frame: (x)body, geom, site, camera
|
|
||||||
mjSENS_FRAMEPOS, // 3D position
|
|
||||||
mjSENS_FRAMEQUAT, // 4D unit quaternion orientation
|
|
||||||
mjSENS_FRAMEXAXIS, // 3D unit vector: x-axis of object's frame
|
|
||||||
mjSENS_FRAMEYAXIS, // 3D unit vector: y-axis of object's frame
|
|
||||||
mjSENS_FRAMEZAXIS, // 3D unit vector: z-axis of object's frame
|
|
||||||
mjSENS_FRAMELINVEL, // 3D linear velocity
|
|
||||||
mjSENS_FRAMEANGVEL, // 3D angular velocity
|
|
||||||
mjSENS_FRAMELINACC, // 3D linear acceleration
|
|
||||||
mjSENS_FRAMEANGACC, // 3D angular acceleration
|
|
||||||
|
|
||||||
// sensors related to kinematic subtrees; attached to a body (which is the subtree root)
|
|
||||||
mjSENS_SUBTREECOM, // 3D center of mass of subtree
|
|
||||||
mjSENS_SUBTREELINVEL, // 3D linear velocity of subtree
|
|
||||||
mjSENS_SUBTREEANGMOM, // 3D angular momentum of subtree
|
|
||||||
|
|
||||||
// sensors of geometric relationships
|
|
||||||
mjSENS_INSIDESITE, // 1 if object is inside a site, 0 otherwise
|
|
||||||
mjSENS_GEOMDIST, // signed distance between two geoms
|
|
||||||
mjSENS_GEOMNORMAL, // normal direction between two geoms
|
|
||||||
mjSENS_GEOMFROMTO, // segment between two geoms
|
|
||||||
|
|
||||||
// sensors for reporting contacts which occurred during the simulation
|
|
||||||
mjSENS_CONTACT, // contacts which occurred during the simulation
|
|
||||||
|
|
||||||
// global sensors
|
|
||||||
mjSENS_E_POTENTIAL, // potential energy
|
|
||||||
mjSENS_E_KINETIC, // kinetic energy
|
|
||||||
mjSENS_CLOCK, // simulation time
|
|
||||||
|
|
||||||
// sensors related to SDFs
|
|
||||||
mjSENS_TACTILE, // tactile sensor
|
|
||||||
|
|
||||||
// plugin-controlled sensors
|
|
||||||
mjSENS_PLUGIN, // plugin-controlled
|
|
||||||
|
|
||||||
// user-defined sensor
|
|
||||||
mjSENS_USER // sensor data provided by mjcb_sensor callback
|
|
||||||
} mjtSensor;
|
|
||||||
typedef enum mjtStage_ { // computation stage
|
|
||||||
mjSTAGE_NONE = 0, // no computations
|
|
||||||
mjSTAGE_POS, // position-dependent computations
|
|
||||||
mjSTAGE_VEL, // velocity-dependent computations
|
|
||||||
mjSTAGE_ACC // acceleration/force-dependent computations
|
|
||||||
} mjtStage;
|
|
||||||
typedef enum mjtDataType_ { // data type for sensors
|
|
||||||
mjDATATYPE_REAL = 0, // real values, no constraints
|
|
||||||
mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive
|
|
||||||
mjDATATYPE_AXIS, // 3D unit vector
|
|
||||||
mjDATATYPE_QUATERNION // unit quaternion
|
|
||||||
} mjtDataType;
|
|
||||||
typedef enum mjtConDataField_ { // data fields returned by contact sensors
|
|
||||||
mjCONDATA_FOUND = 0, // whether a contact was found
|
|
||||||
mjCONDATA_FORCE, // contact force
|
|
||||||
mjCONDATA_TORQUE, // contact torque
|
|
||||||
mjCONDATA_DIST, // contact penetration distance
|
|
||||||
mjCONDATA_POS, // contact position
|
|
||||||
mjCONDATA_NORMAL, // contact frame normal
|
|
||||||
mjCONDATA_TANGENT, // contact frame first tangent
|
|
||||||
|
|
||||||
mjNCONDATA // number of contact sensor data fields
|
|
||||||
} mjtConDataField;
|
|
||||||
typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors
|
|
||||||
mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface
|
|
||||||
mjRAYDATA_DIR, // normalized ray direction
|
|
||||||
mjRAYDATA_ORIGIN, // ray origin
|
|
||||||
mjRAYDATA_POINT, // point at which ray intersects nearest surface
|
|
||||||
mjRAYDATA_NORMAL, // surface normal at intersection point
|
|
||||||
mjRAYDATA_DEPTH, // depth along z-axis
|
|
||||||
|
|
||||||
mjNRAYDATA // number of rangefinder sensor data fields
|
|
||||||
} mjtRayDataField;
|
|
||||||
typedef enum mjtCamOutBit_ { // camera output type bitflags
|
|
||||||
mjCAMOUT_RGB = 1<<0, // RGB image
|
|
||||||
mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane)
|
|
||||||
mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin)
|
|
||||||
mjCAMOUT_NORMAL = 1<<3, // normal image
|
|
||||||
mjCAMOUT_SEG = 1<<4, // segmentation image
|
|
||||||
|
|
||||||
mjNCAMOUT = 5 // number of camera output types
|
|
||||||
} mjtCamOutBit;
|
|
||||||
typedef enum mjtSameFrame_ { // frame alignment of bodies with their children
|
|
||||||
mjSAMEFRAME_NONE = 0, // no alignment
|
|
||||||
mjSAMEFRAME_BODY, // frame is same as body frame
|
|
||||||
mjSAMEFRAME_INERTIA, // frame is same as inertial frame
|
|
||||||
mjSAMEFRAME_BODYROT, // frame orientation is same as body orientation
|
|
||||||
mjSAMEFRAME_INERTIAROT // frame orientation is same as inertia orientation
|
|
||||||
} mjtSameFrame;
|
|
||||||
typedef enum mjtSleepPolicy_ { // per-tree sleep policy
|
|
||||||
mjSLEEP_AUTO = 0, // compiler chooses sleep policy
|
|
||||||
mjSLEEP_AUTO_NEVER, // compiler sleep policy: never
|
|
||||||
mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed
|
|
||||||
mjSLEEP_NEVER, // user sleep policy: never
|
|
||||||
mjSLEEP_ALLOWED, // user sleep policy: allowed
|
|
||||||
mjSLEEP_INIT, // user sleep policy: initialized asleep
|
|
||||||
} mjtSleepPolicy;
|
|
||||||
typedef enum mjtLRMode_ { // mode for actuator length range computation
|
|
||||||
mjLRMODE_NONE = 0, // do not process any actuators
|
|
||||||
mjLRMODE_MUSCLE, // process muscle actuators
|
|
||||||
mjLRMODE_MUSCLEUSER, // process muscle and user actuators
|
|
||||||
mjLRMODE_ALL // process all actuators
|
|
||||||
} mjtLRMode;
|
|
||||||
typedef enum mjtFlexSelf_ { // mode for flex selfcollide
|
|
||||||
mjFLEXSELF_NONE = 0, // no self-collisions
|
|
||||||
mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase
|
|
||||||
mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled)
|
|
||||||
mjFLEXSELF_SAP, // use SAP in midphase
|
|
||||||
mjFLEXSELF_AUTO // choose between BVH and SAP automatically
|
|
||||||
} mjtFlexSelf;
|
|
||||||
typedef enum mjtSDFType_ { // signed distance function (SDF) type
|
|
||||||
mjSDFTYPE_SINGLE = 0, // single SDF
|
|
||||||
mjSDFTYPE_INTERSECTION, // max(A, B)
|
|
||||||
mjSDFTYPE_MIDSURFACE, // A - B
|
|
||||||
mjSDFTYPE_COLLISION, // A + B + abs(max(A, B))
|
|
||||||
} mjtSDFType;
|
|
||||||
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)
|
||||||
@@ -2609,6 +2161,454 @@ struct mjTask_ { // a task that can be executed by a thread pool.
|
|||||||
volatile int status; // status of the task
|
volatile int status; // status of the task
|
||||||
};
|
};
|
||||||
typedef struct mjTask_ mjTask;
|
typedef struct mjTask_ mjTask;
|
||||||
|
typedef enum mjtDisableBit_ { // disable default feature bitflags
|
||||||
|
mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver
|
||||||
|
mjDSBL_EQUALITY = 1<<1, // equality constraints
|
||||||
|
mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints
|
||||||
|
mjDSBL_LIMIT = 1<<3, // joint and tendon limit constraints
|
||||||
|
mjDSBL_CONTACT = 1<<4, // contact constraints
|
||||||
|
mjDSBL_SPRING = 1<<5, // passive spring forces
|
||||||
|
mjDSBL_DAMPER = 1<<6, // passive damping forces
|
||||||
|
mjDSBL_GRAVITY = 1<<7, // gravitational forces
|
||||||
|
mjDSBL_CLAMPCTRL = 1<<8, // clamp control to specified range
|
||||||
|
mjDSBL_WARMSTART = 1<<9, // warmstart constraint solver
|
||||||
|
mjDSBL_FILTERPARENT = 1<<10, // remove collisions with parent body
|
||||||
|
mjDSBL_ACTUATION = 1<<11, // apply actuation forces
|
||||||
|
mjDSBL_REFSAFE = 1<<12, // integrator safety: make ref[0]>=2*timestep
|
||||||
|
mjDSBL_SENSOR = 1<<13, // sensors
|
||||||
|
mjDSBL_MIDPHASE = 1<<14, // mid-phase collision filtering
|
||||||
|
mjDSBL_EULERDAMP = 1<<15, // implicit integration of joint damping in Euler integrator
|
||||||
|
mjDSBL_AUTORESET = 1<<16, // automatic reset when numerical issues are detected
|
||||||
|
mjDSBL_NATIVECCD = 1<<17, // native convex collision detection
|
||||||
|
mjDSBL_ISLAND = 1<<18, // constraint island discovery
|
||||||
|
mjDSBL_MULTICCD = 1<<19, // multiple CCD contact points
|
||||||
|
|
||||||
|
mjNDISABLE = 20 // number of disable flags
|
||||||
|
} mjtDisableBit;
|
||||||
|
typedef enum mjtEnableBit_ { // enable optional feature bitflags
|
||||||
|
mjENBL_OVERRIDE = 1<<0, // override contact parameters
|
||||||
|
mjENBL_ENERGY = 1<<1, // energy computation
|
||||||
|
mjENBL_FWDINV = 1<<2, // record solver statistics
|
||||||
|
mjENBL_INVDISCRETE = 1<<3, // discrete-time inverse dynamics
|
||||||
|
mjENBL_SLEEP = 1<<4, // sleeping
|
||||||
|
mjENBL_DIAGEXACT = 1<<5, // exact diagonal of constraint inertia
|
||||||
|
|
||||||
|
mjNENABLE = 6 // number of enable flags
|
||||||
|
} mjtEnableBit;
|
||||||
|
typedef enum mjtJoint_ { // type of degree of freedom
|
||||||
|
mjJNT_FREE = 0, // global position and orientation (quat) (7)
|
||||||
|
mjJNT_BALL, // orientation (quat) relative to parent (4)
|
||||||
|
mjJNT_SLIDE, // sliding distance along body-fixed axis (1)
|
||||||
|
mjJNT_HINGE // rotation angle (rad) around body-fixed axis (1)
|
||||||
|
} mjtJoint;
|
||||||
|
typedef enum mjtGeom_ { // type of geometric shape
|
||||||
|
// regular geom types
|
||||||
|
mjGEOM_PLANE = 0, // plane
|
||||||
|
mjGEOM_HFIELD, // height field
|
||||||
|
mjGEOM_SPHERE, // sphere
|
||||||
|
mjGEOM_CAPSULE, // capsule
|
||||||
|
mjGEOM_ELLIPSOID, // ellipsoid
|
||||||
|
mjGEOM_CYLINDER, // cylinder
|
||||||
|
mjGEOM_BOX, // box
|
||||||
|
mjGEOM_MESH, // mesh
|
||||||
|
mjGEOM_SDF, // signed distance field
|
||||||
|
|
||||||
|
mjNGEOMTYPES, // number of regular geom types
|
||||||
|
|
||||||
|
// rendering-only geom types: not used in mjModel, not counted in mjNGEOMTYPES
|
||||||
|
mjGEOM_ARROW = 100, // arrow
|
||||||
|
mjGEOM_ARROW1, // arrow without wedges
|
||||||
|
mjGEOM_ARROW2, // arrow in both directions
|
||||||
|
mjGEOM_LINE, // line
|
||||||
|
mjGEOM_LINEBOX, // box with line edges
|
||||||
|
mjGEOM_FLEX, // flex
|
||||||
|
mjGEOM_SKIN, // skin
|
||||||
|
mjGEOM_LABEL, // text label
|
||||||
|
mjGEOM_TRIANGLE, // triangle
|
||||||
|
|
||||||
|
mjGEOM_NONE = 1001 // missing geom type
|
||||||
|
} mjtGeom;
|
||||||
|
typedef enum mjtProjection_ { // type of camera projection
|
||||||
|
mjPROJ_PERSPECTIVE = 0, // perspective
|
||||||
|
mjPROJ_ORTHOGRAPHIC // orthographic
|
||||||
|
} mjtProjection;
|
||||||
|
typedef enum mjtCamLight_ { // tracking mode for camera and light
|
||||||
|
mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body
|
||||||
|
mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global
|
||||||
|
mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body
|
||||||
|
mjCAMLIGHT_TARGETBODY, // pos fixed in body, rot tracks target body
|
||||||
|
mjCAMLIGHT_TARGETBODYCOM // pos fixed in body, rot tracks target subtree com
|
||||||
|
} mjtCamLight;
|
||||||
|
typedef enum mjtLightType_ { // type of light
|
||||||
|
mjLIGHT_SPOT = 0, // spot
|
||||||
|
mjLIGHT_DIRECTIONAL, // directional
|
||||||
|
mjLIGHT_POINT, // point
|
||||||
|
mjLIGHT_IMAGE, // image-based
|
||||||
|
} mjtLightType;
|
||||||
|
typedef enum mjtTexture_ { // type of texture
|
||||||
|
mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields
|
||||||
|
mjTEXTURE_CUBE, // cube texture, suitable for all other geom types
|
||||||
|
mjTEXTURE_SKYBOX // cube texture used as skybox
|
||||||
|
} mjtTexture;
|
||||||
|
typedef enum mjtTextureRole_ { // role of texture map in rendering
|
||||||
|
mjTEXROLE_USER = 0, // unspecified
|
||||||
|
mjTEXROLE_RGB, // base color (albedo)
|
||||||
|
mjTEXROLE_OCCLUSION, // ambient occlusion
|
||||||
|
mjTEXROLE_ROUGHNESS, // roughness
|
||||||
|
mjTEXROLE_METALLIC, // metallic
|
||||||
|
mjTEXROLE_NORMAL, // normal (bump) map
|
||||||
|
mjTEXROLE_OPACITY, // opacity
|
||||||
|
mjTEXROLE_EMISSIVE, // light emission
|
||||||
|
mjTEXROLE_RGBA, // base color, opacity
|
||||||
|
mjTEXROLE_ORM, // occlusion, roughness, metallic
|
||||||
|
mjNTEXROLE
|
||||||
|
} mjtTextureRole;
|
||||||
|
typedef enum mjtColorSpace_ { // type of color space encoding
|
||||||
|
mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear
|
||||||
|
mjCOLORSPACE_LINEAR, // linear color space
|
||||||
|
mjCOLORSPACE_SRGB // standard RGB color space
|
||||||
|
} mjtColorSpace;
|
||||||
|
typedef enum mjtIntegrator_ { // integrator mode
|
||||||
|
mjINT_EULER = 0, // semi-implicit Euler
|
||||||
|
mjINT_RK4, // 4th-order Runge Kutta
|
||||||
|
mjINT_IMPLICIT, // implicit in velocity
|
||||||
|
mjINT_IMPLICITFAST // implicit in velocity, no rne derivative
|
||||||
|
} mjtIntegrator;
|
||||||
|
typedef enum mjtCone_ { // type of friction cone
|
||||||
|
mjCONE_PYRAMIDAL = 0, // pyramidal
|
||||||
|
mjCONE_ELLIPTIC // elliptic
|
||||||
|
} mjtCone;
|
||||||
|
typedef enum mjtJacobian_ { // type of constraint Jacobian
|
||||||
|
mjJAC_DENSE = 0, // dense
|
||||||
|
mjJAC_SPARSE, // sparse
|
||||||
|
mjJAC_AUTO // dense if nv<60, sparse otherwise
|
||||||
|
} mjtJacobian;
|
||||||
|
typedef enum mjtSolver_ { // constraint solver algorithm
|
||||||
|
mjSOL_PGS = 0, // PGS (dual)
|
||||||
|
mjSOL_CG, // CG (primal)
|
||||||
|
mjSOL_NEWTON // Newton (primal)
|
||||||
|
} mjtSolver;
|
||||||
|
typedef enum mjtEq_ { // type of equality constraint
|
||||||
|
mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint)
|
||||||
|
mjEQ_WELD, // fix relative position and orientation of two bodies
|
||||||
|
mjEQ_JOINT, // couple the values of two scalar joints with cubic
|
||||||
|
mjEQ_TENDON, // couple the lengths of two tendons with cubic
|
||||||
|
mjEQ_FLEX, // fix all edge lengths of a flex
|
||||||
|
mjEQ_FLEXVERT, // fix all vertex lengths of a flex
|
||||||
|
mjEQ_FLEXSTRAIN, // constrain strain of a trilinear/quadratic flex (B-bar)
|
||||||
|
mjEQ_DISTANCE // unsupported, will cause an error if used
|
||||||
|
} mjtEq;
|
||||||
|
typedef enum mjtWrap_ { // type of tendon wrap object
|
||||||
|
mjWRAP_NONE = 0, // null object
|
||||||
|
mjWRAP_JOINT, // constant moment arm
|
||||||
|
mjWRAP_PULLEY, // pulley used to split tendon
|
||||||
|
mjWRAP_SITE, // pass through site
|
||||||
|
mjWRAP_SPHERE, // wrap around sphere
|
||||||
|
mjWRAP_CYLINDER // wrap around (infinite) cylinder
|
||||||
|
} mjtWrap;
|
||||||
|
typedef enum mjtTrn_ { // type of actuator transmission
|
||||||
|
mjTRN_JOINT = 0, // force on joint
|
||||||
|
mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame
|
||||||
|
mjTRN_SLIDERCRANK, // force via slider-crank linkage
|
||||||
|
mjTRN_TENDON, // force on tendon
|
||||||
|
mjTRN_SITE, // force on site
|
||||||
|
mjTRN_BODY, // adhesion force on a body's geoms
|
||||||
|
|
||||||
|
mjTRN_UNDEFINED = 1000 // undefined transmission type
|
||||||
|
} mjtTrn;
|
||||||
|
typedef enum mjtDyn_ { // type of actuator dynamics
|
||||||
|
mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force
|
||||||
|
mjDYN_INTEGRATOR, // integrator: da/dt = u
|
||||||
|
mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau
|
||||||
|
mjDYN_FILTEREXACT, // linear filter: da/dt = (u-a) / tau, with exact integration
|
||||||
|
mjDYN_MUSCLE, // piecewise linear filter with two time constants
|
||||||
|
mjDYN_DCMOTOR, // DC motor electrical dynamics
|
||||||
|
mjDYN_USER // user-defined dynamics type
|
||||||
|
} mjtDyn;
|
||||||
|
typedef enum mjtGain_ { // type of actuator gain
|
||||||
|
mjGAIN_FIXED = 0, // fixed gain
|
||||||
|
mjGAIN_AFFINE, // const + kp*length + kv*velocity
|
||||||
|
mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain()
|
||||||
|
mjGAIN_DCMOTOR, // DC motor gain: K or K/R
|
||||||
|
mjGAIN_USER // user-defined gain type
|
||||||
|
} mjtGain;
|
||||||
|
typedef enum mjtBias_ { // type of actuator bias
|
||||||
|
mjBIAS_NONE = 0, // no bias
|
||||||
|
mjBIAS_AFFINE, // const + kp*length + kv*velocity
|
||||||
|
mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias()
|
||||||
|
mjBIAS_DCMOTOR, // DC motor bias: back-EMF, cogging, LuGre friction
|
||||||
|
mjBIAS_USER // user-defined bias type
|
||||||
|
} mjtBias;
|
||||||
|
typedef enum mjtObj_ { // type of MujoCo object
|
||||||
|
mjOBJ_UNKNOWN = 0, // unknown object type
|
||||||
|
mjOBJ_BODY, // body
|
||||||
|
mjOBJ_XBODY, // body, used to access regular frame instead of i-frame
|
||||||
|
mjOBJ_JOINT, // joint
|
||||||
|
mjOBJ_DOF, // dof
|
||||||
|
mjOBJ_GEOM, // geom
|
||||||
|
mjOBJ_SITE, // site
|
||||||
|
mjOBJ_CAMERA, // camera
|
||||||
|
mjOBJ_LIGHT, // light
|
||||||
|
mjOBJ_FLEX, // flex
|
||||||
|
mjOBJ_MESH, // mesh
|
||||||
|
mjOBJ_SKIN, // skin
|
||||||
|
mjOBJ_HFIELD, // heightfield
|
||||||
|
mjOBJ_TEXTURE, // texture
|
||||||
|
mjOBJ_MATERIAL, // material for rendering
|
||||||
|
mjOBJ_PAIR, // geom pair to include
|
||||||
|
mjOBJ_EXCLUDE, // body pair to exclude
|
||||||
|
mjOBJ_EQUALITY, // equality constraint
|
||||||
|
mjOBJ_TENDON, // tendon
|
||||||
|
mjOBJ_ACTUATOR, // actuator
|
||||||
|
mjOBJ_SENSOR, // sensor
|
||||||
|
mjOBJ_NUMERIC, // numeric
|
||||||
|
mjOBJ_TEXT, // text
|
||||||
|
mjOBJ_TUPLE, // tuple
|
||||||
|
mjOBJ_KEY, // keyframe
|
||||||
|
mjOBJ_PLUGIN, // plugin instance
|
||||||
|
|
||||||
|
mjNOBJECT, // number of object types
|
||||||
|
|
||||||
|
// meta elements, do not appear in mjModel
|
||||||
|
mjOBJ_FRAME = 100, // frame
|
||||||
|
mjOBJ_DEFAULT, // default
|
||||||
|
mjOBJ_MODEL // entire model
|
||||||
|
} mjtObj;
|
||||||
|
typedef enum mjtSensor_ { // type of sensor
|
||||||
|
// common robotic sensors, attached to a site
|
||||||
|
mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone
|
||||||
|
mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame
|
||||||
|
mjSENS_VELOCIMETER, // 3D linear velocity, in local frame
|
||||||
|
mjSENS_GYRO, // 3D angular velocity, in local frame
|
||||||
|
mjSENS_FORCE, // 3D force between site's body and its parent body
|
||||||
|
mjSENS_TORQUE, // 3D torque between site's body and its parent body
|
||||||
|
mjSENS_MAGNETOMETER, // 3D magnetometer
|
||||||
|
mjSENS_RANGEFINDER, // scalar distance to nearest geom along z-axis
|
||||||
|
mjSENS_CAMPROJECTION, // pixel coordinates of a site in the camera image
|
||||||
|
|
||||||
|
// sensors related to scalar joints, tendons, actuators
|
||||||
|
mjSENS_JOINTPOS, // scalar joint position (hinge and slide only)
|
||||||
|
mjSENS_JOINTVEL, // scalar joint velocity (hinge and slide only)
|
||||||
|
mjSENS_TENDONPOS, // scalar tendon position
|
||||||
|
mjSENS_TENDONVEL, // scalar tendon velocity
|
||||||
|
mjSENS_ACTUATORPOS, // scalar actuator position
|
||||||
|
mjSENS_ACTUATORVEL, // scalar actuator velocity
|
||||||
|
mjSENS_ACTUATORFRC, // scalar actuator force
|
||||||
|
mjSENS_JOINTACTFRC, // scalar actuator force, measured at the joint
|
||||||
|
mjSENS_TENDONACTFRC, // scalar actuator force, measured at the tendon
|
||||||
|
|
||||||
|
// sensors related to ball joints
|
||||||
|
mjSENS_BALLQUAT, // 4D ball joint quaternion
|
||||||
|
mjSENS_BALLANGVEL, // 3D ball joint angular velocity
|
||||||
|
|
||||||
|
// joint and tendon limit sensors, in constraint space
|
||||||
|
mjSENS_JOINTLIMITPOS, // joint limit distance-margin
|
||||||
|
mjSENS_JOINTLIMITVEL, // joint limit velocity
|
||||||
|
mjSENS_JOINTLIMITFRC, // joint limit force
|
||||||
|
mjSENS_TENDONLIMITPOS, // tendon limit distance-margin
|
||||||
|
mjSENS_TENDONLIMITVEL, // tendon limit velocity
|
||||||
|
mjSENS_TENDONLIMITFRC, // tendon limit force
|
||||||
|
|
||||||
|
// sensors attached to an object with spatial frame: (x)body, geom, site, camera
|
||||||
|
mjSENS_FRAMEPOS, // 3D position
|
||||||
|
mjSENS_FRAMEQUAT, // 4D unit quaternion orientation
|
||||||
|
mjSENS_FRAMEXAXIS, // 3D unit vector: x-axis of object's frame
|
||||||
|
mjSENS_FRAMEYAXIS, // 3D unit vector: y-axis of object's frame
|
||||||
|
mjSENS_FRAMEZAXIS, // 3D unit vector: z-axis of object's frame
|
||||||
|
mjSENS_FRAMELINVEL, // 3D linear velocity
|
||||||
|
mjSENS_FRAMEANGVEL, // 3D angular velocity
|
||||||
|
mjSENS_FRAMELINACC, // 3D linear acceleration
|
||||||
|
mjSENS_FRAMEANGACC, // 3D angular acceleration
|
||||||
|
|
||||||
|
// sensors related to kinematic subtrees; attached to a body (which is the subtree root)
|
||||||
|
mjSENS_SUBTREECOM, // 3D center of mass of subtree
|
||||||
|
mjSENS_SUBTREELINVEL, // 3D linear velocity of subtree
|
||||||
|
mjSENS_SUBTREEANGMOM, // 3D angular momentum of subtree
|
||||||
|
|
||||||
|
// sensors of geometric relationships
|
||||||
|
mjSENS_INSIDESITE, // 1 if object is inside a site, 0 otherwise
|
||||||
|
mjSENS_GEOMDIST, // signed distance between two geoms
|
||||||
|
mjSENS_GEOMNORMAL, // normal direction between two geoms
|
||||||
|
mjSENS_GEOMFROMTO, // segment between two geoms
|
||||||
|
|
||||||
|
// sensors for reporting contacts which occurred during the simulation
|
||||||
|
mjSENS_CONTACT, // contacts which occurred during the simulation
|
||||||
|
|
||||||
|
// global sensors
|
||||||
|
mjSENS_E_POTENTIAL, // potential energy
|
||||||
|
mjSENS_E_KINETIC, // kinetic energy
|
||||||
|
mjSENS_CLOCK, // simulation time
|
||||||
|
|
||||||
|
// sensors related to SDFs
|
||||||
|
mjSENS_TACTILE, // tactile sensor
|
||||||
|
|
||||||
|
// plugin-controlled sensors
|
||||||
|
mjSENS_PLUGIN, // plugin-controlled
|
||||||
|
|
||||||
|
// user-defined sensor
|
||||||
|
mjSENS_USER // sensor data provided by mjcb_sensor callback
|
||||||
|
} mjtSensor;
|
||||||
|
typedef enum mjtStage_ { // computation stage
|
||||||
|
mjSTAGE_NONE = 0, // no computations
|
||||||
|
mjSTAGE_POS, // position-dependent computations
|
||||||
|
mjSTAGE_VEL, // velocity-dependent computations
|
||||||
|
mjSTAGE_ACC // acceleration/force-dependent computations
|
||||||
|
} mjtStage;
|
||||||
|
typedef enum mjtDataType_ { // data type for sensors
|
||||||
|
mjDATATYPE_REAL = 0, // real values, no constraints
|
||||||
|
mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive
|
||||||
|
mjDATATYPE_AXIS, // 3D unit vector
|
||||||
|
mjDATATYPE_QUATERNION // unit quaternion
|
||||||
|
} mjtDataType;
|
||||||
|
typedef enum mjtConDataField_ { // data fields returned by contact sensors
|
||||||
|
mjCONDATA_FOUND = 0, // whether a contact was found
|
||||||
|
mjCONDATA_FORCE, // contact force
|
||||||
|
mjCONDATA_TORQUE, // contact torque
|
||||||
|
mjCONDATA_DIST, // contact penetration distance
|
||||||
|
mjCONDATA_POS, // contact position
|
||||||
|
mjCONDATA_NORMAL, // contact frame normal
|
||||||
|
mjCONDATA_TANGENT, // contact frame first tangent
|
||||||
|
|
||||||
|
mjNCONDATA // number of contact sensor data fields
|
||||||
|
} mjtConDataField;
|
||||||
|
typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors
|
||||||
|
mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface
|
||||||
|
mjRAYDATA_DIR, // normalized ray direction
|
||||||
|
mjRAYDATA_ORIGIN, // ray origin
|
||||||
|
mjRAYDATA_POINT, // point at which ray intersects nearest surface
|
||||||
|
mjRAYDATA_NORMAL, // surface normal at intersection point
|
||||||
|
mjRAYDATA_DEPTH, // depth along z-axis
|
||||||
|
|
||||||
|
mjNRAYDATA // number of rangefinder sensor data fields
|
||||||
|
} mjtRayDataField;
|
||||||
|
typedef enum mjtCamOutBit_ { // camera output type bitflags
|
||||||
|
mjCAMOUT_RGB = 1<<0, // RGB image
|
||||||
|
mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane)
|
||||||
|
mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin)
|
||||||
|
mjCAMOUT_NORMAL = 1<<3, // normal image
|
||||||
|
mjCAMOUT_SEG = 1<<4, // segmentation image
|
||||||
|
|
||||||
|
mjNCAMOUT = 5 // number of camera output types
|
||||||
|
} mjtCamOutBit;
|
||||||
|
typedef enum mjtSameFrame_ { // frame alignment of bodies with their children
|
||||||
|
mjSAMEFRAME_NONE = 0, // no alignment
|
||||||
|
mjSAMEFRAME_BODY, // frame is same as body frame
|
||||||
|
mjSAMEFRAME_INERTIA, // frame is same as inertial frame
|
||||||
|
mjSAMEFRAME_BODYROT, // frame orientation is same as body orientation
|
||||||
|
mjSAMEFRAME_INERTIAROT // frame orientation is same as inertia orientation
|
||||||
|
} mjtSameFrame;
|
||||||
|
typedef enum mjtSleepPolicy_ { // per-tree sleep policy
|
||||||
|
mjSLEEP_AUTO = 0, // compiler chooses sleep policy
|
||||||
|
mjSLEEP_AUTO_NEVER, // compiler sleep policy: never
|
||||||
|
mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed
|
||||||
|
mjSLEEP_NEVER, // user sleep policy: never
|
||||||
|
mjSLEEP_ALLOWED, // user sleep policy: allowed
|
||||||
|
mjSLEEP_INIT, // user sleep policy: initialized asleep
|
||||||
|
} mjtSleepPolicy;
|
||||||
|
typedef enum mjtLRMode_ { // mode for actuator length range computation
|
||||||
|
mjLRMODE_NONE = 0, // do not process any actuators
|
||||||
|
mjLRMODE_MUSCLE, // process muscle actuators
|
||||||
|
mjLRMODE_MUSCLEUSER, // process muscle and user actuators
|
||||||
|
mjLRMODE_ALL // process all actuators
|
||||||
|
} mjtLRMode;
|
||||||
|
typedef enum mjtFlexSelf_ { // mode for flex selfcollide
|
||||||
|
mjFLEXSELF_NONE = 0, // no self-collisions
|
||||||
|
mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase
|
||||||
|
mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled)
|
||||||
|
mjFLEXSELF_SAP, // use SAP in midphase
|
||||||
|
mjFLEXSELF_AUTO // choose between BVH and SAP automatically
|
||||||
|
} mjtFlexSelf;
|
||||||
|
typedef enum mjtSDFType_ { // signed distance function (SDF) type
|
||||||
|
mjSDFTYPE_SINGLE = 0, // single SDF
|
||||||
|
mjSDFTYPE_INTERSECTION, // max(A, B)
|
||||||
|
mjSDFTYPE_MIDSURFACE, // A - B
|
||||||
|
mjSDFTYPE_COLLISION, // A + B + abs(max(A, B))
|
||||||
|
} mjtSDFType;
|
||||||
|
typedef enum mjtState_ { // state elements
|
||||||
|
mjSTATE_TIME = 1<<0, // time
|
||||||
|
mjSTATE_QPOS = 1<<1, // position
|
||||||
|
mjSTATE_QVEL = 1<<2, // velocity
|
||||||
|
mjSTATE_ACT = 1<<3, // actuator activation
|
||||||
|
mjSTATE_HISTORY = 1<<4, // history buffers (control, sensor)
|
||||||
|
mjSTATE_WARMSTART = 1<<5, // acceleration used for warmstart
|
||||||
|
mjSTATE_CTRL = 1<<6, // control
|
||||||
|
mjSTATE_QFRC_APPLIED = 1<<7, // applied generalized force
|
||||||
|
mjSTATE_XFRC_APPLIED = 1<<8, // applied Cartesian force/torque
|
||||||
|
mjSTATE_EQ_ACTIVE = 1<<9, // enable/disable constraints
|
||||||
|
mjSTATE_MOCAP_POS = 1<<10, // positions of mocap bodies
|
||||||
|
mjSTATE_MOCAP_QUAT = 1<<11, // orientations of mocap bodies
|
||||||
|
mjSTATE_USERDATA = 1<<12, // user data
|
||||||
|
mjSTATE_PLUGIN = 1<<13, // plugin state
|
||||||
|
|
||||||
|
mjNSTATE = 14, // number of state elements
|
||||||
|
|
||||||
|
// convenience values for commonly used state specifications
|
||||||
|
mjSTATE_PHYSICS = mjSTATE_QPOS | mjSTATE_QVEL | mjSTATE_ACT | mjSTATE_HISTORY,
|
||||||
|
mjSTATE_FULLPHYSICS = mjSTATE_TIME | mjSTATE_PHYSICS | mjSTATE_PLUGIN,
|
||||||
|
mjSTATE_USER = mjSTATE_CTRL | mjSTATE_QFRC_APPLIED | mjSTATE_XFRC_APPLIED |
|
||||||
|
mjSTATE_EQ_ACTIVE | mjSTATE_MOCAP_POS | mjSTATE_MOCAP_QUAT |
|
||||||
|
mjSTATE_USERDATA,
|
||||||
|
mjSTATE_INTEGRATION = mjSTATE_FULLPHYSICS | mjSTATE_USER | mjSTATE_WARMSTART
|
||||||
|
} mjtState;
|
||||||
|
typedef enum mjtConstraint_ { // type of constraint
|
||||||
|
mjCNSTR_EQUALITY = 0, // equality constraint
|
||||||
|
mjCNSTR_FRICTION_DOF, // dof friction
|
||||||
|
mjCNSTR_FRICTION_TENDON, // tendon friction
|
||||||
|
mjCNSTR_LIMIT_JOINT, // joint limit
|
||||||
|
mjCNSTR_LIMIT_TENDON, // tendon limit
|
||||||
|
mjCNSTR_CONTACT_FRICTIONLESS, // frictionless contact
|
||||||
|
mjCNSTR_CONTACT_PYRAMIDAL, // frictional contact, pyramidal friction cone
|
||||||
|
mjCNSTR_CONTACT_ELLIPTIC // frictional contact, elliptic friction cone
|
||||||
|
} mjtConstraint;
|
||||||
|
typedef enum mjtConstraintState_ { // constraint state
|
||||||
|
mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact)
|
||||||
|
mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact)
|
||||||
|
mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction)
|
||||||
|
mjCNSTRSTATE_LINEARPOS, // linear cost, positive side (friction)
|
||||||
|
mjCNSTRSTATE_CONE // squared distance to cone cost (elliptic contact)
|
||||||
|
} mjtConstraintState;
|
||||||
|
typedef enum mjtWarning_ { // warning types
|
||||||
|
mjWARN_INERTIA = 0, // (near) singular inertia matrix
|
||||||
|
mjWARN_CONTACTFULL, // too many contacts in contact list
|
||||||
|
mjWARN_CNSTRFULL, // too many constraints
|
||||||
|
mjWARN_BADQPOS, // bad number in qpos
|
||||||
|
mjWARN_BADQVEL, // bad number in qvel
|
||||||
|
mjWARN_BADQACC, // bad number in qacc
|
||||||
|
mjWARN_BADCTRL, // bad number in ctrl
|
||||||
|
|
||||||
|
mjNWARNING // number of warnings
|
||||||
|
} mjtWarning;
|
||||||
|
typedef enum mjtTimer_ { // internal timers
|
||||||
|
// main api
|
||||||
|
mjTIMER_STEP = 0, // step
|
||||||
|
mjTIMER_FORWARD, // forward
|
||||||
|
mjTIMER_INVERSE, // inverse
|
||||||
|
|
||||||
|
// breakdown of step/forward
|
||||||
|
mjTIMER_POSITION, // fwdPosition
|
||||||
|
mjTIMER_VELOCITY, // fwdVelocity
|
||||||
|
mjTIMER_ACTUATION, // fwdActuation
|
||||||
|
mjTIMER_CONSTRAINT, // fwdConstraint
|
||||||
|
mjTIMER_ADVANCE, // mj_Euler, mj_implicit
|
||||||
|
|
||||||
|
// breakdown of fwdPosition
|
||||||
|
mjTIMER_POS_KINEMATICS, // kinematics, com, tendon, transmission
|
||||||
|
mjTIMER_POS_INERTIA, // inertia computations
|
||||||
|
mjTIMER_POS_COLLISION, // collision detection
|
||||||
|
mjTIMER_POS_MAKE, // make constraints
|
||||||
|
mjTIMER_POS_PROJECT, // project constraints
|
||||||
|
|
||||||
|
// breakdown of mj_collision
|
||||||
|
mjTIMER_COL_BROAD, // broadphase
|
||||||
|
mjTIMER_COL_NARROW, // narrowphase
|
||||||
|
|
||||||
|
mjNTIMER // number of timers
|
||||||
|
} mjtTimer;
|
||||||
|
typedef enum mjtSleepState_ { // sleep state of an object
|
||||||
|
mjS_STATIC = -1, // object is static
|
||||||
|
mjS_ASLEEP = 0, // object is asleep
|
||||||
|
mjS_AWAKE = 1 // object is awake
|
||||||
|
} mjtSleepState;
|
||||||
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
|
||||||
|
|||||||
@@ -165,8 +165,9 @@ links below, to make this documentation self-contained.
|
|||||||
Defines the primitive types and structures needed by the OpenGL renderer.
|
Defines the primitive types and structures needed by the OpenGL renderer.
|
||||||
`mjui.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjui.h>`__
|
`mjui.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjui.h>`__
|
||||||
Defines the primitive types and structures needed by the UI framework.
|
Defines the primitive types and structures needed by the UI framework.
|
||||||
`mjtnum.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtnum.h>`__
|
`mjtype.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjtype.h>`__
|
||||||
Defines MuJoCo's ``mjtNum`` floating-point type to be either ``double`` or ``float``. See :ref:`mjtNum`.
|
Defines primitive types and enums, including the ``mjtNum`` floating-point type to be either ``double`` or ``float``
|
||||||
|
(see :ref:`mjtNum`).
|
||||||
`mjspec.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjspec.h>`__
|
`mjspec.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjspec.h>`__
|
||||||
Defines enums and structs used for :doc:`procedural model editing <modeledit>`.
|
Defines enums and structs used for :doc:`procedural model editing <modeledit>`.
|
||||||
`mjplugin.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjplugin.h>`__
|
`mjplugin.h <https://github.com/google-deepmind/mujoco/blob/main/include/mujoco/mjplugin.h>`__
|
||||||
|
|||||||
+1
-98
@@ -18,107 +18,10 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjthread.h>
|
#include <mujoco/mjthread.h>
|
||||||
|
|
||||||
//---------------------------------- primitive types (mjt) -----------------------------------------
|
|
||||||
|
|
||||||
typedef enum mjtState_ { // state elements
|
|
||||||
mjSTATE_TIME = 1<<0, // time
|
|
||||||
mjSTATE_QPOS = 1<<1, // position
|
|
||||||
mjSTATE_QVEL = 1<<2, // velocity
|
|
||||||
mjSTATE_ACT = 1<<3, // actuator activation
|
|
||||||
mjSTATE_HISTORY = 1<<4, // history buffers (control, sensor)
|
|
||||||
mjSTATE_WARMSTART = 1<<5, // acceleration used for warmstart
|
|
||||||
mjSTATE_CTRL = 1<<6, // control
|
|
||||||
mjSTATE_QFRC_APPLIED = 1<<7, // applied generalized force
|
|
||||||
mjSTATE_XFRC_APPLIED = 1<<8, // applied Cartesian force/torque
|
|
||||||
mjSTATE_EQ_ACTIVE = 1<<9, // enable/disable constraints
|
|
||||||
mjSTATE_MOCAP_POS = 1<<10, // positions of mocap bodies
|
|
||||||
mjSTATE_MOCAP_QUAT = 1<<11, // orientations of mocap bodies
|
|
||||||
mjSTATE_USERDATA = 1<<12, // user data
|
|
||||||
mjSTATE_PLUGIN = 1<<13, // plugin state
|
|
||||||
|
|
||||||
mjNSTATE = 14, // number of state elements
|
|
||||||
|
|
||||||
// convenience values for commonly used state specifications
|
|
||||||
mjSTATE_PHYSICS = mjSTATE_QPOS | mjSTATE_QVEL | mjSTATE_ACT | mjSTATE_HISTORY,
|
|
||||||
mjSTATE_FULLPHYSICS = mjSTATE_TIME | mjSTATE_PHYSICS | mjSTATE_PLUGIN,
|
|
||||||
mjSTATE_USER = mjSTATE_CTRL | mjSTATE_QFRC_APPLIED | mjSTATE_XFRC_APPLIED |
|
|
||||||
mjSTATE_EQ_ACTIVE | mjSTATE_MOCAP_POS | mjSTATE_MOCAP_QUAT |
|
|
||||||
mjSTATE_USERDATA,
|
|
||||||
mjSTATE_INTEGRATION = mjSTATE_FULLPHYSICS | mjSTATE_USER | mjSTATE_WARMSTART
|
|
||||||
} mjtState;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtConstraint_ { // type of constraint
|
|
||||||
mjCNSTR_EQUALITY = 0, // equality constraint
|
|
||||||
mjCNSTR_FRICTION_DOF, // dof friction
|
|
||||||
mjCNSTR_FRICTION_TENDON, // tendon friction
|
|
||||||
mjCNSTR_LIMIT_JOINT, // joint limit
|
|
||||||
mjCNSTR_LIMIT_TENDON, // tendon limit
|
|
||||||
mjCNSTR_CONTACT_FRICTIONLESS, // frictionless contact
|
|
||||||
mjCNSTR_CONTACT_PYRAMIDAL, // frictional contact, pyramidal friction cone
|
|
||||||
mjCNSTR_CONTACT_ELLIPTIC // frictional contact, elliptic friction cone
|
|
||||||
} mjtConstraint;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtConstraintState_ { // constraint state
|
|
||||||
mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact)
|
|
||||||
mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact)
|
|
||||||
mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction)
|
|
||||||
mjCNSTRSTATE_LINEARPOS, // linear cost, positive side (friction)
|
|
||||||
mjCNSTRSTATE_CONE // squared distance to cone cost (elliptic contact)
|
|
||||||
} mjtConstraintState;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtWarning_ { // warning types
|
|
||||||
mjWARN_INERTIA = 0, // (near) singular inertia matrix
|
|
||||||
mjWARN_CONTACTFULL, // too many contacts in contact list
|
|
||||||
mjWARN_CNSTRFULL, // too many constraints
|
|
||||||
mjWARN_BADQPOS, // bad number in qpos
|
|
||||||
mjWARN_BADQVEL, // bad number in qvel
|
|
||||||
mjWARN_BADQACC, // bad number in qacc
|
|
||||||
mjWARN_BADCTRL, // bad number in ctrl
|
|
||||||
|
|
||||||
mjNWARNING // number of warnings
|
|
||||||
} mjtWarning;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtTimer_ { // internal timers
|
|
||||||
// main api
|
|
||||||
mjTIMER_STEP = 0, // step
|
|
||||||
mjTIMER_FORWARD, // forward
|
|
||||||
mjTIMER_INVERSE, // inverse
|
|
||||||
|
|
||||||
// breakdown of step/forward
|
|
||||||
mjTIMER_POSITION, // fwdPosition
|
|
||||||
mjTIMER_VELOCITY, // fwdVelocity
|
|
||||||
mjTIMER_ACTUATION, // fwdActuation
|
|
||||||
mjTIMER_CONSTRAINT, // fwdConstraint
|
|
||||||
mjTIMER_ADVANCE, // mj_Euler, mj_implicit
|
|
||||||
|
|
||||||
// breakdown of fwdPosition
|
|
||||||
mjTIMER_POS_KINEMATICS, // kinematics, com, tendon, transmission
|
|
||||||
mjTIMER_POS_INERTIA, // inertia computations
|
|
||||||
mjTIMER_POS_COLLISION, // collision detection
|
|
||||||
mjTIMER_POS_MAKE, // make constraints
|
|
||||||
mjTIMER_POS_PROJECT, // project constraints
|
|
||||||
|
|
||||||
// breakdown of mj_collision
|
|
||||||
mjTIMER_COL_BROAD, // broadphase
|
|
||||||
mjTIMER_COL_NARROW, // narrowphase
|
|
||||||
|
|
||||||
mjNTIMER // number of timers
|
|
||||||
} mjtTimer;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtSleepState_ { // sleep state of an object
|
|
||||||
mjS_STATIC = -1, // object is static
|
|
||||||
mjS_ASLEEP = 0, // object is asleep
|
|
||||||
mjS_AWAKE = 1 // object is awake
|
|
||||||
} mjtSleepState;
|
|
||||||
|
|
||||||
|
|
||||||
//------------------------------------- Contact ----------------------------------------------------
|
//------------------------------------- Contact ----------------------------------------------------
|
||||||
|
|||||||
+1
-430
@@ -18,8 +18,7 @@
|
|||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <stdint.h>
|
#include <stdint.h>
|
||||||
|
|
||||||
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjtnum.h>
|
|
||||||
|
|
||||||
// global constants
|
// global constants
|
||||||
#define mjPI 3.14159265358979323846
|
#define mjPI 3.14159265358979323846
|
||||||
@@ -48,434 +47,6 @@
|
|||||||
#define mjNISLAND 20 // number of mjData.solver arrays
|
#define mjNISLAND 20 // number of mjData.solver arrays
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------- enum types (mjt) ----------------------------------------------
|
|
||||||
|
|
||||||
typedef enum mjtDisableBit_ { // disable default feature bitflags
|
|
||||||
mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver
|
|
||||||
mjDSBL_EQUALITY = 1<<1, // equality constraints
|
|
||||||
mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints
|
|
||||||
mjDSBL_LIMIT = 1<<3, // joint and tendon limit constraints
|
|
||||||
mjDSBL_CONTACT = 1<<4, // contact constraints
|
|
||||||
mjDSBL_SPRING = 1<<5, // passive spring forces
|
|
||||||
mjDSBL_DAMPER = 1<<6, // passive damping forces
|
|
||||||
mjDSBL_GRAVITY = 1<<7, // gravitational forces
|
|
||||||
mjDSBL_CLAMPCTRL = 1<<8, // clamp control to specified range
|
|
||||||
mjDSBL_WARMSTART = 1<<9, // warmstart constraint solver
|
|
||||||
mjDSBL_FILTERPARENT = 1<<10, // remove collisions with parent body
|
|
||||||
mjDSBL_ACTUATION = 1<<11, // apply actuation forces
|
|
||||||
mjDSBL_REFSAFE = 1<<12, // integrator safety: make ref[0]>=2*timestep
|
|
||||||
mjDSBL_SENSOR = 1<<13, // sensors
|
|
||||||
mjDSBL_MIDPHASE = 1<<14, // mid-phase collision filtering
|
|
||||||
mjDSBL_EULERDAMP = 1<<15, // implicit integration of joint damping in Euler integrator
|
|
||||||
mjDSBL_AUTORESET = 1<<16, // automatic reset when numerical issues are detected
|
|
||||||
mjDSBL_NATIVECCD = 1<<17, // native convex collision detection
|
|
||||||
mjDSBL_ISLAND = 1<<18, // constraint island discovery
|
|
||||||
mjDSBL_MULTICCD = 1<<19, // multiple CCD contact points
|
|
||||||
|
|
||||||
mjNDISABLE = 20 // number of disable flags
|
|
||||||
} mjtDisableBit;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtEnableBit_ { // enable optional feature bitflags
|
|
||||||
mjENBL_OVERRIDE = 1<<0, // override contact parameters
|
|
||||||
mjENBL_ENERGY = 1<<1, // energy computation
|
|
||||||
mjENBL_FWDINV = 1<<2, // record solver statistics
|
|
||||||
mjENBL_INVDISCRETE = 1<<3, // discrete-time inverse dynamics
|
|
||||||
mjENBL_SLEEP = 1<<4, // sleeping
|
|
||||||
mjENBL_DIAGEXACT = 1<<5, // exact diagonal of constraint inertia
|
|
||||||
|
|
||||||
mjNENABLE = 6 // number of enable flags
|
|
||||||
} mjtEnableBit;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtJoint_ { // type of degree of freedom
|
|
||||||
mjJNT_FREE = 0, // global position and orientation (quat) (7)
|
|
||||||
mjJNT_BALL, // orientation (quat) relative to parent (4)
|
|
||||||
mjJNT_SLIDE, // sliding distance along body-fixed axis (1)
|
|
||||||
mjJNT_HINGE // rotation angle (rad) around body-fixed axis (1)
|
|
||||||
} mjtJoint;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtGeom_ { // type of geometric shape
|
|
||||||
// regular geom types
|
|
||||||
mjGEOM_PLANE = 0, // plane
|
|
||||||
mjGEOM_HFIELD, // height field
|
|
||||||
mjGEOM_SPHERE, // sphere
|
|
||||||
mjGEOM_CAPSULE, // capsule
|
|
||||||
mjGEOM_ELLIPSOID, // ellipsoid
|
|
||||||
mjGEOM_CYLINDER, // cylinder
|
|
||||||
mjGEOM_BOX, // box
|
|
||||||
mjGEOM_MESH, // mesh
|
|
||||||
mjGEOM_SDF, // signed distance field
|
|
||||||
|
|
||||||
mjNGEOMTYPES, // number of regular geom types
|
|
||||||
|
|
||||||
// rendering-only geom types: not used in mjModel, not counted in mjNGEOMTYPES
|
|
||||||
mjGEOM_ARROW = 100, // arrow
|
|
||||||
mjGEOM_ARROW1, // arrow without wedges
|
|
||||||
mjGEOM_ARROW2, // arrow in both directions
|
|
||||||
mjGEOM_LINE, // line
|
|
||||||
mjGEOM_LINEBOX, // box with line edges
|
|
||||||
mjGEOM_FLEX, // flex
|
|
||||||
mjGEOM_SKIN, // skin
|
|
||||||
mjGEOM_LABEL, // text label
|
|
||||||
mjGEOM_TRIANGLE, // triangle
|
|
||||||
|
|
||||||
mjGEOM_NONE = 1001 // missing geom type
|
|
||||||
} mjtGeom;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtProjection_ { // type of camera projection
|
|
||||||
mjPROJ_PERSPECTIVE = 0, // perspective
|
|
||||||
mjPROJ_ORTHOGRAPHIC // orthographic
|
|
||||||
} mjtProjection;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtCamLight_ { // tracking mode for camera and light
|
|
||||||
mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body
|
|
||||||
mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global
|
|
||||||
mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body
|
|
||||||
mjCAMLIGHT_TARGETBODY, // pos fixed in body, rot tracks target body
|
|
||||||
mjCAMLIGHT_TARGETBODYCOM // pos fixed in body, rot tracks target subtree com
|
|
||||||
} mjtCamLight;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtLightType_ { // type of light
|
|
||||||
mjLIGHT_SPOT = 0, // spot
|
|
||||||
mjLIGHT_DIRECTIONAL, // directional
|
|
||||||
mjLIGHT_POINT, // point
|
|
||||||
mjLIGHT_IMAGE, // image-based
|
|
||||||
} mjtLightType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtTexture_ { // type of texture
|
|
||||||
mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields
|
|
||||||
mjTEXTURE_CUBE, // cube texture, suitable for all other geom types
|
|
||||||
mjTEXTURE_SKYBOX // cube texture used as skybox
|
|
||||||
} mjtTexture;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtTextureRole_ { // role of texture map in rendering
|
|
||||||
mjTEXROLE_USER = 0, // unspecified
|
|
||||||
mjTEXROLE_RGB, // base color (albedo)
|
|
||||||
mjTEXROLE_OCCLUSION, // ambient occlusion
|
|
||||||
mjTEXROLE_ROUGHNESS, // roughness
|
|
||||||
mjTEXROLE_METALLIC, // metallic
|
|
||||||
mjTEXROLE_NORMAL, // normal (bump) map
|
|
||||||
mjTEXROLE_OPACITY, // opacity
|
|
||||||
mjTEXROLE_EMISSIVE, // light emission
|
|
||||||
mjTEXROLE_RGBA, // base color, opacity
|
|
||||||
mjTEXROLE_ORM, // occlusion, roughness, metallic
|
|
||||||
mjNTEXROLE
|
|
||||||
} mjtTextureRole;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtColorSpace_ { // type of color space encoding
|
|
||||||
mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear
|
|
||||||
mjCOLORSPACE_LINEAR, // linear color space
|
|
||||||
mjCOLORSPACE_SRGB // standard RGB color space
|
|
||||||
} mjtColorSpace;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtIntegrator_ { // integrator mode
|
|
||||||
mjINT_EULER = 0, // semi-implicit Euler
|
|
||||||
mjINT_RK4, // 4th-order Runge Kutta
|
|
||||||
mjINT_IMPLICIT, // implicit in velocity
|
|
||||||
mjINT_IMPLICITFAST // implicit in velocity, no rne derivative
|
|
||||||
} mjtIntegrator;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtCone_ { // type of friction cone
|
|
||||||
mjCONE_PYRAMIDAL = 0, // pyramidal
|
|
||||||
mjCONE_ELLIPTIC // elliptic
|
|
||||||
} mjtCone;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtJacobian_ { // type of constraint Jacobian
|
|
||||||
mjJAC_DENSE = 0, // dense
|
|
||||||
mjJAC_SPARSE, // sparse
|
|
||||||
mjJAC_AUTO // dense if nv<60, sparse otherwise
|
|
||||||
} mjtJacobian;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtSolver_ { // constraint solver algorithm
|
|
||||||
mjSOL_PGS = 0, // PGS (dual)
|
|
||||||
mjSOL_CG, // CG (primal)
|
|
||||||
mjSOL_NEWTON // Newton (primal)
|
|
||||||
} mjtSolver;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtEq_ { // type of equality constraint
|
|
||||||
mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint)
|
|
||||||
mjEQ_WELD, // fix relative position and orientation of two bodies
|
|
||||||
mjEQ_JOINT, // couple the values of two scalar joints with cubic
|
|
||||||
mjEQ_TENDON, // couple the lengths of two tendons with cubic
|
|
||||||
mjEQ_FLEX, // fix all edge lengths of a flex
|
|
||||||
mjEQ_FLEXVERT, // fix all vertex lengths of a flex
|
|
||||||
mjEQ_FLEXSTRAIN, // constrain strain of a trilinear/quadratic flex (B-bar)
|
|
||||||
mjEQ_DISTANCE // unsupported, will cause an error if used
|
|
||||||
} mjtEq;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtWrap_ { // type of tendon wrap object
|
|
||||||
mjWRAP_NONE = 0, // null object
|
|
||||||
mjWRAP_JOINT, // constant moment arm
|
|
||||||
mjWRAP_PULLEY, // pulley used to split tendon
|
|
||||||
mjWRAP_SITE, // pass through site
|
|
||||||
mjWRAP_SPHERE, // wrap around sphere
|
|
||||||
mjWRAP_CYLINDER // wrap around (infinite) cylinder
|
|
||||||
} mjtWrap;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtTrn_ { // type of actuator transmission
|
|
||||||
mjTRN_JOINT = 0, // force on joint
|
|
||||||
mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame
|
|
||||||
mjTRN_SLIDERCRANK, // force via slider-crank linkage
|
|
||||||
mjTRN_TENDON, // force on tendon
|
|
||||||
mjTRN_SITE, // force on site
|
|
||||||
mjTRN_BODY, // adhesion force on a body's geoms
|
|
||||||
|
|
||||||
mjTRN_UNDEFINED = 1000 // undefined transmission type
|
|
||||||
} mjtTrn;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtDyn_ { // type of actuator dynamics
|
|
||||||
mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force
|
|
||||||
mjDYN_INTEGRATOR, // integrator: da/dt = u
|
|
||||||
mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau
|
|
||||||
mjDYN_FILTEREXACT, // linear filter: da/dt = (u-a) / tau, with exact integration
|
|
||||||
mjDYN_MUSCLE, // piecewise linear filter with two time constants
|
|
||||||
mjDYN_DCMOTOR, // DC motor electrical dynamics
|
|
||||||
mjDYN_USER // user-defined dynamics type
|
|
||||||
} mjtDyn;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtGain_ { // type of actuator gain
|
|
||||||
mjGAIN_FIXED = 0, // fixed gain
|
|
||||||
mjGAIN_AFFINE, // const + kp*length + kv*velocity
|
|
||||||
mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain()
|
|
||||||
mjGAIN_DCMOTOR, // DC motor gain: K or K/R
|
|
||||||
mjGAIN_USER // user-defined gain type
|
|
||||||
} mjtGain;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtBias_ { // type of actuator bias
|
|
||||||
mjBIAS_NONE = 0, // no bias
|
|
||||||
mjBIAS_AFFINE, // const + kp*length + kv*velocity
|
|
||||||
mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias()
|
|
||||||
mjBIAS_DCMOTOR, // DC motor bias: back-EMF, cogging, LuGre friction
|
|
||||||
mjBIAS_USER // user-defined bias type
|
|
||||||
} mjtBias;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtObj_ { // type of MujoCo object
|
|
||||||
mjOBJ_UNKNOWN = 0, // unknown object type
|
|
||||||
mjOBJ_BODY, // body
|
|
||||||
mjOBJ_XBODY, // body, used to access regular frame instead of i-frame
|
|
||||||
mjOBJ_JOINT, // joint
|
|
||||||
mjOBJ_DOF, // dof
|
|
||||||
mjOBJ_GEOM, // geom
|
|
||||||
mjOBJ_SITE, // site
|
|
||||||
mjOBJ_CAMERA, // camera
|
|
||||||
mjOBJ_LIGHT, // light
|
|
||||||
mjOBJ_FLEX, // flex
|
|
||||||
mjOBJ_MESH, // mesh
|
|
||||||
mjOBJ_SKIN, // skin
|
|
||||||
mjOBJ_HFIELD, // heightfield
|
|
||||||
mjOBJ_TEXTURE, // texture
|
|
||||||
mjOBJ_MATERIAL, // material for rendering
|
|
||||||
mjOBJ_PAIR, // geom pair to include
|
|
||||||
mjOBJ_EXCLUDE, // body pair to exclude
|
|
||||||
mjOBJ_EQUALITY, // equality constraint
|
|
||||||
mjOBJ_TENDON, // tendon
|
|
||||||
mjOBJ_ACTUATOR, // actuator
|
|
||||||
mjOBJ_SENSOR, // sensor
|
|
||||||
mjOBJ_NUMERIC, // numeric
|
|
||||||
mjOBJ_TEXT, // text
|
|
||||||
mjOBJ_TUPLE, // tuple
|
|
||||||
mjOBJ_KEY, // keyframe
|
|
||||||
mjOBJ_PLUGIN, // plugin instance
|
|
||||||
|
|
||||||
mjNOBJECT, // number of object types
|
|
||||||
|
|
||||||
// meta elements, do not appear in mjModel
|
|
||||||
mjOBJ_FRAME = 100, // frame
|
|
||||||
mjOBJ_DEFAULT, // default
|
|
||||||
mjOBJ_MODEL // entire model
|
|
||||||
} mjtObj;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtSensor_ { // type of sensor
|
|
||||||
// common robotic sensors, attached to a site
|
|
||||||
mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone
|
|
||||||
mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame
|
|
||||||
mjSENS_VELOCIMETER, // 3D linear velocity, in local frame
|
|
||||||
mjSENS_GYRO, // 3D angular velocity, in local frame
|
|
||||||
mjSENS_FORCE, // 3D force between site's body and its parent body
|
|
||||||
mjSENS_TORQUE, // 3D torque between site's body and its parent body
|
|
||||||
mjSENS_MAGNETOMETER, // 3D magnetometer
|
|
||||||
mjSENS_RANGEFINDER, // scalar distance to nearest geom along z-axis
|
|
||||||
mjSENS_CAMPROJECTION, // pixel coordinates of a site in the camera image
|
|
||||||
|
|
||||||
// sensors related to scalar joints, tendons, actuators
|
|
||||||
mjSENS_JOINTPOS, // scalar joint position (hinge and slide only)
|
|
||||||
mjSENS_JOINTVEL, // scalar joint velocity (hinge and slide only)
|
|
||||||
mjSENS_TENDONPOS, // scalar tendon position
|
|
||||||
mjSENS_TENDONVEL, // scalar tendon velocity
|
|
||||||
mjSENS_ACTUATORPOS, // scalar actuator position
|
|
||||||
mjSENS_ACTUATORVEL, // scalar actuator velocity
|
|
||||||
mjSENS_ACTUATORFRC, // scalar actuator force
|
|
||||||
mjSENS_JOINTACTFRC, // scalar actuator force, measured at the joint
|
|
||||||
mjSENS_TENDONACTFRC, // scalar actuator force, measured at the tendon
|
|
||||||
|
|
||||||
// sensors related to ball joints
|
|
||||||
mjSENS_BALLQUAT, // 4D ball joint quaternion
|
|
||||||
mjSENS_BALLANGVEL, // 3D ball joint angular velocity
|
|
||||||
|
|
||||||
// joint and tendon limit sensors, in constraint space
|
|
||||||
mjSENS_JOINTLIMITPOS, // joint limit distance-margin
|
|
||||||
mjSENS_JOINTLIMITVEL, // joint limit velocity
|
|
||||||
mjSENS_JOINTLIMITFRC, // joint limit force
|
|
||||||
mjSENS_TENDONLIMITPOS, // tendon limit distance-margin
|
|
||||||
mjSENS_TENDONLIMITVEL, // tendon limit velocity
|
|
||||||
mjSENS_TENDONLIMITFRC, // tendon limit force
|
|
||||||
|
|
||||||
// sensors attached to an object with spatial frame: (x)body, geom, site, camera
|
|
||||||
mjSENS_FRAMEPOS, // 3D position
|
|
||||||
mjSENS_FRAMEQUAT, // 4D unit quaternion orientation
|
|
||||||
mjSENS_FRAMEXAXIS, // 3D unit vector: x-axis of object's frame
|
|
||||||
mjSENS_FRAMEYAXIS, // 3D unit vector: y-axis of object's frame
|
|
||||||
mjSENS_FRAMEZAXIS, // 3D unit vector: z-axis of object's frame
|
|
||||||
mjSENS_FRAMELINVEL, // 3D linear velocity
|
|
||||||
mjSENS_FRAMEANGVEL, // 3D angular velocity
|
|
||||||
mjSENS_FRAMELINACC, // 3D linear acceleration
|
|
||||||
mjSENS_FRAMEANGACC, // 3D angular acceleration
|
|
||||||
|
|
||||||
// sensors related to kinematic subtrees; attached to a body (which is the subtree root)
|
|
||||||
mjSENS_SUBTREECOM, // 3D center of mass of subtree
|
|
||||||
mjSENS_SUBTREELINVEL, // 3D linear velocity of subtree
|
|
||||||
mjSENS_SUBTREEANGMOM, // 3D angular momentum of subtree
|
|
||||||
|
|
||||||
// sensors of geometric relationships
|
|
||||||
mjSENS_INSIDESITE, // 1 if object is inside a site, 0 otherwise
|
|
||||||
mjSENS_GEOMDIST, // signed distance between two geoms
|
|
||||||
mjSENS_GEOMNORMAL, // normal direction between two geoms
|
|
||||||
mjSENS_GEOMFROMTO, // segment between two geoms
|
|
||||||
|
|
||||||
// sensors for reporting contacts which occurred during the simulation
|
|
||||||
mjSENS_CONTACT, // contacts which occurred during the simulation
|
|
||||||
|
|
||||||
// global sensors
|
|
||||||
mjSENS_E_POTENTIAL, // potential energy
|
|
||||||
mjSENS_E_KINETIC, // kinetic energy
|
|
||||||
mjSENS_CLOCK, // simulation time
|
|
||||||
|
|
||||||
// sensors related to SDFs
|
|
||||||
mjSENS_TACTILE, // tactile sensor
|
|
||||||
|
|
||||||
// plugin-controlled sensors
|
|
||||||
mjSENS_PLUGIN, // plugin-controlled
|
|
||||||
|
|
||||||
// user-defined sensor
|
|
||||||
mjSENS_USER // sensor data provided by mjcb_sensor callback
|
|
||||||
} mjtSensor;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtStage_ { // computation stage
|
|
||||||
mjSTAGE_NONE = 0, // no computations
|
|
||||||
mjSTAGE_POS, // position-dependent computations
|
|
||||||
mjSTAGE_VEL, // velocity-dependent computations
|
|
||||||
mjSTAGE_ACC // acceleration/force-dependent computations
|
|
||||||
} mjtStage;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtDataType_ { // data type for sensors
|
|
||||||
mjDATATYPE_REAL = 0, // real values, no constraints
|
|
||||||
mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive
|
|
||||||
mjDATATYPE_AXIS, // 3D unit vector
|
|
||||||
mjDATATYPE_QUATERNION // unit quaternion
|
|
||||||
} mjtDataType;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtConDataField_ { // data fields returned by contact sensors
|
|
||||||
mjCONDATA_FOUND = 0, // whether a contact was found
|
|
||||||
mjCONDATA_FORCE, // contact force
|
|
||||||
mjCONDATA_TORQUE, // contact torque
|
|
||||||
mjCONDATA_DIST, // contact penetration distance
|
|
||||||
mjCONDATA_POS, // contact position
|
|
||||||
mjCONDATA_NORMAL, // contact frame normal
|
|
||||||
mjCONDATA_TANGENT, // contact frame first tangent
|
|
||||||
|
|
||||||
mjNCONDATA // number of contact sensor data fields
|
|
||||||
} mjtConDataField;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors
|
|
||||||
mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface
|
|
||||||
mjRAYDATA_DIR, // normalized ray direction
|
|
||||||
mjRAYDATA_ORIGIN, // ray origin
|
|
||||||
mjRAYDATA_POINT, // point at which ray intersects nearest surface
|
|
||||||
mjRAYDATA_NORMAL, // surface normal at intersection point
|
|
||||||
mjRAYDATA_DEPTH, // depth along z-axis
|
|
||||||
|
|
||||||
mjNRAYDATA // number of rangefinder sensor data fields
|
|
||||||
} mjtRayDataField;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtCamOutBit_ { // camera output type bitflags
|
|
||||||
mjCAMOUT_RGB = 1<<0, // RGB image
|
|
||||||
mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane)
|
|
||||||
mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin)
|
|
||||||
mjCAMOUT_NORMAL = 1<<3, // normal image
|
|
||||||
mjCAMOUT_SEG = 1<<4, // segmentation image
|
|
||||||
|
|
||||||
mjNCAMOUT = 5 // number of camera output types
|
|
||||||
} mjtCamOutBit;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtSameFrame_ { // frame alignment of bodies with their children
|
|
||||||
mjSAMEFRAME_NONE = 0, // no alignment
|
|
||||||
mjSAMEFRAME_BODY, // frame is same as body frame
|
|
||||||
mjSAMEFRAME_INERTIA, // frame is same as inertial frame
|
|
||||||
mjSAMEFRAME_BODYROT, // frame orientation is same as body orientation
|
|
||||||
mjSAMEFRAME_INERTIAROT // frame orientation is same as inertia orientation
|
|
||||||
} mjtSameFrame;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtSleepPolicy_ { // per-tree sleep policy
|
|
||||||
mjSLEEP_AUTO = 0, // compiler chooses sleep policy
|
|
||||||
mjSLEEP_AUTO_NEVER, // compiler sleep policy: never
|
|
||||||
mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed
|
|
||||||
mjSLEEP_NEVER, // user sleep policy: never
|
|
||||||
mjSLEEP_ALLOWED, // user sleep policy: allowed
|
|
||||||
mjSLEEP_INIT, // user sleep policy: initialized asleep
|
|
||||||
} mjtSleepPolicy;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtLRMode_ { // mode for actuator length range computation
|
|
||||||
mjLRMODE_NONE = 0, // do not process any actuators
|
|
||||||
mjLRMODE_MUSCLE, // process muscle actuators
|
|
||||||
mjLRMODE_MUSCLEUSER, // process muscle and user actuators
|
|
||||||
mjLRMODE_ALL // process all actuators
|
|
||||||
} mjtLRMode;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtFlexSelf_ { // mode for flex selfcollide
|
|
||||||
mjFLEXSELF_NONE = 0, // no self-collisions
|
|
||||||
mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase
|
|
||||||
mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled)
|
|
||||||
mjFLEXSELF_SAP, // use SAP in midphase
|
|
||||||
mjFLEXSELF_AUTO // choose between BVH and SAP automatically
|
|
||||||
} mjtFlexSelf;
|
|
||||||
|
|
||||||
|
|
||||||
typedef enum mjtSDFType_ { // signed distance function (SDF) type
|
|
||||||
mjSDFTYPE_SINGLE = 0, // single SDF
|
|
||||||
mjSDFTYPE_INTERSECTION, // max(A, B)
|
|
||||||
mjSDFTYPE_MIDSURFACE, // A - B
|
|
||||||
mjSDFTYPE_COLLISION, // A + B + abs(max(A, B))
|
|
||||||
} mjtSDFType;
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------- mjLROpt -------------------------------------------------------
|
//---------------------------------- mjLROpt -------------------------------------------------------
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjspec.h>
|
#include <mujoco/mjspec.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <stddef.h>
|
#include <stddef.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
|
|
||||||
// this is a C-API
|
// this is a C-API
|
||||||
|
|||||||
@@ -1,46 +0,0 @@
|
|||||||
// Copyright 2021 DeepMind Technologies Limited
|
|
||||||
//
|
|
||||||
// Licensed under the Apache License, Version 2.0 (the "License");
|
|
||||||
// you may not use this file except in compliance with the License.
|
|
||||||
// You may obtain a copy of the License at
|
|
||||||
//
|
|
||||||
// http://www.apache.org/licenses/LICENSE-2.0
|
|
||||||
//
|
|
||||||
// Unless required by applicable law or agreed to in writing, software
|
|
||||||
// distributed under the License is distributed on an "AS IS" BASIS,
|
|
||||||
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
|
||||||
// See the License for the specific language governing permissions and
|
|
||||||
// limitations under the License.
|
|
||||||
|
|
||||||
#ifndef MUJOCO_INCLUDE_MJTNUM_H_
|
|
||||||
#define MUJOCO_INCLUDE_MJTNUM_H_
|
|
||||||
|
|
||||||
#include <stdint.h>
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------- floating-point definition -------------------------------------
|
|
||||||
|
|
||||||
// floating point data type and minval
|
|
||||||
#ifndef mjUSESINGLE
|
|
||||||
typedef double mjtNum;
|
|
||||||
#define mjMINVAL 1E-15 // minimum value in any denominator
|
|
||||||
#else
|
|
||||||
typedef float mjtNum;
|
|
||||||
#define mjMINVAL 1E-15f
|
|
||||||
#endif
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------- byte definition -----------------------------------------------
|
|
||||||
|
|
||||||
typedef unsigned char mjtByte; // used for true/false
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
//---------------------------------- size definition -----------------------------------------------
|
|
||||||
|
|
||||||
typedef int64_t mjtSize; // used for buffer sizes
|
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
#endif // MUJOCO_INCLUDE_MJTNUM_H_
|
|
||||||
@@ -0,0 +1,574 @@
|
|||||||
|
// Copyright 2021 DeepMind Technologies Limited
|
||||||
|
//
|
||||||
|
// Licensed under the Apache License, Version 2.0 (the "License");
|
||||||
|
// you may not use this file except in compliance with the License.
|
||||||
|
// You may obtain a copy of the License at
|
||||||
|
//
|
||||||
|
// http://www.apache.org/licenses/LICENSE-2.0
|
||||||
|
//
|
||||||
|
// Unless required by applicable law or agreed to in writing, software
|
||||||
|
// distributed under the License is distributed on an "AS IS" BASIS,
|
||||||
|
// WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
|
||||||
|
// See the License for the specific language governing permissions and
|
||||||
|
// limitations under the License.
|
||||||
|
|
||||||
|
#ifndef MUJOCO_INCLUDE_MJTYPE_H_
|
||||||
|
#define MUJOCO_INCLUDE_MJTYPE_H_
|
||||||
|
|
||||||
|
#include <stdint.h>
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------- floating-point definition -------------------------------------
|
||||||
|
|
||||||
|
// floating point data type and minval
|
||||||
|
#ifndef mjUSESINGLE
|
||||||
|
typedef double mjtNum;
|
||||||
|
#define mjMINVAL 1E-15 // minimum value in any denominator
|
||||||
|
#else
|
||||||
|
typedef float mjtNum;
|
||||||
|
#define mjMINVAL 1E-15f
|
||||||
|
#endif
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------- byte definition -----------------------------------------------
|
||||||
|
|
||||||
|
typedef unsigned char mjtByte; // used for true/false
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------- size definition -----------------------------------------------
|
||||||
|
|
||||||
|
typedef int64_t mjtSize; // used for buffer sizes
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------- enum types (mjModel) ------------------------------------------
|
||||||
|
|
||||||
|
typedef enum mjtDisableBit_ { // disable default feature bitflags
|
||||||
|
mjDSBL_CONSTRAINT = 1<<0, // entire constraint solver
|
||||||
|
mjDSBL_EQUALITY = 1<<1, // equality constraints
|
||||||
|
mjDSBL_FRICTIONLOSS = 1<<2, // joint and tendon frictionloss constraints
|
||||||
|
mjDSBL_LIMIT = 1<<3, // joint and tendon limit constraints
|
||||||
|
mjDSBL_CONTACT = 1<<4, // contact constraints
|
||||||
|
mjDSBL_SPRING = 1<<5, // passive spring forces
|
||||||
|
mjDSBL_DAMPER = 1<<6, // passive damping forces
|
||||||
|
mjDSBL_GRAVITY = 1<<7, // gravitational forces
|
||||||
|
mjDSBL_CLAMPCTRL = 1<<8, // clamp control to specified range
|
||||||
|
mjDSBL_WARMSTART = 1<<9, // warmstart constraint solver
|
||||||
|
mjDSBL_FILTERPARENT = 1<<10, // remove collisions with parent body
|
||||||
|
mjDSBL_ACTUATION = 1<<11, // apply actuation forces
|
||||||
|
mjDSBL_REFSAFE = 1<<12, // integrator safety: make ref[0]>=2*timestep
|
||||||
|
mjDSBL_SENSOR = 1<<13, // sensors
|
||||||
|
mjDSBL_MIDPHASE = 1<<14, // mid-phase collision filtering
|
||||||
|
mjDSBL_EULERDAMP = 1<<15, // implicit integration of joint damping in Euler integrator
|
||||||
|
mjDSBL_AUTORESET = 1<<16, // automatic reset when numerical issues are detected
|
||||||
|
mjDSBL_NATIVECCD = 1<<17, // native convex collision detection
|
||||||
|
mjDSBL_ISLAND = 1<<18, // constraint island discovery
|
||||||
|
mjDSBL_MULTICCD = 1<<19, // multiple CCD contact points
|
||||||
|
|
||||||
|
mjNDISABLE = 20 // number of disable flags
|
||||||
|
} mjtDisableBit;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtEnableBit_ { // enable optional feature bitflags
|
||||||
|
mjENBL_OVERRIDE = 1<<0, // override contact parameters
|
||||||
|
mjENBL_ENERGY = 1<<1, // energy computation
|
||||||
|
mjENBL_FWDINV = 1<<2, // record solver statistics
|
||||||
|
mjENBL_INVDISCRETE = 1<<3, // discrete-time inverse dynamics
|
||||||
|
mjENBL_SLEEP = 1<<4, // sleeping
|
||||||
|
mjENBL_DIAGEXACT = 1<<5, // exact diagonal of constraint inertia
|
||||||
|
|
||||||
|
mjNENABLE = 6 // number of enable flags
|
||||||
|
} mjtEnableBit;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtJoint_ { // type of degree of freedom
|
||||||
|
mjJNT_FREE = 0, // global position and orientation (quat) (7)
|
||||||
|
mjJNT_BALL, // orientation (quat) relative to parent (4)
|
||||||
|
mjJNT_SLIDE, // sliding distance along body-fixed axis (1)
|
||||||
|
mjJNT_HINGE // rotation angle (rad) around body-fixed axis (1)
|
||||||
|
} mjtJoint;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtGeom_ { // type of geometric shape
|
||||||
|
// regular geom types
|
||||||
|
mjGEOM_PLANE = 0, // plane
|
||||||
|
mjGEOM_HFIELD, // height field
|
||||||
|
mjGEOM_SPHERE, // sphere
|
||||||
|
mjGEOM_CAPSULE, // capsule
|
||||||
|
mjGEOM_ELLIPSOID, // ellipsoid
|
||||||
|
mjGEOM_CYLINDER, // cylinder
|
||||||
|
mjGEOM_BOX, // box
|
||||||
|
mjGEOM_MESH, // mesh
|
||||||
|
mjGEOM_SDF, // signed distance field
|
||||||
|
|
||||||
|
mjNGEOMTYPES, // number of regular geom types
|
||||||
|
|
||||||
|
// rendering-only geom types: not used in mjModel, not counted in mjNGEOMTYPES
|
||||||
|
mjGEOM_ARROW = 100, // arrow
|
||||||
|
mjGEOM_ARROW1, // arrow without wedges
|
||||||
|
mjGEOM_ARROW2, // arrow in both directions
|
||||||
|
mjGEOM_LINE, // line
|
||||||
|
mjGEOM_LINEBOX, // box with line edges
|
||||||
|
mjGEOM_FLEX, // flex
|
||||||
|
mjGEOM_SKIN, // skin
|
||||||
|
mjGEOM_LABEL, // text label
|
||||||
|
mjGEOM_TRIANGLE, // triangle
|
||||||
|
|
||||||
|
mjGEOM_NONE = 1001 // missing geom type
|
||||||
|
} mjtGeom;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtProjection_ { // type of camera projection
|
||||||
|
mjPROJ_PERSPECTIVE = 0, // perspective
|
||||||
|
mjPROJ_ORTHOGRAPHIC // orthographic
|
||||||
|
} mjtProjection;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtCamLight_ { // tracking mode for camera and light
|
||||||
|
mjCAMLIGHT_FIXED = 0, // pos and rot fixed in body
|
||||||
|
mjCAMLIGHT_TRACK, // pos tracks body, rot fixed in global
|
||||||
|
mjCAMLIGHT_TRACKCOM, // pos tracks subtree com, rot fixed in body
|
||||||
|
mjCAMLIGHT_TARGETBODY, // pos fixed in body, rot tracks target body
|
||||||
|
mjCAMLIGHT_TARGETBODYCOM // pos fixed in body, rot tracks target subtree com
|
||||||
|
} mjtCamLight;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtLightType_ { // type of light
|
||||||
|
mjLIGHT_SPOT = 0, // spot
|
||||||
|
mjLIGHT_DIRECTIONAL, // directional
|
||||||
|
mjLIGHT_POINT, // point
|
||||||
|
mjLIGHT_IMAGE, // image-based
|
||||||
|
} mjtLightType;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtTexture_ { // type of texture
|
||||||
|
mjTEXTURE_2D = 0, // 2d texture, suitable for planes and hfields
|
||||||
|
mjTEXTURE_CUBE, // cube texture, suitable for all other geom types
|
||||||
|
mjTEXTURE_SKYBOX // cube texture used as skybox
|
||||||
|
} mjtTexture;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtTextureRole_ { // role of texture map in rendering
|
||||||
|
mjTEXROLE_USER = 0, // unspecified
|
||||||
|
mjTEXROLE_RGB, // base color (albedo)
|
||||||
|
mjTEXROLE_OCCLUSION, // ambient occlusion
|
||||||
|
mjTEXROLE_ROUGHNESS, // roughness
|
||||||
|
mjTEXROLE_METALLIC, // metallic
|
||||||
|
mjTEXROLE_NORMAL, // normal (bump) map
|
||||||
|
mjTEXROLE_OPACITY, // opacity
|
||||||
|
mjTEXROLE_EMISSIVE, // light emission
|
||||||
|
mjTEXROLE_RGBA, // base color, opacity
|
||||||
|
mjTEXROLE_ORM, // occlusion, roughness, metallic
|
||||||
|
mjNTEXROLE
|
||||||
|
} mjtTextureRole;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtColorSpace_ { // type of color space encoding
|
||||||
|
mjCOLORSPACE_AUTO = 0, // attempts to autodetect color space, defaults to linear
|
||||||
|
mjCOLORSPACE_LINEAR, // linear color space
|
||||||
|
mjCOLORSPACE_SRGB // standard RGB color space
|
||||||
|
} mjtColorSpace;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtIntegrator_ { // integrator mode
|
||||||
|
mjINT_EULER = 0, // semi-implicit Euler
|
||||||
|
mjINT_RK4, // 4th-order Runge Kutta
|
||||||
|
mjINT_IMPLICIT, // implicit in velocity
|
||||||
|
mjINT_IMPLICITFAST // implicit in velocity, no rne derivative
|
||||||
|
} mjtIntegrator;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtCone_ { // type of friction cone
|
||||||
|
mjCONE_PYRAMIDAL = 0, // pyramidal
|
||||||
|
mjCONE_ELLIPTIC // elliptic
|
||||||
|
} mjtCone;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtJacobian_ { // type of constraint Jacobian
|
||||||
|
mjJAC_DENSE = 0, // dense
|
||||||
|
mjJAC_SPARSE, // sparse
|
||||||
|
mjJAC_AUTO // dense if nv<60, sparse otherwise
|
||||||
|
} mjtJacobian;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtSolver_ { // constraint solver algorithm
|
||||||
|
mjSOL_PGS = 0, // PGS (dual)
|
||||||
|
mjSOL_CG, // CG (primal)
|
||||||
|
mjSOL_NEWTON // Newton (primal)
|
||||||
|
} mjtSolver;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtEq_ { // type of equality constraint
|
||||||
|
mjEQ_CONNECT = 0, // connect two bodies at a point (ball joint)
|
||||||
|
mjEQ_WELD, // fix relative position and orientation of two bodies
|
||||||
|
mjEQ_JOINT, // couple the values of two scalar joints with cubic
|
||||||
|
mjEQ_TENDON, // couple the lengths of two tendons with cubic
|
||||||
|
mjEQ_FLEX, // fix all edge lengths of a flex
|
||||||
|
mjEQ_FLEXVERT, // fix all vertex lengths of a flex
|
||||||
|
mjEQ_FLEXSTRAIN, // constrain strain of a trilinear/quadratic flex (B-bar)
|
||||||
|
mjEQ_DISTANCE // unsupported, will cause an error if used
|
||||||
|
} mjtEq;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtWrap_ { // type of tendon wrap object
|
||||||
|
mjWRAP_NONE = 0, // null object
|
||||||
|
mjWRAP_JOINT, // constant moment arm
|
||||||
|
mjWRAP_PULLEY, // pulley used to split tendon
|
||||||
|
mjWRAP_SITE, // pass through site
|
||||||
|
mjWRAP_SPHERE, // wrap around sphere
|
||||||
|
mjWRAP_CYLINDER // wrap around (infinite) cylinder
|
||||||
|
} mjtWrap;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtTrn_ { // type of actuator transmission
|
||||||
|
mjTRN_JOINT = 0, // force on joint
|
||||||
|
mjTRN_JOINTINPARENT, // force on joint, expressed in parent frame
|
||||||
|
mjTRN_SLIDERCRANK, // force via slider-crank linkage
|
||||||
|
mjTRN_TENDON, // force on tendon
|
||||||
|
mjTRN_SITE, // force on site
|
||||||
|
mjTRN_BODY, // adhesion force on a body's geoms
|
||||||
|
|
||||||
|
mjTRN_UNDEFINED = 1000 // undefined transmission type
|
||||||
|
} mjtTrn;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtDyn_ { // type of actuator dynamics
|
||||||
|
mjDYN_NONE = 0, // no internal dynamics; ctrl specifies force
|
||||||
|
mjDYN_INTEGRATOR, // integrator: da/dt = u
|
||||||
|
mjDYN_FILTER, // linear filter: da/dt = (u-a) / tau
|
||||||
|
mjDYN_FILTEREXACT, // linear filter: da/dt = (u-a) / tau, with exact integration
|
||||||
|
mjDYN_MUSCLE, // piecewise linear filter with two time constants
|
||||||
|
mjDYN_DCMOTOR, // DC motor electrical dynamics
|
||||||
|
mjDYN_USER // user-defined dynamics type
|
||||||
|
} mjtDyn;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtGain_ { // type of actuator gain
|
||||||
|
mjGAIN_FIXED = 0, // fixed gain
|
||||||
|
mjGAIN_AFFINE, // const + kp*length + kv*velocity
|
||||||
|
mjGAIN_MUSCLE, // muscle FLV curve computed by mju_muscleGain()
|
||||||
|
mjGAIN_DCMOTOR, // DC motor gain: K or K/R
|
||||||
|
mjGAIN_USER // user-defined gain type
|
||||||
|
} mjtGain;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtBias_ { // type of actuator bias
|
||||||
|
mjBIAS_NONE = 0, // no bias
|
||||||
|
mjBIAS_AFFINE, // const + kp*length + kv*velocity
|
||||||
|
mjBIAS_MUSCLE, // muscle passive force computed by mju_muscleBias()
|
||||||
|
mjBIAS_DCMOTOR, // DC motor bias: back-EMF, cogging, LuGre friction
|
||||||
|
mjBIAS_USER // user-defined bias type
|
||||||
|
} mjtBias;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtObj_ { // type of MujoCo object
|
||||||
|
mjOBJ_UNKNOWN = 0, // unknown object type
|
||||||
|
mjOBJ_BODY, // body
|
||||||
|
mjOBJ_XBODY, // body, used to access regular frame instead of i-frame
|
||||||
|
mjOBJ_JOINT, // joint
|
||||||
|
mjOBJ_DOF, // dof
|
||||||
|
mjOBJ_GEOM, // geom
|
||||||
|
mjOBJ_SITE, // site
|
||||||
|
mjOBJ_CAMERA, // camera
|
||||||
|
mjOBJ_LIGHT, // light
|
||||||
|
mjOBJ_FLEX, // flex
|
||||||
|
mjOBJ_MESH, // mesh
|
||||||
|
mjOBJ_SKIN, // skin
|
||||||
|
mjOBJ_HFIELD, // heightfield
|
||||||
|
mjOBJ_TEXTURE, // texture
|
||||||
|
mjOBJ_MATERIAL, // material for rendering
|
||||||
|
mjOBJ_PAIR, // geom pair to include
|
||||||
|
mjOBJ_EXCLUDE, // body pair to exclude
|
||||||
|
mjOBJ_EQUALITY, // equality constraint
|
||||||
|
mjOBJ_TENDON, // tendon
|
||||||
|
mjOBJ_ACTUATOR, // actuator
|
||||||
|
mjOBJ_SENSOR, // sensor
|
||||||
|
mjOBJ_NUMERIC, // numeric
|
||||||
|
mjOBJ_TEXT, // text
|
||||||
|
mjOBJ_TUPLE, // tuple
|
||||||
|
mjOBJ_KEY, // keyframe
|
||||||
|
mjOBJ_PLUGIN, // plugin instance
|
||||||
|
|
||||||
|
mjNOBJECT, // number of object types
|
||||||
|
|
||||||
|
// meta elements, do not appear in mjModel
|
||||||
|
mjOBJ_FRAME = 100, // frame
|
||||||
|
mjOBJ_DEFAULT, // default
|
||||||
|
mjOBJ_MODEL // entire model
|
||||||
|
} mjtObj;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtSensor_ { // type of sensor
|
||||||
|
// common robotic sensors, attached to a site
|
||||||
|
mjSENS_TOUCH = 0, // scalar contact normal forces summed over sensor zone
|
||||||
|
mjSENS_ACCELEROMETER, // 3D linear acceleration, in local frame
|
||||||
|
mjSENS_VELOCIMETER, // 3D linear velocity, in local frame
|
||||||
|
mjSENS_GYRO, // 3D angular velocity, in local frame
|
||||||
|
mjSENS_FORCE, // 3D force between site's body and its parent body
|
||||||
|
mjSENS_TORQUE, // 3D torque between site's body and its parent body
|
||||||
|
mjSENS_MAGNETOMETER, // 3D magnetometer
|
||||||
|
mjSENS_RANGEFINDER, // scalar distance to nearest geom along z-axis
|
||||||
|
mjSENS_CAMPROJECTION, // pixel coordinates of a site in the camera image
|
||||||
|
|
||||||
|
// sensors related to scalar joints, tendons, actuators
|
||||||
|
mjSENS_JOINTPOS, // scalar joint position (hinge and slide only)
|
||||||
|
mjSENS_JOINTVEL, // scalar joint velocity (hinge and slide only)
|
||||||
|
mjSENS_TENDONPOS, // scalar tendon position
|
||||||
|
mjSENS_TENDONVEL, // scalar tendon velocity
|
||||||
|
mjSENS_ACTUATORPOS, // scalar actuator position
|
||||||
|
mjSENS_ACTUATORVEL, // scalar actuator velocity
|
||||||
|
mjSENS_ACTUATORFRC, // scalar actuator force
|
||||||
|
mjSENS_JOINTACTFRC, // scalar actuator force, measured at the joint
|
||||||
|
mjSENS_TENDONACTFRC, // scalar actuator force, measured at the tendon
|
||||||
|
|
||||||
|
// sensors related to ball joints
|
||||||
|
mjSENS_BALLQUAT, // 4D ball joint quaternion
|
||||||
|
mjSENS_BALLANGVEL, // 3D ball joint angular velocity
|
||||||
|
|
||||||
|
// joint and tendon limit sensors, in constraint space
|
||||||
|
mjSENS_JOINTLIMITPOS, // joint limit distance-margin
|
||||||
|
mjSENS_JOINTLIMITVEL, // joint limit velocity
|
||||||
|
mjSENS_JOINTLIMITFRC, // joint limit force
|
||||||
|
mjSENS_TENDONLIMITPOS, // tendon limit distance-margin
|
||||||
|
mjSENS_TENDONLIMITVEL, // tendon limit velocity
|
||||||
|
mjSENS_TENDONLIMITFRC, // tendon limit force
|
||||||
|
|
||||||
|
// sensors attached to an object with spatial frame: (x)body, geom, site, camera
|
||||||
|
mjSENS_FRAMEPOS, // 3D position
|
||||||
|
mjSENS_FRAMEQUAT, // 4D unit quaternion orientation
|
||||||
|
mjSENS_FRAMEXAXIS, // 3D unit vector: x-axis of object's frame
|
||||||
|
mjSENS_FRAMEYAXIS, // 3D unit vector: y-axis of object's frame
|
||||||
|
mjSENS_FRAMEZAXIS, // 3D unit vector: z-axis of object's frame
|
||||||
|
mjSENS_FRAMELINVEL, // 3D linear velocity
|
||||||
|
mjSENS_FRAMEANGVEL, // 3D angular velocity
|
||||||
|
mjSENS_FRAMELINACC, // 3D linear acceleration
|
||||||
|
mjSENS_FRAMEANGACC, // 3D angular acceleration
|
||||||
|
|
||||||
|
// sensors related to kinematic subtrees; attached to a body (which is the subtree root)
|
||||||
|
mjSENS_SUBTREECOM, // 3D center of mass of subtree
|
||||||
|
mjSENS_SUBTREELINVEL, // 3D linear velocity of subtree
|
||||||
|
mjSENS_SUBTREEANGMOM, // 3D angular momentum of subtree
|
||||||
|
|
||||||
|
// sensors of geometric relationships
|
||||||
|
mjSENS_INSIDESITE, // 1 if object is inside a site, 0 otherwise
|
||||||
|
mjSENS_GEOMDIST, // signed distance between two geoms
|
||||||
|
mjSENS_GEOMNORMAL, // normal direction between two geoms
|
||||||
|
mjSENS_GEOMFROMTO, // segment between two geoms
|
||||||
|
|
||||||
|
// sensors for reporting contacts which occurred during the simulation
|
||||||
|
mjSENS_CONTACT, // contacts which occurred during the simulation
|
||||||
|
|
||||||
|
// global sensors
|
||||||
|
mjSENS_E_POTENTIAL, // potential energy
|
||||||
|
mjSENS_E_KINETIC, // kinetic energy
|
||||||
|
mjSENS_CLOCK, // simulation time
|
||||||
|
|
||||||
|
// sensors related to SDFs
|
||||||
|
mjSENS_TACTILE, // tactile sensor
|
||||||
|
|
||||||
|
// plugin-controlled sensors
|
||||||
|
mjSENS_PLUGIN, // plugin-controlled
|
||||||
|
|
||||||
|
// user-defined sensor
|
||||||
|
mjSENS_USER // sensor data provided by mjcb_sensor callback
|
||||||
|
} mjtSensor;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtStage_ { // computation stage
|
||||||
|
mjSTAGE_NONE = 0, // no computations
|
||||||
|
mjSTAGE_POS, // position-dependent computations
|
||||||
|
mjSTAGE_VEL, // velocity-dependent computations
|
||||||
|
mjSTAGE_ACC // acceleration/force-dependent computations
|
||||||
|
} mjtStage;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtDataType_ { // data type for sensors
|
||||||
|
mjDATATYPE_REAL = 0, // real values, no constraints
|
||||||
|
mjDATATYPE_POSITIVE, // positive values; 0 or negative: inactive
|
||||||
|
mjDATATYPE_AXIS, // 3D unit vector
|
||||||
|
mjDATATYPE_QUATERNION // unit quaternion
|
||||||
|
} mjtDataType;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtConDataField_ { // data fields returned by contact sensors
|
||||||
|
mjCONDATA_FOUND = 0, // whether a contact was found
|
||||||
|
mjCONDATA_FORCE, // contact force
|
||||||
|
mjCONDATA_TORQUE, // contact torque
|
||||||
|
mjCONDATA_DIST, // contact penetration distance
|
||||||
|
mjCONDATA_POS, // contact position
|
||||||
|
mjCONDATA_NORMAL, // contact frame normal
|
||||||
|
mjCONDATA_TANGENT, // contact frame first tangent
|
||||||
|
|
||||||
|
mjNCONDATA // number of contact sensor data fields
|
||||||
|
} mjtConDataField;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtRayDataField_ { // data fields returned by rangefinder sensors
|
||||||
|
mjRAYDATA_DIST = 0, // distance from ray origin to nearest surface
|
||||||
|
mjRAYDATA_DIR, // normalized ray direction
|
||||||
|
mjRAYDATA_ORIGIN, // ray origin
|
||||||
|
mjRAYDATA_POINT, // point at which ray intersects nearest surface
|
||||||
|
mjRAYDATA_NORMAL, // surface normal at intersection point
|
||||||
|
mjRAYDATA_DEPTH, // depth along z-axis
|
||||||
|
|
||||||
|
mjNRAYDATA // number of rangefinder sensor data fields
|
||||||
|
} mjtRayDataField;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtCamOutBit_ { // camera output type bitflags
|
||||||
|
mjCAMOUT_RGB = 1<<0, // RGB image
|
||||||
|
mjCAMOUT_DEPTH = 1<<1, // depth image (distance from camera plane)
|
||||||
|
mjCAMOUT_DIST = 1<<2, // distance image (distance from camera origin)
|
||||||
|
mjCAMOUT_NORMAL = 1<<3, // normal image
|
||||||
|
mjCAMOUT_SEG = 1<<4, // segmentation image
|
||||||
|
|
||||||
|
mjNCAMOUT = 5 // number of camera output types
|
||||||
|
} mjtCamOutBit;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtSameFrame_ { // frame alignment of bodies with their children
|
||||||
|
mjSAMEFRAME_NONE = 0, // no alignment
|
||||||
|
mjSAMEFRAME_BODY, // frame is same as body frame
|
||||||
|
mjSAMEFRAME_INERTIA, // frame is same as inertial frame
|
||||||
|
mjSAMEFRAME_BODYROT, // frame orientation is same as body orientation
|
||||||
|
mjSAMEFRAME_INERTIAROT // frame orientation is same as inertia orientation
|
||||||
|
} mjtSameFrame;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtSleepPolicy_ { // per-tree sleep policy
|
||||||
|
mjSLEEP_AUTO = 0, // compiler chooses sleep policy
|
||||||
|
mjSLEEP_AUTO_NEVER, // compiler sleep policy: never
|
||||||
|
mjSLEEP_AUTO_ALLOWED, // compiler sleep policy: allowed
|
||||||
|
mjSLEEP_NEVER, // user sleep policy: never
|
||||||
|
mjSLEEP_ALLOWED, // user sleep policy: allowed
|
||||||
|
mjSLEEP_INIT, // user sleep policy: initialized asleep
|
||||||
|
} mjtSleepPolicy;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtLRMode_ { // mode for actuator length range computation
|
||||||
|
mjLRMODE_NONE = 0, // do not process any actuators
|
||||||
|
mjLRMODE_MUSCLE, // process muscle actuators
|
||||||
|
mjLRMODE_MUSCLEUSER, // process muscle and user actuators
|
||||||
|
mjLRMODE_ALL // process all actuators
|
||||||
|
} mjtLRMode;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtFlexSelf_ { // mode for flex selfcollide
|
||||||
|
mjFLEXSELF_NONE = 0, // no self-collisions
|
||||||
|
mjFLEXSELF_NARROW, // skip midphase, go directly to narrowphase
|
||||||
|
mjFLEXSELF_BVH, // use BVH in midphase (if midphase enabled)
|
||||||
|
mjFLEXSELF_SAP, // use SAP in midphase
|
||||||
|
mjFLEXSELF_AUTO // choose between BVH and SAP automatically
|
||||||
|
} mjtFlexSelf;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtSDFType_ { // signed distance function (SDF) type
|
||||||
|
mjSDFTYPE_SINGLE = 0, // single SDF
|
||||||
|
mjSDFTYPE_INTERSECTION, // max(A, B)
|
||||||
|
mjSDFTYPE_MIDSURFACE, // A - B
|
||||||
|
mjSDFTYPE_COLLISION, // A + B + abs(max(A, B))
|
||||||
|
} mjtSDFType;
|
||||||
|
|
||||||
|
|
||||||
|
|
||||||
|
//---------------------------------- enum types (mjData) -------------------------------------------
|
||||||
|
|
||||||
|
typedef enum mjtState_ { // state elements
|
||||||
|
mjSTATE_TIME = 1<<0, // time
|
||||||
|
mjSTATE_QPOS = 1<<1, // position
|
||||||
|
mjSTATE_QVEL = 1<<2, // velocity
|
||||||
|
mjSTATE_ACT = 1<<3, // actuator activation
|
||||||
|
mjSTATE_HISTORY = 1<<4, // history buffers (control, sensor)
|
||||||
|
mjSTATE_WARMSTART = 1<<5, // acceleration used for warmstart
|
||||||
|
mjSTATE_CTRL = 1<<6, // control
|
||||||
|
mjSTATE_QFRC_APPLIED = 1<<7, // applied generalized force
|
||||||
|
mjSTATE_XFRC_APPLIED = 1<<8, // applied Cartesian force/torque
|
||||||
|
mjSTATE_EQ_ACTIVE = 1<<9, // enable/disable constraints
|
||||||
|
mjSTATE_MOCAP_POS = 1<<10, // positions of mocap bodies
|
||||||
|
mjSTATE_MOCAP_QUAT = 1<<11, // orientations of mocap bodies
|
||||||
|
mjSTATE_USERDATA = 1<<12, // user data
|
||||||
|
mjSTATE_PLUGIN = 1<<13, // plugin state
|
||||||
|
|
||||||
|
mjNSTATE = 14, // number of state elements
|
||||||
|
|
||||||
|
// convenience values for commonly used state specifications
|
||||||
|
mjSTATE_PHYSICS = mjSTATE_QPOS | mjSTATE_QVEL | mjSTATE_ACT | mjSTATE_HISTORY,
|
||||||
|
mjSTATE_FULLPHYSICS = mjSTATE_TIME | mjSTATE_PHYSICS | mjSTATE_PLUGIN,
|
||||||
|
mjSTATE_USER = mjSTATE_CTRL | mjSTATE_QFRC_APPLIED | mjSTATE_XFRC_APPLIED |
|
||||||
|
mjSTATE_EQ_ACTIVE | mjSTATE_MOCAP_POS | mjSTATE_MOCAP_QUAT |
|
||||||
|
mjSTATE_USERDATA,
|
||||||
|
mjSTATE_INTEGRATION = mjSTATE_FULLPHYSICS | mjSTATE_USER | mjSTATE_WARMSTART
|
||||||
|
} mjtState;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtConstraint_ { // type of constraint
|
||||||
|
mjCNSTR_EQUALITY = 0, // equality constraint
|
||||||
|
mjCNSTR_FRICTION_DOF, // dof friction
|
||||||
|
mjCNSTR_FRICTION_TENDON, // tendon friction
|
||||||
|
mjCNSTR_LIMIT_JOINT, // joint limit
|
||||||
|
mjCNSTR_LIMIT_TENDON, // tendon limit
|
||||||
|
mjCNSTR_CONTACT_FRICTIONLESS, // frictionless contact
|
||||||
|
mjCNSTR_CONTACT_PYRAMIDAL, // frictional contact, pyramidal friction cone
|
||||||
|
mjCNSTR_CONTACT_ELLIPTIC // frictional contact, elliptic friction cone
|
||||||
|
} mjtConstraint;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtConstraintState_ { // constraint state
|
||||||
|
mjCNSTRSTATE_SATISFIED = 0, // constraint satisfied, zero cost (limit, contact)
|
||||||
|
mjCNSTRSTATE_QUADRATIC, // quadratic cost (equality, friction, limit, contact)
|
||||||
|
mjCNSTRSTATE_LINEARNEG, // linear cost, negative side (friction)
|
||||||
|
mjCNSTRSTATE_LINEARPOS, // linear cost, positive side (friction)
|
||||||
|
mjCNSTRSTATE_CONE // squared distance to cone cost (elliptic contact)
|
||||||
|
} mjtConstraintState;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtWarning_ { // warning types
|
||||||
|
mjWARN_INERTIA = 0, // (near) singular inertia matrix
|
||||||
|
mjWARN_CONTACTFULL, // too many contacts in contact list
|
||||||
|
mjWARN_CNSTRFULL, // too many constraints
|
||||||
|
mjWARN_BADQPOS, // bad number in qpos
|
||||||
|
mjWARN_BADQVEL, // bad number in qvel
|
||||||
|
mjWARN_BADQACC, // bad number in qacc
|
||||||
|
mjWARN_BADCTRL, // bad number in ctrl
|
||||||
|
|
||||||
|
mjNWARNING // number of warnings
|
||||||
|
} mjtWarning;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtTimer_ { // internal timers
|
||||||
|
// main api
|
||||||
|
mjTIMER_STEP = 0, // step
|
||||||
|
mjTIMER_FORWARD, // forward
|
||||||
|
mjTIMER_INVERSE, // inverse
|
||||||
|
|
||||||
|
// breakdown of step/forward
|
||||||
|
mjTIMER_POSITION, // fwdPosition
|
||||||
|
mjTIMER_VELOCITY, // fwdVelocity
|
||||||
|
mjTIMER_ACTUATION, // fwdActuation
|
||||||
|
mjTIMER_CONSTRAINT, // fwdConstraint
|
||||||
|
mjTIMER_ADVANCE, // mj_Euler, mj_implicit
|
||||||
|
|
||||||
|
// breakdown of fwdPosition
|
||||||
|
mjTIMER_POS_KINEMATICS, // kinematics, com, tendon, transmission
|
||||||
|
mjTIMER_POS_INERTIA, // inertia computations
|
||||||
|
mjTIMER_POS_COLLISION, // collision detection
|
||||||
|
mjTIMER_POS_MAKE, // make constraints
|
||||||
|
mjTIMER_POS_PROJECT, // project constraints
|
||||||
|
|
||||||
|
// breakdown of mj_collision
|
||||||
|
mjTIMER_COL_BROAD, // broadphase
|
||||||
|
mjTIMER_COL_NARROW, // narrowphase
|
||||||
|
|
||||||
|
mjNTIMER // number of timers
|
||||||
|
} mjtTimer;
|
||||||
|
|
||||||
|
|
||||||
|
typedef enum mjtSleepState_ { // sleep state of an object
|
||||||
|
mjS_STATIC = -1, // object is static
|
||||||
|
mjS_ASLEEP = 0, // object is asleep
|
||||||
|
mjS_AWAKE = 1 // object is awake
|
||||||
|
} mjtSleepState;
|
||||||
|
|
||||||
|
#endif // MUJOCO_INCLUDE_MJTYPE_H_
|
||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
|
|
||||||
#define mjNGROUP 6 // number of geom, site, joint, skin groups with visflags
|
#define mjNGROUP 6 // number of geom, site, joint, skin groups with visflags
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include <mujoco/mjsan.h>
|
#include <mujoco/mjsan.h>
|
||||||
#include <mujoco/mjspec.h>
|
#include <mujoco/mjspec.h>
|
||||||
#include <mujoco/mjthread.h>
|
#include <mujoco/mjthread.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjui.h>
|
#include <mujoco/mjui.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
|
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
namespace mujoco::plugin::actuator {
|
namespace mujoco::plugin::actuator {
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <optional>
|
#include <optional>
|
||||||
|
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "cable.h"
|
#include "cable.h"
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
|
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
#include "bolt.h"
|
#include "bolt.h"
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
#include "bowl.h"
|
#include "bowl.h"
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -18,7 +18,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
#include "nut.h"
|
#include "nut.h"
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
|
|
||||||
|
|||||||
+1
-1
@@ -17,7 +17,7 @@
|
|||||||
#include <utility>
|
#include <utility>
|
||||||
|
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
#include "torus.h"
|
#include "torus.h"
|
||||||
|
|||||||
+1
-1
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "sdf.h"
|
#include "sdf.h"
|
||||||
|
|
||||||
namespace mujoco::plugin::sdf {
|
namespace mujoco::plugin::sdf {
|
||||||
|
|||||||
@@ -25,7 +25,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
|
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
|
|
||||||
namespace mujoco::plugin::sensor {
|
namespace mujoco::plugin::sensor {
|
||||||
|
|||||||
@@ -83,7 +83,7 @@ PYBIND11_MODULE(_constants, pymodule) {
|
|||||||
// from mujoco.h
|
// from mujoco.h
|
||||||
X(mjVERSION_HEADER);
|
X(mjVERSION_HEADER);
|
||||||
|
|
||||||
// from mjtnum.h
|
// from mjtype.h
|
||||||
X(mjMINVAL);
|
X(mjMINVAL);
|
||||||
|
|
||||||
#undef X
|
#undef X
|
||||||
|
|||||||
@@ -508,16 +508,6 @@ ENUMS: Mapping[str, EnumDecl] = dict([
|
|||||||
('mjSDFTYPE_COLLISION', 3),
|
('mjSDFTYPE_COLLISION', 3),
|
||||||
]),
|
]),
|
||||||
)),
|
)),
|
||||||
('mjtTaskStatus',
|
|
||||||
EnumDecl(
|
|
||||||
name='mjtTaskStatus',
|
|
||||||
declname='enum mjtTaskStatus_',
|
|
||||||
values=dict([
|
|
||||||
('mjTASK_NEW', 0),
|
|
||||||
('mjTASK_QUEUED', 1),
|
|
||||||
('mjTASK_COMPLETED', 2),
|
|
||||||
]),
|
|
||||||
)),
|
|
||||||
('mjtState',
|
('mjtState',
|
||||||
EnumDecl(
|
EnumDecl(
|
||||||
name='mjtState',
|
name='mjtState',
|
||||||
@@ -619,6 +609,16 @@ ENUMS: Mapping[str, EnumDecl] = dict([
|
|||||||
('mjS_AWAKE', 1),
|
('mjS_AWAKE', 1),
|
||||||
]),
|
]),
|
||||||
)),
|
)),
|
||||||
|
('mjtTaskStatus',
|
||||||
|
EnumDecl(
|
||||||
|
name='mjtTaskStatus',
|
||||||
|
declname='enum mjtTaskStatus_',
|
||||||
|
values=dict([
|
||||||
|
('mjTASK_NEW', 0),
|
||||||
|
('mjTASK_QUEUED', 1),
|
||||||
|
('mjTASK_COMPLETED', 2),
|
||||||
|
]),
|
||||||
|
)),
|
||||||
('mjtGeomInertia',
|
('mjtGeomInertia',
|
||||||
EnumDecl(
|
EnumDecl(
|
||||||
name='mjtGeomInertia',
|
name='mjtGeomInertia',
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <cstddef>
|
#include <cstddef>
|
||||||
#include <iostream>
|
#include <iostream>
|
||||||
|
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
namespace mujoco::python::_impl {
|
namespace mujoco::python::_impl {
|
||||||
|
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
// minimum number of vertices to use hill-climbing in mesh support
|
// minimum number of vertices to use hill-climbing in mesh support
|
||||||
#define mjMESH_HILLCLIMB_MIN 10
|
#define mjMESH_HILLCLIMB_MIN 10
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <stdlib.h>
|
#include <stdlib.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include "engine/engine_collision_convex.h"
|
#include "engine/engine_collision_convex.h"
|
||||||
#include "engine/engine_util_blas.h"
|
#include "engine/engine_util_blas.h"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#include "engine/engine_collision_convex.h"
|
#include "engine/engine_collision_convex.h"
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "engine/engine_plugin.h"
|
#include "engine/engine_plugin.h"
|
||||||
#include "engine/engine_util_blas.h"
|
#include "engine/engine_util_blas.h"
|
||||||
#include "engine/engine_util_errmem.h"
|
#include "engine/engine_util_errmem.h"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "engine/engine_util_blas.h"
|
#include "engine/engine_util_blas.h"
|
||||||
|
|
||||||
#ifdef _MSC_VER
|
#ifdef _MSC_VER
|
||||||
|
|||||||
@@ -15,7 +15,7 @@
|
|||||||
#ifndef MUJOCO_SRC_ENGINE_ENGINE_INLINE_H_
|
#ifndef MUJOCO_SRC_ENGINE_ENGINE_INLINE_H_
|
||||||
#define MUJOCO_SRC_ENGINE_ENGINE_INLINE_H_
|
#define MUJOCO_SRC_ENGINE_ENGINE_INLINE_H_
|
||||||
|
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -17,8 +17,8 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjtnum.h>
|
|
||||||
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
||||||
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjxmacro.h>
|
#include <mujoco/mjxmacro.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include <mujoco/mjmacro.h>
|
#include <mujoco/mjmacro.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjxmacro.h>
|
#include <mujoco/mjxmacro.h>
|
||||||
#include "engine/engine_core_constraint.h"
|
#include "engine/engine_core_constraint.h"
|
||||||
#include "engine/engine_core_util.h"
|
#include "engine/engine_core_util.h"
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
|
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#include "engine/engine_util_blas_avx.h" // IWYU pragma: keep
|
#include "engine/engine_util_blas_avx.h" // IWYU pragma: keep
|
||||||
|
|
||||||
|
|||||||
@@ -18,7 +18,7 @@
|
|||||||
#include <math.h>
|
#include <math.h>
|
||||||
|
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
|
|
||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
|
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
// res = vec*scl
|
// res = vec*scl
|
||||||
static inline
|
static inline
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
@@ -17,7 +17,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmacro.h>
|
#include <mujoco/mjmacro.h>
|
||||||
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
#include <mujoco/mjsan.h> // IWYU pragma: keep
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "engine/engine_memory.h"
|
#include "engine/engine_memory.h"
|
||||||
#include "engine/engine_util_blas.h"
|
#include "engine/engine_util_blas.h"
|
||||||
#include "engine/engine_util_misc.h"
|
#include "engine/engine_util_misc.h"
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "engine/engine_util_sparse_avx.h"
|
#include "engine/engine_util_sparse_avx.h"
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
|
|||||||
@@ -23,7 +23,7 @@
|
|||||||
#include <immintrin.h>
|
#include <immintrin.h>
|
||||||
#include <string.h>
|
#include <string.h>
|
||||||
|
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
|
|
||||||
//------------------------------ sparse operations using avx ---------------------------------------
|
//------------------------------ sparse operations using avx ---------------------------------------
|
||||||
|
|||||||
@@ -16,7 +16,7 @@
|
|||||||
#define MUJOCO_SRC_ENGINE_ENGINE_UTIL_SPATIAL_H_
|
#define MUJOCO_SRC_ENGINE_ENGINE_UTIL_SPATIAL_H_
|
||||||
|
|
||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
#ifdef __cplusplus
|
#ifdef __cplusplus
|
||||||
extern "C" {
|
extern "C" {
|
||||||
|
|||||||
+1
-1
@@ -21,7 +21,7 @@
|
|||||||
#include <mujoco/mjexport.h>
|
#include <mujoco/mjexport.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjspec.h>
|
#include <mujoco/mjspec.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
|
|
||||||
|
|
||||||
// this is a C-API
|
// this is a C-API
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjspec.h>
|
#include <mujoco/mjspec.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "cc/array_safety.h"
|
#include "cc/array_safety.h"
|
||||||
#include "engine/engine_util_blas.h"
|
#include "engine/engine_util_blas.h"
|
||||||
#include "engine/engine_util_errmem.h"
|
#include "engine/engine_util_errmem.h"
|
||||||
|
|||||||
@@ -26,7 +26,7 @@
|
|||||||
|
|
||||||
#include <mujoco/mjmacro.h>
|
#include <mujoco/mjmacro.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include "cc/array_safety.h"
|
#include "cc/array_safety.h"
|
||||||
#include "engine/engine_crossplatform.h"
|
#include "engine/engine_crossplatform.h"
|
||||||
|
|||||||
@@ -57,7 +57,7 @@
|
|||||||
#include <mujoco/mjmacro.h>
|
#include <mujoco/mjmacro.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "engine/engine_crossplatform.h" // IWYU pragma: keep
|
#include "engine/engine_crossplatform.h" // IWYU pragma: keep
|
||||||
#include "engine/engine_plugin.h"
|
#include "engine/engine_plugin.h"
|
||||||
#include "engine/engine_util_errmem.h"
|
#include "engine/engine_util_errmem.h"
|
||||||
|
|||||||
@@ -41,7 +41,7 @@
|
|||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjspec.h>
|
#include <mujoco/mjspec.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "cc/array_safety.h"
|
#include "cc/array_safety.h"
|
||||||
#include "engine/engine_core_util.h"
|
#include "engine/engine_core_util.h"
|
||||||
|
|||||||
@@ -30,7 +30,7 @@
|
|||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjspec.h>
|
#include <mujoco/mjspec.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "user/user_objects.h"
|
#include "user/user_objects.h"
|
||||||
|
|
||||||
typedef std::map<std::string, int, std::less<> > mjKeyMap;
|
typedef std::map<std::string, int, std::less<> > mjKeyMap;
|
||||||
|
|||||||
@@ -32,7 +32,7 @@
|
|||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjspec.h>
|
#include <mujoco/mjspec.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "user/user_cache.h"
|
#include "user/user_cache.h"
|
||||||
#include "user/user_util.h"
|
#include "user/user_util.h"
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjplugin.h>
|
#include <mujoco/mjplugin.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include "engine/engine_plugin.h"
|
#include "engine/engine_plugin.h"
|
||||||
#include "engine/engine_support.h"
|
#include "engine/engine_support.h"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
|
|
||||||
#include "src/engine/engine_collision_convex.h"
|
#include "src/engine/engine_collision_convex.h"
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "test/fixture.h"
|
#include "test/fixture.h"
|
||||||
#include <gmock/gmock.h>
|
#include <gmock/gmock.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
|
|||||||
@@ -19,7 +19,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "src/engine/engine_collision_sdf.h"
|
#include "src/engine/engine_collision_sdf.h"
|
||||||
#include "test/fixture.h"
|
#include "test/fixture.h"
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include <gmock/gmock.h>
|
#include <gmock/gmock.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include <mujoco/mjxmacro.h>
|
#include <mujoco/mjxmacro.h>
|
||||||
#include "src/cc/array_safety.h"
|
#include "src/cc/array_safety.h"
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "src/engine/engine_ray.h"
|
#include "src/engine/engine_ray.h"
|
||||||
#include "test/fixture.h"
|
#include "test/fixture.h"
|
||||||
|
|||||||
@@ -22,7 +22,7 @@
|
|||||||
#include <gmock/gmock.h>
|
#include <gmock/gmock.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "src/engine/engine_support.h"
|
#include "src/engine/engine_support.h"
|
||||||
#include "src/engine/engine_util_blas.h"
|
#include "src/engine/engine_util_blas.h"
|
||||||
|
|||||||
@@ -20,7 +20,7 @@
|
|||||||
|
|
||||||
#include <gmock/gmock.h>
|
#include <gmock/gmock.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include "test/fixture.h"
|
#include "test/fixture.h"
|
||||||
|
|
||||||
namespace mujoco {
|
namespace mujoco {
|
||||||
|
|||||||
@@ -21,7 +21,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <gtest/gtest-spi.h>
|
#include <gtest/gtest-spi.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "src/engine/engine_util_blas.h"
|
#include "src/engine/engine_util_blas.h"
|
||||||
#include "src/engine/engine_util_spatial.h"
|
#include "src/engine/engine_util_spatial.h"
|
||||||
|
|||||||
+1
-1
@@ -24,7 +24,7 @@
|
|||||||
#include <mujoco/mjdata.h>
|
#include <mujoco/mjdata.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjrender.h>
|
#include <mujoco/mjrender.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mjui.h>
|
#include <mujoco/mjui.h>
|
||||||
#include <mujoco/mjvisualize.h>
|
#include <mujoco/mjvisualize.h>
|
||||||
#include <mujoco/mjxmacro.h>
|
#include <mujoco/mjxmacro.h>
|
||||||
|
|||||||
@@ -28,7 +28,7 @@
|
|||||||
#include <absl/strings/str_format.h>
|
#include <absl/strings/str_format.h>
|
||||||
#include <absl/strings/str_replace.h>
|
#include <absl/strings/str_replace.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "src/cc/array_safety.h"
|
#include "src/cc/array_safety.h"
|
||||||
#include "test/fixture.h"
|
#include "test/fixture.h"
|
||||||
|
|||||||
@@ -24,7 +24,7 @@
|
|||||||
#include <gmock/gmock.h>
|
#include <gmock/gmock.h>
|
||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "test/fixture.h"
|
#include "test/fixture.h"
|
||||||
|
|
||||||
|
|||||||
@@ -31,7 +31,7 @@
|
|||||||
#include <gtest/gtest.h>
|
#include <gtest/gtest.h>
|
||||||
#include <absl/strings/match.h>
|
#include <absl/strings/match.h>
|
||||||
#include <mujoco/mjmodel.h>
|
#include <mujoco/mjmodel.h>
|
||||||
#include <mujoco/mjtnum.h>
|
#include <mujoco/mjtype.h>
|
||||||
#include <mujoco/mujoco.h>
|
#include <mujoco/mujoco.h>
|
||||||
#include "src/xml/xml_numeric_format.h"
|
#include "src/xml/xml_numeric_format.h"
|
||||||
#include "test/fixture.h"
|
#include "test/fixture.h"
|
||||||
|
|||||||
@@ -64,7 +64,7 @@ public const bool ADDRESS_SANITIZER = true;
|
|||||||
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJSPEC_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJSPEC_H_ = true;
|
||||||
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTHREAD_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTHREAD_H_ = true;
|
||||||
public const int mjMAXTHREAD = 128;
|
public const int mjMAXTHREAD = 128;
|
||||||
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTNUM_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_INCLUDE_MJTYPE_H_ = true;
|
||||||
public const double mjMINVAL = 1e-15;
|
public const double mjMINVAL = 1e-15;
|
||||||
public const bool THIRD_PARTY_MUJOCO_MJUI_H_ = true;
|
public const bool THIRD_PARTY_MUJOCO_MJUI_H_ = true;
|
||||||
public const int mjMAXUISECT = 10;
|
public const int mjMAXUISECT = 10;
|
||||||
@@ -443,11 +443,6 @@ public enum mjtSDFType : int{
|
|||||||
mjSDFTYPE_MIDSURFACE = 2,
|
mjSDFTYPE_MIDSURFACE = 2,
|
||||||
mjSDFTYPE_COLLISION = 3,
|
mjSDFTYPE_COLLISION = 3,
|
||||||
}
|
}
|
||||||
public enum mjtTaskStatus : int{
|
|
||||||
mjTASK_NEW = 0,
|
|
||||||
mjTASK_QUEUED = 1,
|
|
||||||
mjTASK_COMPLETED = 2,
|
|
||||||
}
|
|
||||||
public enum mjtState : int{
|
public enum mjtState : int{
|
||||||
mjSTATE_TIME = 1,
|
mjSTATE_TIME = 1,
|
||||||
mjSTATE_QPOS = 2,
|
mjSTATE_QPOS = 2,
|
||||||
@@ -519,6 +514,11 @@ public enum mjtSleepState : int{
|
|||||||
mjS_ASLEEP = 0,
|
mjS_ASLEEP = 0,
|
||||||
mjS_AWAKE = 1,
|
mjS_AWAKE = 1,
|
||||||
}
|
}
|
||||||
|
public enum mjtTaskStatus : int{
|
||||||
|
mjTASK_NEW = 0,
|
||||||
|
mjTASK_QUEUED = 1,
|
||||||
|
mjTASK_COMPLETED = 2,
|
||||||
|
}
|
||||||
public enum mjtGeomInertia : int{
|
public enum mjtGeomInertia : int{
|
||||||
mjINERTIA_VOLUME = 0,
|
mjINERTIA_VOLUME = 0,
|
||||||
mjINERTIA_SHELL = 1,
|
mjINERTIA_SHELL = 1,
|
||||||
|
|||||||
Reference in New Issue
Block a user