Skip to content

Typing

typing

MeshName module-attribute

Python
MeshName = NewType('MeshName', str)

Alias of string. Used to type hint a field is the name of a Mesh.

HFieldName module-attribute

Python
HFieldName = NewType('HFieldName', str)

Alias of string. Used to type hint a field is the name of an HField.

MaterialName module-attribute

Python
MaterialName = NewType('MaterialName', str)

Alias of string. Used to type hint a field is the name of a Material.

TextureName module-attribute

Python
TextureName = NewType('TextureName', str)

Alias of string. Used to type hint a field is the name of a Texture.

ModelName module-attribute

Python
ModelName = NewType('ModelName', str)

Alias of string. Used to type hint a field is the name of a Model.

BodyName module-attribute

Python
BodyName = NewType('BodyName', str)

Alias of string. Used to type hint a field is the name of a Body.

JointName module-attribute

Python
JointName = NewType('JointName', str)

Alias of string. Used to type hint a field is the name of a Joint.

GeomName module-attribute

Python
GeomName = NewType('GeomName', str)

Alias of string. Used to type hint a field is the name of a Geom.

SiteName module-attribute

Python
SiteName = NewType('SiteName', str)

Alias of string. Used to type hint a field is the name of a Site.

CameraName module-attribute

Python
CameraName = NewType('CameraName', str)

Alias of string. Used to type hint a field is the name of a Camera.

LightName module-attribute

Python
LightName = NewType('LightName', str)

Alias of string. Used to type hint a field is the name of a Light.

FrameName module-attribute

Python
FrameName = NewType('FrameName', str)

Alias of string. Used to type hint a field is the name of a Frame.

ContactPairName module-attribute

Python
ContactPairName = NewType('ContactPairName', str)

Alias of string. Used to type hint a field is the name of a contact Pair.

ContactExcludeName module-attribute

Python
ContactExcludeName = NewType('ContactExcludeName', str)

Alias of string. Used to type hint a field is the name of a contact Exclude.

DeformableSkinName module-attribute

Python
DeformableSkinName = NewType('DeformableSkinName', str)

Alias of string. Used to type hint a field is the name of a DeformableSkin.

FlexName module-attribute

Python
FlexName = NewType('FlexName', str)

Alias of string. Used to type hint a field is the name of a DeformableFlex.

EqualityName module-attribute

Python
EqualityName = NewType('EqualityName', str)

Alias of string. Used to type hint a field is the name of an Eqaulity.

TendonName module-attribute

Python
TendonName = NewType('TendonName', str)

Alias of string. Used to type hint a field is the name of a Tendon.

ActuatorName module-attribute

Python
ActuatorName = NewType('ActuatorName', str)

Alias of string. Used to type hint a field is the name of an Actuator.

PluginName module-attribute

Python
PluginName = NewType('PluginName', str)

Alias of string. Used to type hint a field is the name of a Plugin.

InstanceName module-attribute

Python
InstanceName = NewType('InstanceName', str)

Alias of string. Used to type hint a field is the name of a plugin Instance.

SensorName module-attribute

Python
SensorName = NewType('SensorName', str)

Alias of string. Used to type hint a field is the name of a Sensor.

KeyName module-attribute

Python
KeyName = NewType('KeyName', str)

Alias of string. Used to type hint a field is the name of a Key.

SensorAttachableName module-attribute

Python
SensorAttachableName = (
    BodyName | GeomName | SiteName | CameraName
)

Alias of names which can have a sensor attached to them.

ActuatorGroup module-attribute

Python
ActuatorGroup = Annotated[int, Field(ge=0, le=30)]

An integer representing an actuator group index. Must be between 0 and 30 inclusive.

GeomGroup module-attribute

Python
GeomGroup = Annotated[int, Field(ge=0, le=30)]

An integer representing a geom group index. Must be between 0 and 30 inclusive.

InertiaGroupRange module-attribute

Python
InertiaGroupRange = tuple[GeomGroup, GeomGroup]

A tuple specifying the inclusive range of geom groups used for inertia computation.

GridLayoutStr module-attribute

Python
GridLayoutStr = Annotated[
    str,
    Field(
        pattern="^[\\.RLUDFB]+$",
        description="String which may only use `'.'`, `'R'`, `'L'`, `'U'`, `'D'`, `'F'`, and `'B'`",
    ),
]

A string used for texture grid layout. May only include '.', 'R', 'L', 'U', 'D', 'F', and 'B'.

Vec2

Python
Vec2 = _VecBase

A 2-element numeric array.

Vec3

Python
Vec3 = _VecBase

A 3-element numeric array, often used for positions or directions.

Vec4

Python
Vec4 = _VecBase

A 4-element numeric array, often used for RGBA colors or quaternions.

Vec5

Python
Vec5 = _VecBase

A 5-element numeric array.

Vec6

Python
Vec6 = _VecBase

A 6-element numeric array.

Vec7

Python
Vec7 = _VecBase

A 7-element numeric array.

Vec9

Python
Vec9 = _VecBase

A 9-element numeric array.

VecN

Python
VecN = _VecBase

An N-element numeric array of arbitrary length.

Mat2

Python
Mat2 = _VecBase

A 2x2 numeric matrix.

Mat3

Python
Mat3 = _VecBase

A 3x3 numeric matrix, often used for rotation matrices or inertia tensors.

Mat4

Python
Mat4 = _VecBase

A 4x4 numeric matrix.

Mat5

Python
Mat5 = _VecBase

A 5x5 numeric matrix.

Mat6

Python
Mat6 = _VecBase

A 6x6 numeric matrix.

Mat7

Python
Mat7 = _VecBase

A 7x7 numeric matrix.

Mat9

Python
Mat9 = _VecBase

A 9x9 numeric matrix.

MatN

Python
MatN = _VecBase

An NxN numeric matrix of arbitrary length.

EulerSeq

Bases: StrEnum

Euler rotation sequences.

  • Lowercase letters denote intrinsic rotations (about the rotating frame).
  • Uppercase letters denote extrinsic rotations (about the fixed parent frame).

