Implementation:Google deepmind Mujoco MJWarp Types
| Knowledge Sources | |
|---|---|
| Domains | Physics_Simulation, GPU_Computing, NVIDIA_Warp |
| Last Updated | 2026-02-15 04:00 GMT |
Overview
MJWarp Types defines all data types, enumerations, constants, and dataclass structures (Model, Data, Contact, Constraint) used throughout MuJoCo Warp.
Description
This module is the type foundation for the entire MuJoCo Warp system. It defines MuJoCo constants (MJ_MINVAL, MJ_MAXVAL, MJ_MAXCONPAIR), numerous IntEnum classes mirroring MuJoCo C enumerations (GeomType, JointType, SolverType, IntegratorType, ConeType, etc.), custom Warp vector and matrix types (vec5, vec6, vec8, vec10, vec11, mat23, mat43, mat63), and the primary dataclass structures: Model (static simulation parameters), Data (dynamic simulation state), Contact (contact information), Constraint (constraint rows), Option (solver options), CollisionContext, and RenderContext. The BlockDim dataclass provides configurable GPU kernel block dimensions.
Usage
Imported by every other MJWarp module for type definitions, constants, and enum values. The Model and Data classes are the primary interfaces for the simulation pipeline.
Code Reference
Source Location
- Repository: Google_deepmind_Mujoco
- File: mjx/mujoco/mjx/third_party/mujoco_warp/_src/types.py
- Lines: 1-1880
Key Functions
# Primary dataclasses
class Model: # Static simulation model (geometry, joints, actuators, etc.)
class Data: # Dynamic simulation state (positions, velocities, forces, etc.)
class Contact: # Contact information (geom pairs, positions, normals, depths)
class Constraint: # Constraint rows (Jacobian, bounds, forces)
class Option: # Solver and simulation options
class Statistic: # Model statistics
class TileSet: # GPU tile configuration
# Enumeration types (selection)
class GeomType(enum.IntEnum): PLANE, HFIELD, SPHERE, CAPSULE, ELLIPSOID, CYLINDER, BOX, MESH, SDF
class JointType(enum.IntEnum): FREE, BALL, SLIDE, HINGE
class SolverType(enum.IntEnum): PGS, CG, NEWTON
class IntegratorType(enum.IntEnum): EULER, RK4, IMPLICIT, IMPLICITFAST
class ConeType(enum.IntEnum): PYRAMIDAL, ELLIPTIC
class BroadphaseType(enum.IntEnum): NXN, SAP_TILE, SAP_SEGMENTED
class DisableBit(enum.IntFlag): ...
class EnableBit(enum.IntFlag): ...
# Context dataclasses
class CollisionContext: ...
class RenderContext: ...
class BlockDim: ...
# Custom Warp types
vec5, vec6, vec8, vec10, vec11
mat23, mat43, mat63
Import
from mujoco.mjx.third_party.mujoco_warp._src.types import Model
from mujoco.mjx.third_party.mujoco_warp._src.types import Data
from mujoco.mjx.third_party.mujoco_warp._src.types import GeomType
from mujoco.mjx.third_party.mujoco_warp._src.types import JointType
from mujoco.mjx.third_party.mujoco_warp._src.types import DisableBit
I/O Contract
Inputs
| Name | Type | Required | Description |
|---|---|---|---|
| (type definitions) | N/A | N/A | This module defines types; it does not process inputs directly |
Outputs
| Name | Type | Description |
|---|---|---|
| Model | dataclass | GPU-resident model holding all static simulation parameters |
| Data | dataclass | GPU-resident data holding all dynamic simulation state |
| Contact | dataclass | Contact data structure for collision results |
| Constraint | dataclass | Constraint data structure for solver inputs |