Skip to main content
Methods for querying the structure of the loaded MuJoCo model.

getBodies()

Get all bodies in the model.
Returns: BodyInfo[]

getJoints()

Get all joints in the model.
Returns: JointInfo[]

getGeoms()

Get all geoms in the model.
Returns: GeomInfo[]

getSites()

Get all sites in the model.
Returns: SiteInfo[]

getActuators()

Get all actuators in the model.
Returns: ActuatorInfo[]

getActuatedJoints()

Get scalar hinge/slide joints that are directly driven by actuators.
Returns: ActuatedJointInfo[]

getControlMap()

Get a writable control group for all directly actuated scalar joints.
Returns: ControlGroupInfo

resolveControlGroup(selector)

Resolve the same mapping for a site, body, joint selector, or actuator selector.
Use this when a model’s actuator order does not match qpos order, or when a scene contains multiple robots.

getSensors()

Get all sensors in the model.
Returns: SensorInfo[]

getSensorData(name)

Read a specific sensor’s current values.
string
required
Sensor name.
Returns: Float64Array | null — sensor values, or null if not found.

getContacts()

Get all current contacts.
Returns: ContactInfo[]

getModelOption()

Get simulation options.
Returns: ModelOptions

Example: Model Summary