xyz class-attribute instance-attribute

Python
xyz = 'xyz'

Intrinsic Tait-Bryan xyz sequence.

xzy class-attribute instance-attribute

Python
xzy = 'xzy'

Intrinsic Tait-Bryan xzy sequence.

yxz class-attribute instance-attribute

Python
yxz = 'yxz'

Intrinsic Tait-Bryan yxz sequence.

yzx class-attribute instance-attribute

Python
yzx = 'yzx'

Intrinsic Tait-Bryan yzx sequence.

zxy class-attribute instance-attribute

Python
zxy = 'zxy'

Intrinsic Tait-Bryan zxy sequence.

zyx class-attribute instance-attribute

Python
zyx = 'zyx'

Intrinsic Tait-Bryan zyx sequence.

xyx class-attribute instance-attribute

Python
xyx = 'xyx'

Intrinsic proper Euler xyx sequence.

xzx class-attribute instance-attribute

Python
xzx = 'xzx'

Intrinsic proper Euler xzx sequence.

yxy class-attribute instance-attribute

Python
yxy = 'yxy'

Intrinsic proper Euler yxy sequence.

yzy class-attribute instance-attribute

Python
yzy = 'yzy'

Intrinsic proper Euler yzy sequence.

zxz class-attribute instance-attribute

Python
zxz = 'zxz'

Intrinsic proper Euler zxz sequence.

zyz class-attribute instance-attribute

Python
zyz = 'zyz'

Intrinsic proper Euler zyz sequence.

XYZ class-attribute instance-attribute

Python
XYZ = 'XYZ'

Extrinsic Tait-Bryan XYZ sequence

XZY class-attribute instance-attribute

Python
XZY = 'XZY'

Extrinsic Tait-Bryan XZY sequence

YXZ class-attribute instance-attribute

Python
YXZ = 'YXZ'

Extrinsic Tait-Bryan YXZ sequence

YZX class-attribute instance-attribute

Python
YZX = 'YZX'

Extrinsic Tait-Bryan YZX sequence

ZXY class-attribute instance-attribute

Python
ZXY = 'ZXY'

Extrinsic Tait-Bryan ZXY sequence

ZYX class-attribute instance-attribute

Python
ZYX = 'ZYX'

Extrinsic Tait-Bryan ZYX sequence

XYX class-attribute instance-attribute

Python
XYX = 'XYX'

Extrinsic proper Euler XYX

XZX class-attribute instance-attribute

Python
XZX = 'XZX'

Extrinsic proper Euler XZX

YXY class-attribute instance-attribute

Python
YXY = 'YXY'

Extrinsic proper Euler YXY

YZY class-attribute instance-attribute

Python
YZY = 'YZY'

Extrinsic proper Euler YZY

ZXZ class-attribute instance-attribute

Python
ZXZ = 'ZXZ'

Extrinsic proper Euler ZXZ

ZYZ class-attribute instance-attribute

Python
ZYZ = 'ZYZ'

Extrinsic proper Euler ZYZ

LayerRole

Bases: StrEnum

Role of the texture. The valid values, expected number of channels, and the role semantics are:

RGB class-attribute instance-attribute

Python
RGB = 'rgb'

3 channels. base color / albedo [red, green, blue].

NORMAL class-attribute instance-attribute

Python
NORMAL = 'normal'

3 channels. bump map (surface normals).

OCCLUSION class-attribute instance-attribute

Python
OCCLUSION = 'occlusion'

1 channel. ambient occlusion.

ROUGHNESS class-attribute instance-attribute

Python
ROUGHNESS = 'roughness'

1 channel. roughness.

METALLIC class-attribute instance-attribute

Python
METALLIC = 'metallic'

1 channel. metallicity.

OPACITY class-attribute instance-attribute

Python
OPACITY = 'opacity'

1 channel. opacity (alpha channel).

EMISSIVE class-attribute instance-attribute

Python
EMISSIVE = 'emissive'

4 channels. RGB light emmision intensity, exposure weight in 4th channel.

ORM class-attribute instance-attribute

Python
ORM = 'orm'

3 channels. packed 3 channel [occlusion, roughness, metallic].

RGBA class-attribute instance-attribute

Python
RGBA = 'rgba'

4 channels. packed 4 channel [red, green, blue, alpha].

GeomType

Bases: StrEnum

Enumeration of supported geometric types in MuJoCo.

PLANE class-attribute instance-attribute

Python
PLANE = 'plane'

Plane which is infinite for collision detection purposes.

HFIELD class-attribute instance-attribute

Python
HFIELD = 'hfield'

Height field geom.

SPHERE class-attribute instance-attribute

Python
SPHERE = 'sphere'

Sphere geom.

CAPSULE class-attribute instance-attribute

Python
CAPSULE = 'capsule'

A capsule, which is a cylinder capped with two half-spheres.

ELLIPSOID class-attribute instance-attribute

Python
ELLIPSOID = 'ellipsoid'

Ellipoid geom.

CYLINDER class-attribute instance-attribute

Python
CYLINDER = 'cylinder'

Cylinder geom.

BOX class-attribute instance-attribute

Python
BOX = 'box'

Box geom.

MESH class-attribute instance-attribute

Python
MESH = 'mesh'

Mesh geom.

SDF class-attribute instance-attribute

Python
SDF = 'sdf'

Signed distance field (SDF, also referred to as signed distance function).

Integrator

Bases: StrEnum

Enumeration of simulation integrators.

EULER class-attribute instance-attribute

Python
EULER = 'Euler'

Semi-implicit with implicit joint damping (Euler).

For this method, DD only includes derivatives of joint damping. Note that in this case DD is diagonal and Mhat is symmetric, so LT L decomposition (a variant of Cholesky) can be used. This factorization is stored mjData.qLD. If the model has no joint damping or the eulerdamp disable-flag is set, implicit damping is disabled and the semi-implicit update (3) is used, rather than (6), avoiding the additional factorization of Mhat (additional because MM is already factorized for the acceleration update (5)).

RK4 class-attribute instance-attribute

Python
RK4 = 'RK4'

4th-order Runge-Kutta (RK4).

One advantage of our continuous-time formulation is that we can use higher order integrators such as Runge-Kutta or multistep methods. The only such integrator currently implemented is the fixed-step 4th-order Runge-Kutta method, though users can easily implement other integrators by calling mj_forward and integrating accelerations themselves. We have observed that for energy-conserving systems (example), RK4 is qualitatively better than the single-step methods, both in terms of stability and accuracy, even when the timestep is decreased by a factor of 4 (so the computational effort is identical). In the presence of large velocity- dependent forces, if the chosen single-step method integrates those forces implicitly, single-step methods can be significantly more stable than RK4.

IMPLICIT class-attribute instance-attribute

Python
IMPLICIT = 'implicit'

Implicit-in-velocity (implicit).

For this method, D includes derivatives of all forces except the constraint forces JTf(v). These are currently ignored since even though computing them is possible, it is complicated, and numerical tests show that including them does not confer much benefit. That said, analytical derivatives of constraint forces are planned for a future version. Additionally, we restrict D to have the same sparsity pattern as M, for computational efficiency. This restriction will exclude damping in tendons which connect bodies that are on different branches of the kinematic tree. Since D is not symmetric, we cannot use Cholesky factorization, but because D and M have the same sparsity pattern corresponding to the topology of the kinematic tree, reverse-order LU factorization of Mhat is guaranteed to have no fill-in. This factorization is stored mjData.qLU.

IMPLICITFAST class-attribute instance-attribute

Python
IMPLICITFAST = 'implicitfast'

Fast implicit-in-velocity (implicitfast).

For this method, DD includes derivatives of all forces used in the implicit method, with the exception of the centripetal and Coriolis forces c(v) computed by the RNE algorithm. Additionally, it is symmetrized D←(D+DT)/2. One reason for dropping the RNE derivatives is that they are the most expensive to compute. Second, these forces change rapidly only at high rotational velocities of complex pendula and spinning bodies, scenarios which are not common and already well-handled by the Runge-Kutta integrator (see below). Because the RNE derivatives are also the main source of asymmetry of D, by dropping them and symmetrizing, we can use the faster LTL rather than LU decomposition.

Cone

Bases: StrEnum

Cone types used in collision/contact modeling.

PYRAMIDAL class-attribute instance-attribute

Python
PYRAMIDAL = 'pyramidal'

Sometimes make the solver faster and more robust.

ELLIPTIC class-attribute instance-attribute

Python
ELLIPTIC = 'elliptic'

Better model of the physical reality.

Jacobian

Bases: StrEnum

Jacobian computation methods.

DENSE class-attribute instance-attribute

Python
DENSE = 'dense'

Dense jacobian.

SPARSE class-attribute instance-attribute

Python
SPARSE = 'sparse'

Sparse jacobian.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Resolves to dense when the number of degrees of freedom is up to 60, and sparse over 60.

Solver

Bases: StrEnum

Solver algorithms for constraint resolution.

PGS class-attribute instance-attribute

Python
PGS = 'PGS'

Projected Gauss-Seidel method.

This is the most common algorithm used in physics simulators, and used to be the default in MuJoCo, until we developed the Newton method which appears to be better in every way. PGS uses the dual formulation. Unlike gradient-based methods which improve the solution along oblique directions, Gauss-Seidel works on one scalar component at a time, and sets it to its optimal value given the current values of all other components. One sweep of PGS has the computational complexity of one matrix-vector multiplication (although the constants are larger). It has first-order convergence but nevertheless makes rapid progress in a few iterations.

CG class-attribute instance-attribute

Python
CG = 'CG'

Conjugate gradient method.

This algorithm uses the non-linear conjugate gradient method with the Polak-Ribiere-Plus formula. Line-search is exact, using Newton's method in one dimension, with analytical second derivatives.

NEWTON class-attribute instance-attribute

Python
NEWTON = 'Newton'

Newton's method.

This algorithm implements the exact Newton method, with analytical second-order derivatives and Cholesky factorization of the Hessian. The line-search is the same as in the CG method. It is the default solver.

EnableDisable

Bases: StrEnum

Enable or disable a feature.

ENABLE class-attribute instance-attribute

Python
ENABLE = 'enable'

Enable the feature.

DISABLE class-attribute instance-attribute

Python
DISABLE = 'disable'

Disable the feature.

Coordinate

Bases: StrEnum

In previous versions, this attribute could be used to specify whether frame positions and orientations are expressed in local or global coordinates, but the "global" option has since been removed, and will cause an error to be generated. In order to convert older models which used the "global" option, load and save them in MuJoCo 2.3.3 or older.

Angle

Bases: StrEnum

This attribute specifies whether the angles in the MJCF model are expressed in units of degrees or radians. The compiler converts degrees into radians, and mjModel always uses radians. For URDF models the parser sets this attribute to "radian" internally, regardless of the XML setting.

InertiaFromGeom

Bases: StrEnum

This attribute controls the automatic inference of body masses and inertias from geoms attached to the body.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

No automatic inference is performed. In that case each body must have explicitly defined mass and inertia with the inertial element, or else a compile error will be generated.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

The mass and inertia of each body will be inferred from the geoms attached to it, overriding any values specified with the inertial element.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Masses and inertias are inferred automatically only when the inertial element is missing in the body definition.

LengthRangeMode

Bases: StrEnum

Determines the type of actuators to which length range computation is applied.

NONE class-attribute instance-attribute

Python
NONE = 'none'

Disables this functionality.

MUSCLE class-attribute instance-attribute

Python
MUSCLE = 'muscle'

Applies to actuators whose gaintype or biastype is set to muscle

MUSCLEUSER class-attribute instance-attribute

Python
MUSCLEUSER = 'muscleuser'

Applies to actuators whose gaintype or biastype is set to either muscle or user.

ALL class-attribute instance-attribute

Python
ALL = 'all'

Applies to all actuators.

DynType

Bases: StrEnum

Activation dynamics type of actuators.

NONE class-attribute instance-attribute

Python
NONE = 'none'

No internal state

INTEGRATOR class-attribute instance-attribute

Python
INTEGRATOR = 'integrator'

act_dot = ctrl

FILTER class-attribute instance-attribute

Python
FILTER = 'filter'

act_dot = (ctrl - act) / dynprm[0]

FILTEREXACT class-attribute instance-attribute

Python
FILTEREXACT = 'filterexact'

Like filter but with exact integration

MUSCLE class-attribute instance-attribute

Python
MUSCLE = 'muscle'

act_dot = mju_muscleDynamics(...)

USER class-attribute instance-attribute

Python
USER = 'user'

act_dot = mjcb_act_dyn(...)

GainType

Bases: StrEnum

Gain type of actuators.

FIXED class-attribute instance-attribute

Python
FIXED = 'fixed'

gain_term = gainprm[0]

AFFINE class-attribute instance-attribute

Python
AFFINE = 'affine'

gain_term = gain_prm[0] + gain_prm[1] * length + gain_prm[2] * velocity

MUSCLE class-attribute instance-attribute

Python
MUSCLE = 'muscle'

gain_term = mju_muscleGain(...)

USER class-attribute instance-attribute

Python
USER = 'user'

gain_term = mjcb_act_gain(...)

BiasType

Bases: StrEnum

Bias type of actuators.

NONE class-attribute instance-attribute

Python
NONE = 'none'

bias_term = 0

AFFINE class-attribute instance-attribute

Python
AFFINE = 'affine'

bias_term = biasprm[0] + biasprm[1]length + biasprm[2]velocity

MUSCLE class-attribute instance-attribute

Python
MUSCLE = 'muscle'

bias_term = mju_muscleBias(...)

USER class-attribute instance-attribute

Python
USER = 'user'

bias_term = mjcb_act_bias(...)

Inertia

Bases: StrEnum

This attribute controls how the mesh is used when mass and inertia are inferred from geometry. The current default value legacy will be changed to convex in a future release.

CONVEX class-attribute instance-attribute

Python
CONVEX = 'convex'

Use the mesh's convex hull to compute volume and inertia, assuming uniform density.

EXACT class-attribute instance-attribute

Python
EXACT = 'exact'

Compute volume and inertia exactly, even for non-convex meshes. This algorithm requires a well-oriented, watertight mesh and will error otherwise.

LEGACY class-attribute instance-attribute

Python
LEGACY = 'legacy'

Use the legacy algorithm, leads to volume overcounting for non-convex meshes. Though currently the default to avoid breakages, it is not recommended.

SHELL class-attribute instance-attribute

Python
SHELL = 'shell'

Assume mass is concentrated on the surface of the mesh. Use the mesh's surface to compute the inertia, assuming uniform surface density.

TextureType

Bases: StrEnum

This attribute determines how the texture is represented and mapped to objects. It also determines which of the remaining attributes are relevant.

D2 class-attribute instance-attribute

Python
D2 = '2d'

Maps a 2D image to a 3D object using texture coordinates (a.k.a UV coordinates). However, UV coordinates are only available for meshes.

CUBE class-attribute instance-attribute

Python
CUBE = 'cube'

Has the effect of shrink-wrapping a texture cube over an object. Apart from the adjustment provided by the texuniform attribute of material, the process is automatic.

SKYBOX class-attribute instance-attribute

Python
SKYBOX = 'skybox'

Very similar to cube mapping, and in fact the texture data is specified in exactly the same way. The only difference is that the visualizer uses the first such texture defined in the model to render a skybox.

ColorSpace

Bases: StrEnum

This attribute determines the color space of the texture. The default value auto means that the color space will be determined from the image file itself. If no color space is defined in the file, then linear is assumed.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Color space will be determined from the image file itself. If no color space is defined in the file, then linear is assumed.

LINEAR class-attribute instance-attribute

Python
LINEAR = 'linear'

Linear color space.

SRGB class-attribute instance-attribute

Python
SRGB = 'srgb'

SRGB color space.

TextureBuiltInType

Bases: StrEnum

This and the remaining attributes control the generation of procedural textures. If the value of this attribute is different from "none", the texture is treated as procedural and any file names are ignored.

NONE class-attribute instance-attribute

Python
NONE = 'none'

No builtin texture.

GRADIENT class-attribute instance-attribute

Python
GRADIENT = 'gradient'

Generates a color gradient from rgb1 to rgb2. The interpolation in color space is done through a sigmoid function. For cube and skybox textures the gradient is along the +Y axis, i.e., from top to bottom for skybox rendering.

CHECKER class-attribute instance-attribute

Python
CHECKER = 'checker'

Generates a 2-by-2 checker pattern with alternating colors given by rgb1 and rgb2. This is suitable for rendering ground planes and also for marking objects with rotational symmetries. Note that 2d textures can be scaled so as to repeat the pattern as many times as necessary. For cube and skybox textures, the checker pattern is painted on each side of the cube.

FLAT class-attribute instance-attribute

Python
FLAT = 'flat'

Fills the entire texture with rgb1, except for the bottom face of cube and skybox textures which is filled with rgb2.

Mark

Bases: StrEnum

Procedural textures can be marked with the markrgb color, on top of the colors determined by the builtin type. All markings are one-pixel wide, thus the markings appear larger and more diffuse on smaller textures.

NONE class-attribute instance-attribute

Python
NONE = 'none'

No marks.

EDGE class-attribute instance-attribute

Python
EDGE = 'edge'

Edges of all texture images are marked.

CROSS class-attribute instance-attribute

Python
CROSS = 'cross'

A cross is marked in the middle of each image.

RANDOM class-attribute instance-attribute

Python
RANDOM = 'random'

Randomly chosen pixels are marked.

Sleep

Bases: StrEnum

Sleep policy for the tree under this body. This attribute is only supported by moving bodies which are the root of a kinematic tree.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Compiler will set the sleep policy as follows:

  • A tree which is affected by actuators is not allowed to sleep (overridable).
  • Trees which are connected by tendons which have non-zero stiffness and damping are not allowed to sleep (overridable).
  • Trees which are connected by tendons which connect more than two trees are not allowed to sleep (not overridable).
  • flexes are not allowed to sleep (not overridable).
  • All other trees are allowed to sleep (overridable).

NEVER class-attribute instance-attribute

Python
NEVER = 'never'

Constitute user overrides of the automatic compiler policy.

ALLOWED class-attribute instance-attribute

Python
ALLOWED = 'allowed'

Constitute user overrides of the automatic compiler policy.

INIT class-attribute instance-attribute

Python
INIT = 'init'

Can only be specified by the user and means "initialize this tree as asleep". This policy is implemented in mj_resetData and mj_makeData and only applies to the default configuration. If a keyframe changes the configuration of (or assigns nonzero velocity to) a sleeping tree, it will be woken up. This policy is useful for very large models where waiting for the automatic sleeping mechanism to kick in can be expensive. Trees initialized as sleeping can be placed in unstable configurations like deep penetration or in mid-air, but will only move when woken up. Also note that this policy can fail. For example if a tree marked as sleep="init" is in contact with a tree not marked as such (i.e., they are in the same island) then it is impossible to put the tree to sleep; such models will lead to a compilation error.

JointType

Bases: StrEnum

Types of joints supported in MuJoCo.

FREE class-attribute instance-attribute

Python
FREE = 'free'

Free "joint" with three translational degrees of freedom followed by three rotational degrees of freedom. In other words it makes the body floating. The rotation is represented as a unit quaternion. This joint type is only allowed in bodies that are children of the world body. No other joints can be defined in the body if a free joint is defined. Unlike the remaining joint types, free joints do not have a position within the body frame. Instead the joint position is assumed to coincide with the center of the body frame. Thus at runtime the position and orientation data of the free joint correspond to the global position and orientation of the body frame. Free joints cannot have limits.

BALL class-attribute instance-attribute

Python
BALL = 'ball'

A ball joint with three rotational degrees of freedom. The rotation is represented as a unit quaternion. The quaternion (1,0,0,0) corresponds to the initial configuration in which the model is defined. Any other quaternion is interpreted as a 3D rotation relative to this initial configuration. The rotation is around the point defined by the pos attribute. If a body has a ball joint, it cannot have other rotational joints (ball or hinge). Combining ball joints with slide joints in the same body is allowed.

SLIDE class-attribute instance-attribute

Python
SLIDE = 'slide'

A sliding or prismatic joint with one translational degree of freedom. Such joints are defined by a position and a sliding direction. For simulation purposes only the direction is needed; the joint position is used for rendering purposes.

HINGE class-attribute instance-attribute

Python
HINGE = 'hinge'

A hinge joint with one rotational degree of freedom. The rotation takes place around a specified axis through a specified position. This is the most common type of joint and is therefore the default. Most models contain only hinge and free joints.

JointLimited

Bases: StrEnum

Specifies if the joint has limits.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

Joint limits are disabled.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

Joint limits are enabled.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Joint limits will be enabled if range is defined (if autolimits is set in compiler).

TendonLimited

Bases: StrEnum

Specifies if the tendon has limits.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

Tendon limits are disabled.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

Tendon limits are enabled.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Tendon limits will be enabled if range is defined (if autolimits is set in compiler).

ActuatorControlLimited

Bases: StrEnum

Specifies if the actuator control input has limits.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

Control input clamping is disabled.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

Control input to this actuator is automatically clamped to ctrlrange at runtime.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

If autolimits is set in compiler, control clamping will automatically be set to true if ctrlrange is defined without explicitly setting this attribute to "true".

ActuatorForceLimited

Bases: StrEnum

This attribute specifies whether actuator forces acting on the joint should be clamped. See Force limits for details. It is available only for scalar joints (hinge and slider) and ignored for ball and free joints.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

Actuator force clamping is disabled.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

Actuator force clamping is enabled.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

If autolimits is set in compiler, actuator force clamping will be enabled if actuatorfrcrange/forcerange is defined.

ActuatorLimited

Bases: StrEnum

Specifies if the internal state (activation) associated with an actuator is clamped to actrange at runtime.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

Activation clamping is disabled.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

Activation clamping is enabled.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

If autolimits is set in compiler, activation clamping will automatically be set to true if actrange is defined without explicitly setting this attribute to "true".

Align

Bases: StrEnum

Specifies alignment options for aligning body frame and free joint.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

No alignment will occur between the body frame and free joint.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

Body frame and free joint will automatically be aligned with inertial frame.

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Compiler's alignfree global attribute will be respected.

FluidShape

Bases: StrEnum

Geometry-level fluid interaction model.

NONE class-attribute instance-attribute

Python
NONE = 'none'

I have no clue.

ELLIPSOID class-attribute instance-attribute

Python
ELLIPSOID = 'ellipsoid'

Activates the geom-level fluid interaction model based on an ellipsoidal approximation of the geom shape. When active, the model based on body inertia sizes is disabled for the body in which the geom is defined. See section on ellipsoid-based fluid interaction model for details.

TrackingMode

Bases: StrEnum

Specifies how the camera/light position and orientation in world coordinates are computed in forward kinematics (which in turn determine what the camera/light sees).

FIXED class-attribute instance-attribute

Python
FIXED = 'fixed'

The position and orientation specified are fixed relative to the body where the camera/light is defined.

TRACK class-attribute instance-attribute

Python
TRACK = 'track'

The camera/light position is at a constant offset from the body in world coordinates, while the camera/light orientation is constant in world coordinates. These constants are determined by applying forward kinematics in qpos0 and treating the camera/light as fixed. Tracking can be used for example to position a camera/light above a body, point it down so it sees the body, and have it always remain above the body no matter how the body translates and rotates.

TRACKCOM class-attribute instance-attribute

Python
TRACKCOM = 'trackcom'

similar to "track" but the constant spatial offset is defined relative to the center of mass of the kinematic subtree starting at the body in which the camera/light is defined. This can be used to keep an entire mechanism in view. Note that the subtree center of mass for the world body is the center of mass of the entire model. So if a camera/light is defined in the world body in mode "trackcom", it will track the entire model.

TARGETBODY class-attribute instance-attribute

Python
TARGETBODY = 'targetbody'

The camera/light position is fixed in the body frame, while the camera/light orientation is adjusted so that it always points towards the targeted body (which is specified with the target attribute below). This can be used for example to model an eye that fixates a moving object; the object will be the target, and the camera/light/eye will be defined in the body corresponding to the head.

TARGETBODYCOM class-attribute instance-attribute

Python
TARGETBODYCOM = 'targetbodycom'

The same as "targetbody" but the camera/light is oriented towards the center of mass of the subtree starting at the target body.

LightType

Bases: StrEnum

Determines the type of light. Note that some light types may not be supported by some renderers (e.g. only spot and directional lights are supported by the default native renderer).

SPOT class-attribute instance-attribute

Python
SPOT = 'spot'

Supported by default native renderer

DIRECTIONAL class-attribute instance-attribute

Python
DIRECTIONAL = 'directional'

Supported by default native renderer

POINT class-attribute instance-attribute

Python
POINT = 'point'

Not supported by default native renderer

IMAGE class-attribute instance-attribute

Python
IMAGE = 'image'

Not supported by default native renderer

FlexCompDOF

Bases: StrEnum

The parametrization of the flex's degrees of freedom (dofs).

FULL class-attribute instance-attribute

Python
FULL = 'full'

Three translational dofs per vertex. This is the most expressive but also the most expensive option.

RADIAL class-attribute instance-attribute

Python
RADIAL = 'radial'

A single radial translational dof per vertex. Note that unlike in the "full" case, the radial parametrization requires a free joint at the flex's parent in order for free body motion to be possible. This type of parametrization is appropriate for shapes that are relatively spherical.

D2 class-attribute instance-attribute

Python
D2 = '2d'

Two orthogonal translational dofs (X and Y) per vertex. This restricts the motion of the vertices to planes parallel to the parent body's X-Y plane.

TRILINEAR class-attribute instance-attribute

Python
TRILINEAR = 'trilinear'

Three translational dofs at each corner of the bounding box of the flex, for a total of 24 dofs for the entire flex, independent of the number of vertices. The positions of the vertices are updated using trilinear interpolation over the bounding box.

QUADRATIC class-attribute instance-attribute

Python
QUADRATIC = 'quadratic'

Three translational dofs per corner, edge, face, and volume of the bounding box of the flex, for a total of 81 dofs for the entire flex, independent of the number of vertices. The positions of the vertices are updated using quadratic interpolation over the bounding box. While this option requires more degrees of freedom than trilinear flexes, it enables curved deformation modes, while the only modes achievable for trilinear flexes are strech/compression and shear. To understand the difference between the two parametrizations, see a trilinear cube and a quadratic cube.

FlexCompType

Bases: StrEnum

The type of flexcomp object.

GRID class-attribute instance-attribute

Python
GRID = 'grid'

grid generates a rectangular grid of points in 1D, 2D or 3D as specified by dim. The number of points in each dimension is determined by count while the grid spacing in each dimension is determined by spacing. Make sure the spacing is sufficiently large relative to radius to avoid permanent contacts. In 2D and 3D the grid is automatically triangulated, and corresponding flex elements are created (triangles or tetrahedra). In 1D the elements are capsules connecting consecutive pairs of points.

BOX class-attribute instance-attribute

Python
BOX = 'box'

box generates a 3D box object, however flex bodies are only generated on the outer shell. Each flex body has a radial slider joint allowing it to move in and out from the center of the box. The parent body would normally be a floating body. The box surface is triangulated, and each flex element is a tetrahedron connecting the center of the box with one triangle face. count and spacing determine the count and spacing of the flex bodies, similar to the grid type in 3D. Note that the resulting flex has the same topology as the box generated by composite.

CYLINDER class-attribute instance-attribute

Python
CYLINDER = 'cylinder'

cylinder is the same as box, except the points are projected on the surface of a cylinder.

ELLIPSOID class-attribute instance-attribute

Python
ELLIPSOID = 'ellipsoid'

ellipsoid is the same as box, except the points are projected on the surface of an ellipsoid.

DISC class-attribute instance-attribute

Python
DISC = 'disc'

disc is the same as box, except the points are projected on the surface of a disc. It is only compatible with dim=2.

CIRCLE class-attribute instance-attribute

Python
CIRCLE = 'circle'

circle is the same as grid, except the points are sampled along a circle so that the first and last points are the same. The radius of the circle is computed such that each segment has the requested spacing. It is only compatible with dim=1.

MESH class-attribute instance-attribute

Python
MESH = 'mesh'

mesh loads the flexcomp points and elements (i.e. triangles) from a mesh file, in the same file formats as mesh assets, excluding the legacy .msh format. A mesh asset is not actually added to the model. Instead the vertex and face data from the mesh file are used to populate the point and element data of the flexcomp. dim is automatically set to 2. Recall that a mesh asset in MuJoCo can be used as a rigid geom attached to a single body. In contrast, the flex generated here corresponds to a soft mesh with the same initial shape, where each vertex is a separate moving body (unless pinned).

GMSH class-attribute instance-attribute

Python
GMSH = 'gmsh'

gmsh is similar to mesh, but it loads a GMSH file in format 4.1 and format 2.2 (ascii or binary). The file extension can be anything; the parser recognizes the format by examining the file header. This is a very rich file format, allowing all kinds of elements with different dimensionality and topology. MuJoCo only supports GMSH element types 1, 2, 4 which happen to correspond to our 1D, 2D and 3D flexes and assumes that the nodes are specified in a single block. Only the Nodes and Elements sections of the GMHS file are processed, and used to populate the point and element data of the flexcomp. The parser will generate an error if the GMSH file contains meshes that are not supported by MuJoCo. dim is automatically set to the dimensionality specified in the GMSH file. Presently this is the only mechanism to load a large tetrahedral mesh in MuJoCo and generate a corresponding soft entity. If such a mesh is available in a different file format, use the freely available GMSH software to convert it to GMSH in one of the supported versions.

DIRECT class-attribute instance-attribute

Python
DIRECT = 'direct'

direct allows the user to specify the point and element data of the flexcomp directly in the XML. Note that flexcomp will still generate moving bodies automatically, as well as automate other settings; so it still provides convenience compared to specifing the corresponding flex directly.

FlexElastic2D

Bases: StrEnum

Elastic contribution to passive forces of 2D flexes.

NONE class-attribute instance-attribute

Python
NONE = 'none'

None.

BEND class-attribute instance-attribute

Python
BEND = 'bend'

Bending only.

STRETCH class-attribute instance-attribute

Python
STRETCH = 'stretch'

Stretching only.

BOTH class-attribute instance-attribute

Python
BOTH = 'both'

Bending and stretching.

SelfCollide

Bases: StrEnum

This determines the strategy for midphase collision pruning of element pairs belonging to the same flex.

NONE class-attribute instance-attribute

Python
NONE = 'none'

Flex elements cannot collide with each other.

NARROW class-attribute instance-attribute

Python
NARROW = 'narrow'

Narrow phase only (i.e. all pairs are checked). This is a diagnostic tool and is never a good idea in practice.

BVH class-attribute instance-attribute

Python
BVH = 'bvh'

Bounding volume hierarchies (strategy for midphase collision pruning).

SAP class-attribute instance-attribute

Python
SAP = 'sap'

Sweep-and-prune (strategy for midphase collision pruning).

AUTO class-attribute instance-attribute

Python
AUTO = 'auto'

Select sap in 1D and 2D, and bvh in 3D. Which strategy performs better depends on the specifics of the model. The automatic setting is just a simple rule which we have found to perform well in general.

SensorObjectType

Bases: StrEnum

Types of objects to which a sensor may be attached. This must be an object type that has a spatial frame.

BODY class-attribute instance-attribute

Python
BODY = 'body'

Attach to a body in the inertial frame.

XBODY class-attribute instance-attribute

Python
XBODY = 'xbody'

Attach to a body in the regular frame of the body (usually centered at the joint with the parent body).

GEOM class-attribute instance-attribute

Python
GEOM = 'geom'

Attach to a geom.

SITE class-attribute instance-attribute

Python
SITE = 'site'

Attach to a site.

CAMERA class-attribute instance-attribute

Python
CAMERA = 'camera'

Attach to a camera.

ContactReduce

Bases: StrEnum

Reduces the number of matched contacts to exactly num sub-arrays, or "slots". If less than num contacts match, the remaining slots are set to be identically zero. Note that the default, "unsorted" reduction criterion is potentitally non-deterministic. See reduce below.

NONE class-attribute instance-attribute

Python
NONE = 'none'

Returns the first num contacts that satisfy the matching criterion, in the order that they appear in mjData.contact. Note that while this is the fastest option, it is also potentially non-deterministic: future changes to collision detection code may cause the identity and order of matching contacts to change.

MINDIST class-attribute instance-attribute

Python
MINDIST = 'mindist'

Returns num contacts with the smallest penetration depth, ascending order.

MAXFORCE class-attribute instance-attribute

Python
MAXFORCE = 'maxforce'

Returns num contacts with the largest force norm, descending order.

NETFORCE class-attribute instance-attribute

Python
NETFORCE = 'netforce'

This reduction criterion returns one new "synthetic" contact, located at the force-weighted centroid of all matched contacts. The frame of the contact is the global frame, so normal and tangent directions lose their natural semantic. The force and torque are computed such that a wrench applied at the computed position will have the same net effect as all the matching contacts combined. Note that this reduction criterion always returns exactly one contact.

ContactData

Bases: StrEnum

Specification of which data field(s) to report from the selected contacts.

Importantly, the data attribute can contain multiple sequential data types, as long as the relative order—as listed above—is maintained. For example, data = "found force dist" will return 5 numbers per contact (the concateneated values of [found, force, dist]), while data = "force found dist" is an error because found must come before force.

Missing contacts

If less than num contacts satisfy the matching criterion, the entire data slot is set to be identically zero. Because most data types can take 0 as a valid value, only the zero-ness of the normal and tangent unit vectors can be used to unambiguously detect an empty slot. For this reason, the found data type is in place to allow for simple detection of missing contacts.

Size of sensordata block

Unlike other sensors, the size of the corresponding sensordata block depends on the values of its attributes num and data. The total size of the output of a contact sensor is the product num x size(selected data fields). For example, requesting num = 6 contacts with data = "force dist normal" (3+1+3=7), will result in a sensordata block of 42 numbers (6 consecutive slots x 7 numbers per slot).

Direction convention

Because contacts create two equal-and-opposite forces between contacting bodies, there is freedom in the choice of which body impinges on which.

The sensor's convention is for "geom1/body1/subtree1" and "geom2/body2/subtree2" to determine the direction of the normal. The normal always points from the first to the second.

In the case that a direction cannot be determined, as when only a site is used as the matching criterion, or when both subtrees are the same, the normal direction is the same as it is in mjData.contact, where the normal points from the first to the second geom, and the two geoms are sorted according to their order in mjtGeom.

FOUND class-attribute instance-attribute

Python
FOUND = 'found'

float: This field serves two purposes. First, it indicates whether a contact was found in this slot, 0 means not found while a positive number means found. Second, the positive value equals the number of matching contacts. So if num = 3 contacts were requested but only 2 were matched, the found fields will equal (2, 2, 0); if 6 were matched they will equal (6, 6, 6).

FORCE class-attribute instance-attribute

Python
FORCE = 'force'

Vec3: The contact force, in the contact frame.

TORQUE class-attribute instance-attribute

Python
TORQUE = 'torque'

Vec3: The contact torque, in the contact frame.

DIST class-attribute instance-attribute

Python
DIST = 'dist'

float: The penetration distance.

POS class-attribute instance-attribute

Python
POS = 'pos'

float: The contact position, in the global frame.

NORMAL class-attribute instance-attribute

Python
NORMAL = 'normal'

Vec3: The contact normal direction, in the global frame.

TANGENT class-attribute instance-attribute

Python
TANGENT = 'tangent'

Vec3: The first tangent direction, in the global frame. In order to complete the full 3x3 contact frame, use tangent2 = cross(normal, tangent).

DataType

Bases: StrEnum

The type of output generated by this sensor.

AXIS class-attribute instance-attribute

Python
AXIS = 'axis'

Unit-length 3D vector.

QUATERNION class-attribute instance-attribute

Python
QUATERNION = 'quaternion'

Unit quaternion. These need to be declared because when MuJoCo adds noise, it must respect the vector normalization.

REAL class-attribute instance-attribute

Python
REAL = 'real'

Generic array (or scalar) of real values to which noise can be added independently.

POSITIVE class-attribute instance-attribute

Python
POSITIVE = 'positive'

NeedStage

Bases: StrEnum

The MuJoCo computation stage that must be completed before the user callback mjcb_sensor() is able to evaluate the output of this sensor.

POS class-attribute instance-attribute

Python
POS = 'pos'

Position stage.

VEL class-attribute instance-attribute

Python
VEL = 'vel'

Velocity stage.

ACC class-attribute instance-attribute

Python
ACC = 'acc'

Acceleration stage.

TextureMIME

Bases: StrEnum

Enumerations for valid Texture MIME types.

PNG class-attribute instance-attribute

Python
PNG = 'image/png'

Texture file is a PNG texture.

KTX class-attribute instance-attribute

Python
KTX = 'image/ktx'

Texture file is a Khronos Texture.

VND class-attribute instance-attribute

Python
VND = 'image/vnd.mujoco.texture'

Texture file is a vnd.mujoco.texture (whatever that is).

ActuatorInput

Bases: StrEnum

Specifies the input signal semantics. (see tech note, Section 2.5)

VOLTAGE class-attribute instance-attribute

Python
VOLTAGE = 'voltage'

The control directly sets applied motor voltage

POSITION class-attribute instance-attribute

Python
POSITION = 'position'

The PID controller uses the control as a reference setpoint relative to the joint position.

VELOCITY class-attribute instance-attribute

Python
VELOCITY = 'velocity'

The PID controller uses the control as a reference setpoint relative to the joint velocity.

CameraProjection

Bases: StrEnum

Whether the camera uses a perspective (the default) or orthographic projection. Setting this attribute to "orthographic" changes the semantic of the fovy attribute.

CameraOutput

Bases: StrEnum

Types of output images supported by the camera.

RGB class-attribute instance-attribute

Python
RGB = 'rgb'

RGB image.

DEPTH class-attribute instance-attribute

Python
DEPTH = 'depth'

Depth image (distance from camera plane).

DISTANCE class-attribute instance-attribute

Python
DISTANCE = 'distance'

Distance image (distance from camera origin).

NORMAL class-attribute instance-attribute

Python
NORMAL = 'normal'

Surface normal image.

SEGMENTATION class-attribute instance-attribute

Python
SEGMENTATION = 'segmentation'

Segmentation image.

RangefinderData

Bases: StrEnum

DIST class-attribute instance-attribute

Python
DIST = 'dist'

The distance from the ray origin to the nearest geom surface, -1 if no surface was hit. If this data type is included, rays will be visualized as lines.

DIR class-attribute instance-attribute

Python
DIR = 'dir'

Normalized direction of the ray, or (0, 0, 0) if no surface was hit.

ORIGIN class-attribute instance-attribute

Python
ORIGIN = 'origin'

The point from which the ray emanates (global frame). For sites and perspective cameras, this is the site/camera xpos. However for orthographic cameras, ray origins are spatially distributed along the image plane.

POINT class-attribute instance-attribute

Python
POINT = 'point'

The point where the ray intersects the nearest geom surface in the global frame, or (0, 0, 0) if no surface was hit. If this data type is included, intersection points will be visualized as spheres.

NORMAL class-attribute instance-attribute

Python
NORMAL = 'normal'

The geom surface normal at the point where the ray intersects it, in the global frame, or (0, 0, 0) if no surface was hit. Note that normals always point towards the outside of the geom surface, regardless of the ray origin. If this data type is included along with either dist or point, normals will be visualized as arrows at the intersection points.

DEPTH class-attribute instance-attribute

Python
DEPTH = 'depth'

The distance of the hit point from the camera plane, -1 if no surface was hit. Note that this depth semantic corresponds to depth images in the computer graphics sense.

SensorInterp

Bases: StrEnum

The interpolation method used when reading from the history buffer. Corresponds to the interp argument in mj_readSensor.

ZOH class-attribute instance-attribute

Python
ZOH = 'zoh'

Zero-order hold (piecewise constant).

LINEAR class-attribute instance-attribute

Python
LINEAR = 'linear'

Piecewise linear interpolation.

CUBIC class-attribute instance-attribute

Python
CUBIC = 'cubic'

Cubic spline interpolation (Catmull-Rom).

EdgeEquality

Bases: StrEnum

The type of equality constraint applied to this edge.

TRUE class-attribute instance-attribute

Python
TRUE = 'true'

No equality constraint is applied.

FALSE class-attribute instance-attribute

Python
FALSE = 'false'

Edge constraints are enforced.

VERT class-attribute instance-attribute

Python
VERT = 'vert'

Averaged constraint is used, see flexvert.

STRAIN class-attribute instance-attribute

Python
STRAIN = 'strain'

A constraint is added to enforce that the invariants of the strain tensor do not change; this is only equality constraint type supported for trilinear and quadratic dofs elements and here.

ProximityType

Bases: IntEnum

Exit types from proximity calculations.

SPHERE_TO_SPHERE class-attribute instance-attribute

Python
SPHERE_TO_SPHERE = 0

Returned value is from a broadphase test (bounding sphere to bounding sphere).

CONVEX_HULL class-attribute instance-attribute

Python
CONVEX_HULL = 1

Returned value is from a convex hull to convex hull test.

VERTEX_TO_FACE class-attribute instance-attribute

Python
VERTEX_TO_FACE = 3

Returned value is from a vertex to face test.

FACE_TO_FACE class-attribute instance-attribute

Python
FACE_TO_FACE = 4

Returned value is from a face to face test.